summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
Commit message (Collapse)AuthorAgeFilesLines
* revert r179735, it has no testcases, and doesn't really make sense.Chris Lattner2013-04-253-32/+28
| | | | llvm-svn: 180574
* Add some constraints to use of 'returned':Stephen Lin2013-04-231-0/+4
| | | | | | | | | 1) Disallow 'returned' on parameter that is also 'sret' (no sensible semantics, as far as I can tell). 2) Conservatively disallow tail calls through 'returned' parameters that also are 'zext' or 'sext' (for consistency with treatment of other zero-extending and sign-extending operations in tail call position detection...can be revised later to handle situations that can be determined to be safe). This is a new attribute that is not yet used, so there is no impact. llvm-svn: 180118
* Expose IRBuilder::CreateAtomicRMW as LLVMBuildAtomicRMW in llvm-c.Carlo Kok2013-04-231-0/+36
| | | | llvm-svn: 180100
* Struct-path aware TBAA: update getMostGenericTBAA Manman Ren2013-04-221-36/+0
| | | | | | | | | | The tag is of type TBAANode when flag EnableStructPathTBAA is off. Move implementation of MDNode::getMostGenericTBAA to TypeBasedAliasAnalysis.cpp since it depends on how to interprete the MDNodes for scalar TBAA and struct-path aware TBAA. llvm-svn: 180068
* Move C++ code out of the C headers and into either C++ headersEric Christopher2013-04-221-0/+1
| | | | | | | or the C++ files themselves. This enables people to use just a C compiler to interoperate with LLVM. llvm-svn: 180063
* Also verify llvm.compiler_used.Rafael Espindola2013-04-221-1/+2
| | | | llvm-svn: 180020
* Clarify that llvm.used can contain aliases.Rafael Espindola2013-04-221-0/+23
| | | | | | | Also add a check for llvm.used in the verifier and simplify clients now that they can assume they have a ConstantArray. llvm-svn: 180019
* Revert "Revert "PR14606: debug info imported_module support""David Blaikie2013-04-222-6/+48
| | | | | | | | | | This reverts commit r179840 with a fix to test/DebugInfo/two-cus-from-same-file.ll I'm not sure why that test only failed on ARM & MIPS and not X86 Linux, even though the debug info was clearly invalid on all of them, but this ought to fix it. llvm-svn: 179996
* Add CodeGen support for functions that always return arguments via a new ↵Stephen Lin2013-04-203-6/+55
| | | | | | parameter attribute 'returned', which is taken advantage of in target-independent tail call opportunity detection and in ARM call lowering (when placed on an integral first parameter). llvm-svn: 179925
* 80-col fixup.Eric Christopher2013-04-191-1/+2
| | | | llvm-svn: 179881
* Rename ClassType to the more accurate UnderlyingType and document its purpose.Adrian Prantl2013-04-191-3/+3
| | | | | | rdar://problem/13463793 llvm-svn: 179877
* Attributes: Don't print trailing whitespace on the function attribute comment.Benjamin Kramer2013-04-191-5/+4
| | | | llvm-svn: 179849
* Revert "PR14606: debug info imported_module support"Eric Christopher2013-04-192-48/+6
| | | | | | This reverts commit r179836 as it seems to have caused test failures. llvm-svn: 179840
* 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
OpenPOWER on IntegriCloud