summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Attributes.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Change getSlotIndex to return unsigned.Rafael Espindola2013-04-301-2/+2
| | | | | | | | | | | The actual storage was already using unsigned, but the interface was using uint64_t. This is wasteful on 32 bits and looks to be the root causes of a miscompilation on Windows where a value was being sign extended to 64bits to compare with the result of getSlotIndex. Patch by Pasi Parviainen! llvm-svn: 180791
* Revert the command line option patch. However, keep the part that makes this ↵Bill Wendling2013-04-291-2/+1
| | | | | | pass on Windows. I.e., we don't emit the target dependent attributes in a comment before the function. llvm-svn: 180750
* Revert "revert r179735, it has no testcases, and doesn't really make sense."Reid Kleckner2013-04-291-6/+10
| | | | | | | | | | This un-reverts r179735 and reverts commit r180574. This fixes assertion failures for me locally and should fix the failures on Windows reported widely on llvm-dev. We should check if the bots caught this and if so why not. llvm-svn: 180722
* revert r179735, it has no testcases, and doesn't really make sense.Chris Lattner2013-04-251-10/+6
| | | | llvm-svn: 180574
* Add CodeGen support for functions that always return arguments via a new ↵Stephen Lin2013-04-201-0/+3
| | | | | | 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
* Attributes: Don't print trailing whitespace on the function attribute comment.Benjamin Kramer2013-04-191-5/+4
| | | | llvm-svn: 179849
* Make the TargetIndependent flag have the right boolean value.Bill Wendling2013-04-181-1/+1
| | | | llvm-svn: 179798
* Cleanup patch:Bill Wendling2013-04-181-50/+50
| | | | | | | | | | | | | | | 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-181-27/+0
| | | | | | | | | | | | | | | | 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
* Add an option `-enable-old-style-attr-syntax' to print out function ↵Bill Wendling2013-04-171-5/+11
| | | | | | | | | | 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
* Add some additonal attribute helper functions. Test will be on followReed Kotler2013-03-131-0/+7
| | | | | | up putback to clang for mips16. llvm-svn: 176968
* Don't add an attribute that already exists and don't remove an attribute ↵Bill Wendling2013-02-281-0/+2
| | | | | | that doesn't exist. llvm-svn: 176289
* Unify clang/llvm attributes for asan/tsan/msan (LLVM part)Kostya Serebryany2013-02-261-12/+12
| | | | | | | | | | | | | | | | | | | These are two related changes (one in llvm, one in clang). LLVM: - rename address_safety => sanitize_address (the enum value is the same, so we preserve binary compatibility with old bitcode) - rename thread_safety => sanitize_thread - rename no_uninitialized_checks -> sanitize_memory CLANG: - add __attribute__((no_sanitize_address)) as a synonym for __attribute__((no_address_safety_analysis)) - add __attribute__((no_sanitize_thread)) - add __attribute__((no_sanitize_memory)) for S in address thread memory If -fsanitize=S is present and __attribute__((no_sanitize_S)) is not set llvm attribute sanitize_S llvm-svn: 176075
* Remove warning about default covering no cases.Bill Wendling2013-02-221-3/+2
| | | | llvm-svn: 175846
* Add a bitmask for NoBuiltin. This should *not* be used.Bill Wendling2013-02-221-1/+2
| | | | llvm-svn: 175843
* Implement the NoBuiltin attribute.Bill Wendling2013-02-221-1/+31
| | | | | | | | The 'nobuiltin' attribute is applied to call sites to indicate that LLVM should not treat the callee function as a built-in function. I.e., it shouldn't try to replace that function with different code. llvm-svn: 175835
* Futureproof AttrBuild if we ever have more than 64 attr enum values.Benjamin Kramer2013-02-181-14/+12
| | | | | | | Currently we're at 34. Bitset should compile into virtually the same code as uint64_t here. llvm-svn: 175437
* GCC doesn't like ++ on enums.Benjamin Kramer2013-02-161-1/+1
| | | | llvm-svn: 175373
* Turn the enum attributes DenseSet in AttrBuilder into a set of bits.Benjamin Kramer2013-02-161-24/+23
| | | | | | | | Avoids malloc and is a lot denser. We lose iteration over target independent attributes, but that's a strange interface anyways and didn't have any users outside of AttrBuilder. llvm-svn: 175370
* Simplify the 'operator<' for the attribute object.Bill Wendling2013-02-151-15/+13
| | | | llvm-svn: 175252
* Revert "Simplify the attributes '<' comparison function."Anna Zaks2013-02-151-13/+15
| | | | | | This reverts commit 82c101153fe7b35bce48781fab038e1b8f31a7bd. llvm-svn: 175250
* Simplify the attributes '<' comparison function.Bill Wendling2013-02-151-15/+13
| | | | llvm-svn: 175235
* Use array_pod_sort.Bill Wendling2013-02-131-1/+1
| | | | llvm-svn: 175048
* Add some accessor and query methods for retrieving Attribute objects and such.Bill Wendling2013-02-131-0/+41
| | | | llvm-svn: 175046
* Support string attributes in the AttrBuilder.Bill Wendling2013-02-121-11/+25
| | | | llvm-svn: 174948
* Add support for printing out the attribute groups.Bill Wendling2013-02-111-12/+19
| | | | | | | | | | | | This emits the attribute groups that are used by the functions. (It currently doesn't print out return type or parameter attributes within attribute groups.) Note: The functions still retrieve their attributes from the "old" bitcode format (using the deprecated 'Raw()' method). This means that string attributes within an attribute group will not show up during a disassembly. This will be addressed in a future commit. llvm-svn: 174867
* [tsan/msan] adding thread_safety and uninitialized_checks attributesKostya Serebryany2013-02-111-0/+6
| | | | llvm-svn: 174864
* The 'Raw' method cannot handle 'string' attributes. Don't even try.Bill Wendling2013-02-101-0/+4
| | | | llvm-svn: 174848
* Handle string attributes in the AttrBuilder.Bill Wendling2013-02-101-1/+5
| | | | llvm-svn: 174834
* Add accessor for the LLVMContext.Bill Wendling2013-02-101-0/+4
| | | | llvm-svn: 174824
* Add a 'StringRef' version of hasAttribute.Bill Wendling2013-02-061-4/+16
| | | | | | | Fix the 'operator==' and 'hasAttributes' queries to take into account target-dependent attributes. llvm-svn: 174481
* Add methods to merge an AttrBuilder into another builder.Bill Wendling2013-02-061-0/+17
| | | | | | | | This is useful when parsing an object that references multiple attribute groups. N.B. If both builders have alignments specified, then they should match! llvm-svn: 174480
* Add the target-dependent (string) attributes from the AttrBuilder to the ↵Bill Wendling2013-02-051-2/+13
| | | | | | AttributeSet. llvm-svn: 174467
* Convert to storing the attribute's internals as enums, integers, and strings.Bill Wendling2013-02-051-106/+150
| | | | | | | | The stuff we're handing are all enums (Attribute::AttrKind), integers and strings. Don't convert them to Constants, which is an unnecessary step here. The rest of the changes are mostly mechanical. llvm-svn: 174456
* Add target-dependent versions of addAttribute/removeAttribute to AttrBuilder.Bill Wendling2013-02-051-1/+13
| | | | llvm-svn: 174356
* Initial cleanups of the param-attribute code in the bitcode reader/writer.Bill Wendling2013-02-041-41/+1
| | | | | | | | | Rename the PARAMATTR_CODE_ENTRY to PARAMATTR_CODE_ENTRY_OLD. It will be replaced by another encoding. Keep around the current LLVM attribute encoder/decoder code, but move it to the bitcode directories so that no one's tempted to use them. llvm-svn: 174335
* Remove AttrBuilder::Raw().Bill Wendling2013-02-021-25/+18
| | | | llvm-svn: 174251
* Use the AttributeSet's iterators.Bill Wendling2013-02-021-4/+22
| | | | | | | Use the AttributeSet's iterators in AttrBuilder::hasAttributes() when determining of the intersection of the AttrBuilder and AttributeSet is non-null. llvm-svn: 174250
* Change the AttributeImpl to hold a single Constant* for the values.Bill Wendling2013-02-011-15/+13
| | | | | | This Constant could be an aggregate to represent multiple values. llvm-svn: 174228
* Remove some dead code, improve some asserts, and other assorted changes. No ↵Bill Wendling2013-02-011-22/+11
| | | | | | functionality change. llvm-svn: 174132
* Remove one of the odious 'Raw' methods.Bill Wendling2013-02-011-11/+2
| | | | llvm-svn: 174130
* Use iterators instead of relying upon a bitmask of attributes to remove ↵Bill Wendling2013-02-011-11/+17
| | | | | | attributes from an AttrBuilder. llvm-svn: 174123
* Add iterators to the AttributeSet class so that we can access the Attributes ↵Bill Wendling2013-01-311-0/+12
| | | | | | in a nice way. llvm-svn: 174120
* s/AttrBuilder::addAttributes/AttrBuilder::addAttribute/g because that's more ↵Bill Wendling2013-01-311-15/+15
| | | | | | descriptive of what it actually is. llvm-svn: 174116
* Remove the AttrBuilder form of the Attribute::get creators.Bill Wendling2013-01-311-34/+36
| | | | | | | | | | | | | The AttrBuilder is for building a collection of attributes. The Attribute object holds only one attribute. So it's not really useful for the Attribute object to have a creator which takes an AttrBuilder. This has two fallouts: 1. The AttrBuilder no longer holds its internal attributes in a bit-mask form. 2. The attributes are now ordered alphabetically (hence why the tests have changed). llvm-svn: 174110
* Add support for emitting a string attribute.Bill Wendling2013-01-311-42/+73
| | | | | | | | | | Attributes that are strings are typically target-dependent attributes. They are of this form in the IR: "attr" "attr" = "val" llvm-svn: 174090
* Remove the Attribute::hasAttributes() function.Bill Wendling2013-01-311-9/+1
| | | | | | | That function doesn't make sense anymore because there's only one attribute per Attribute object now. llvm-svn: 174044
* Revert r174026, "Remove Attribute::hasAttributes() and make ↵NAKAMURA Takumi2013-01-311-6/+14
| | | | | | | | Attribute::hasAttribute() private." It broke many hosts to crash. llvm-svn: 174035
* Remove Attribute::hasAttributes() and make Attribute::hasAttribute() private.Bill Wendling2013-01-311-14/+6
| | | | | | | | The Attribute::hasAttributes() is kind of meaningless since an Attribute can have only one attribute. And we would rather people use the 'operator==' instead of Attribute::hasAttribute(). llvm-svn: 174026
* Revert for now:Bill Wendling2013-01-311-12/+19
| | | | | | | | | --- Reverse-merging r174010 into '.': U include/llvm/IR/Attributes.h U lib/IR/Verifier.cpp U lib/IR/Attributes.cpp llvm-svn: 174012
OpenPOWER on IntegriCloud