summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
Commit message (Collapse)AuthorAgeFilesLines
* PR14606: debug info imported_module supportDavid Blaikie2013-04-192-6/+48
| | | | | | | | | | Adding another CU-wide list, in this case of imported_modules (since they should be relatively rare, it seemed better to add a list where each element had a "context" value, rather than add a (usually empty) list to every scope). This takes care of DW_TAG_imported_module, but to fully address PR14606 we'll need to expand this to cover DW_TAG_imported_declaration too. llvm-svn: 179836
* Make the TargetIndependent flag have the right boolean value.Bill Wendling2013-04-182-4/+4
| | | | llvm-svn: 179798
* Cleanup patch:Bill Wendling2013-04-182-59/+59
| | | | | | | | | | | | | | | Semantics of parameters named Index and Idx were inconsistent between "include/llvm/IR/Attributes.h", "lib/IR/AttributeImpl.h" and "lib/IR/Attributes.cpp": sometimes these were fixed 1-based indexes of IR parameters (or AttributeSet::ReturnIndex for IR return values or AttributeSet::FunctionIndex for IR functions), other times they were the internal slot for storage in the underlying AttributeSetImpl. I renamed usage of the former to "Index" and usage of the latter to "Slot" ("Slot" was already being used consistently for the latter in a subset of cases) Patch by Stephen Lin! llvm-svn: 179791
* This patch addresses two cleanup issues:Bill Wendling2013-04-182-108/+71
| | | | | | | | | | | | | | | | 1. Verify::VerifyParameterAttrs in "lib/IR/Verifier.cpp" and AttrBuilder::removeFunctionOnlyAttrs in "lib/IR/Attributes.cpp" (only called by Verify::VerifyFunctionAttrs) separately maintained a list of function-only attribute types. I've consolidated the logic into a new function used for both cases in "lib/IR/Verifier.cpp", so this logic is in one place (other than the AsmParser front-end) 2. Various functions in "lib/IR/Verifier.cpp" passed AttributeSet around by reference needlessly, as it's just a handle to an immutable pimpl body. Patch by Stephen Lin! llvm-svn: 179790
* C API: Fix coding styleTom Stellard2013-04-181-1/+1
| | | | llvm-svn: 179785
* Add an option `-enable-old-style-attr-syntax' to print out function ↵Bill Wendling2013-04-173-27/+33
| | | | | | | | | | attributes in the "old" style. It's sometimes beneficial to emit a testcase with the old style attribute syntax. Allow someone to do this. <rdar://problem/13563209> llvm-svn: 179735
* Appease a gcc warning about an overflow in a constant conversion.Bill Wendling2013-04-171-1/+2
| | | | llvm-svn: 179703
* Don't store AttributeSet::FunctionIndex as an int.Benjamin Kramer2013-04-171-1/+1
| | | | | | | | GCC complains: Core.cpp:1449:27: warning: overflow in implicit constant conversion [-Woverflow] I'm not sure if that's really a problem here, but using the enum type is better style anyways. llvm-svn: 179696
* PR15149/r174304 improvement - print hex for unknown dwarf language codes & ↵David Blaikie2013-04-171-2/+7
| | | | | | | | add a test case CR feedback from Rafael Espindola and Paul Robinson. llvm-svn: 179664
* C API: Add LLVMGetBufferSize()Tom Stellard2013-04-161-0/+4
| | | | llvm-svn: 179647
* C API: Add LLVMGetBufferStart()Tom Stellard2013-04-161-0/+3
| | | | llvm-svn: 179646
* C API: Add LLVMAddTargetDependentFunctionAttr()Tom Stellard2013-04-161-0/+11
| | | | llvm-svn: 179645
* Print out the target-independent attributes in a comment before the function ↵Bill Wendling2013-04-161-4/+24
| | | | | | definition. llvm-svn: 179622
* Cleanup naming: DataLayout s/TD/DL/Eli Bendersky2013-04-161-3/+3
| | | | llvm-svn: 179601
* Add four new functions and one new enum to the C API:Hans Wennborg2013-04-161-0/+47
| | | | | | | | | | | | LLVMGetThreadLocalMode - exposes GlobalVariable::getThreadLocalMode LLVMSetThreadLocalMode - exposes GlobalVariable::setThreadLocalMode LLVMIsExternallyInitialized - exposes GlobalVariable::isExternallyInitialized LLVMSetExternallyInitialized - exposes GlobalVariable::setExternallyInitialized LLVMThreadLocalMode - maps to GlobalVariable::ThreadLocalMode Patch by Moritz Maxeiner! llvm-svn: 179588
* Fix a scalability issue with complex ConstantExprs.Benjamin Kramer2013-04-131-9/+19
| | | | | | | | | | | | | | | This is basically the same fix in three different places. We use a set to avoid walking the whole tree of a big ConstantExprs multiple times. For example: (select cmp, (add big_expr 1), (add big_expr 2)) We don't want to visit big_expr twice here, it may consist of thousands of nodes. The testcase exercises this by creating an insanely large ConstantExprs out of a loop. It's questionable if the optimizer should ever create those, but this can be triggered with real C code. Fixes PR15714. llvm-svn: 179458
* Fix a disconcerting bug in Value::isUsedInBasicBlock, which gave wrong ↵Benjamin Kramer2013-04-121-1/+1
| | | | | | | | answers for blocks larger than 3 instrs. Also add a unit test. PR15727. llvm-svn: 179370
* Measure time that IR parsing took as part of the -time-passes measurement.Eli Bendersky2013-04-031-4/+2
| | | | llvm-svn: 178662
* Support and test template arguments for unions.Eric Christopher2013-04-021-1/+2
| | | | llvm-svn: 178586
* Reformat arguments.Eric Christopher2013-04-021-4/+6
| | | | llvm-svn: 178585
* Revert "Adding DIImportedModules to DIScopes."David Blaikie2013-03-282-163/+62
| | | | | | | | | This reverts commit 342d92c7a0adeabc9ab00f3f0d88d739fe7da4c7. Turns out we're going with a different schema design to represent DW_TAG_imported_modules so we won't need this extra field. llvm-svn: 178215
* Fix commentDavid Blaikie2013-03-271-1/+1
| | | | llvm-svn: 178155
* Silence warning about mixing || in &&, fix up 80-cols.Benjamin Kramer2013-03-271-1/+3
| | | | llvm-svn: 178144
* Adding DIImportedModules to DIScopes.David Blaikie2013-03-272-62/+163
| | | | | | | | | | | | This is just the basic groundwork for supporting DW_TAG_imported_module but I wanted to commit this before pushing support further into Clang or LLVM so that this rather churny change is isolated from the rest of the work. The major churn here is obviously adding another field (within the common DIScope prefix) to all DIScopes (files, classes, namespaces, lexical scopes, etc). This should be the last big churny change needed for DW_TAG_imported_module/using directive support/PR14606. llvm-svn: 178099
* Make DIBuilder::createClassType more type safe by returning DICompositeType ↵David Blaikie2013-03-261-8/+10
| | | | | | rather than DIType llvm-svn: 178091
* DebugInfo: more support for mutating DICompositeType to reduce magic number ↵David Blaikie2013-03-261-1/+8
| | | | | | usage in Clang llvm-svn: 178090
* Debug Info: Provide a means to update the members of a composite typeDavid Blaikie2013-03-261-0/+11
| | | | | | | | This will be used to factor out some uses of magic number operand offsets inside Clang where these fields were updated in an effort to resolve forward declarations/circular references. llvm-svn: 178078
* Swap the DIFile in DILexicalBlockFile out for the raw name/directory pairDavid Blaikie2013-03-222-5/+1
| | | | | | This is the last change in transitioning all DIScopes to have a common prefix. llvm-svn: 177756
* reorder the fields in DILexicalBlockFile to match the common prefix for DIScopesDavid Blaikie2013-03-221-2/+2
| | | | llvm-svn: 177754
* Revert r177675. This is language-specific and shouldn't be in the API.Bill Wendling2013-03-221-7/+0
| | | | llvm-svn: 177748
* Refactor out the DIFile parameter to DILexicalBlock to refer to the raw ↵David Blaikie2013-03-222-5/+1
| | | | | | file/directory pair llvm-svn: 177742
* InstCombine: Improve the result bitvect type when folding (cmp pred (load ↵Arnaud A. de Grandmaison2013-03-221-0/+7
| | | | | | | | | | | | | | | (gep GV, i)) C) to a bit test. The original code used i32, and i64 if legal. This introduced unneeded casts when they aren't legal, or when the index variable i has another type. In order of preference: try to use i's type; use the smallest fitting legal type (using an added DataLayout method); default to i32. A testcase checks that this works when the index gep operand is i16. Patch by : Ahmed Bougacha <ahmed.bougacha@gmail.com> Reviewed by : Duncan llvm-svn: 177712
* Reorder the DIFile field in DILexicalBlock to become a prefix common with ↵David Blaikie2013-03-221-1/+1
| | | | | | other DIScopes llvm-svn: 177703
* Refactor the filename/directory information in DISubprogram to refer ↵David Blaikie2013-03-212-6/+2
| | | | | | directly to the pair rather than the DIFile. llvm-svn: 177677
* Add a query to tell if a landing pad has a catch-all.Bill Wendling2013-03-211-0/+7
| | | | llvm-svn: 177675
* Move the DIFile in DISubprogram to the beginning to be a common prefix along ↵David Blaikie2013-03-211-2/+2
| | | | | | with other DIScopes llvm-svn: 177674
* Remove unused field in DISubprogramDavid Blaikie2013-03-212-11/+13
| | | | llvm-svn: 177661
* Hoist the definition of getTypeSizeInBits to be inlinable and in theChandler Carruth2013-03-211-41/+0
| | | | | | | | | | | | | | | | | | header. This method is called in the hot path for *many* passes, SROA is what caught my interest. A common pattern is that which branch of the switch should be taken is known in the callsite and so it is a very good candidate for inlining and simplification. Moving it into the header allows the optimizer to fold a lot of boring, repeatitive code in callers of this routine. I'm seeing pretty significant speedups in parts of SROA and I suspect other passes will see similar speedups if they end up working with type sizes frequently. I've not seen any significant growth of the binaries as a consequence, but let me know if you see anything suspicious here. llvm-svn: 177632
* Debug info: refactor the first field of DICompileUnit to be a raw ↵David Blaikie2013-03-202-11/+12
| | | | | | | | file/directory pair This removes the DICompileUnit special case from DIScope. llvm-svn: 177610
* Use pre-inc, pre-dec when possible.Jakub Staszak2013-03-201-6/+6
| | | | | | They are generally faster (at least not slower) than post-inc, post-dec. llvm-svn: 177608
* Debug Info: Swap the 2nd and 3rd parameters to DICompileUnit to match the ↵David Blaikie2013-03-201-1/+1
| | | | | | common DIScope prefix llvm-svn: 177595
* Remove unused field in DICompileUnitDavid Blaikie2013-03-202-10/+9
| | | | llvm-svn: 177590
* minor code style cleanup.Chris Lattner2013-03-201-2/+2
| | | | llvm-svn: 177576
* Refactor file/directory path in namespace debug info to refer directly to ↵David Blaikie2013-03-202-5/+1
| | | | | | | | the pair rather than the DIFile (paired to a Clang test - excuse the buildbot skew/fallout) llvm-svn: 177566
* DIBuilder: allow linkage name to be specified for global variablesDavid Blaikie2013-03-201-4/+13
| | | | | | Patch by Kai Nacke (kai@redstar.de) llvm-svn: 177547
* Reorder the DIFile parameter in DINameSpaceDavid Blaikie2013-03-201-1/+1
| | | | | | | | Moving the DIFile parameter to immediately proceed the tag so that it will be a common prefix with other DIScopes (once the DIFile is replaced with the raw file/directory pair). llvm-svn: 177492
* Provide more details for DINameSpace debug info in the IR comment annotationsDavid Blaikie2013-03-201-0/+10
| | | | | | | Sorry for the version skew - I should've committed this before the corresponding Clang test case. llvm-svn: 177486
* Refactor the DIFile (2nd) parameter to DITypes to be an MDNode reference to ↵David Blaikie2013-03-202-14/+15
| | | | | | | | | a raw directory/file pair This makes DIType's first non-tag parameter the same as DIFile's, allowing them to both share the common implementation of getFilename/getDirectory in DIScope. llvm-svn: 177467
* Move the DIFile operand to DITypes from the 4th operand to the 2nd.David Blaikie2013-03-191-44/+21
| | | | | | | | This is another step along the way to making all DIScopes have a common prefix which can be added to in a general manner to support using directives (DW_TAG_imported_module). llvm-svn: 177462
* The testing to ensure a vector of zeros of type floating point isn't ↵David Tweed2013-03-191-6/+3
| | | | | | misclassified as negative zero can be simplified, as pointed out by Duncan Sands. llvm-svn: 177386
OpenPOWER on IntegriCloud