aboutsummaryrefslogtreecommitdiffstats
path: root/lib/IR/AttributeImpl.h
Commit message (Collapse)AuthorAgeFilesLines
* Update aosp/master LLVM for rebase to r235153Pirama Arumuga Nainar2015-05-181-4/+4
| | | | | Change-Id: I9bf53792f9fc30570e81a8d80d296c681d005ea7 (cherry picked from commit 0c7f116bb6950ef819323d855415b2f2b0aad987)
* Update aosp/master LLVM for rebase to r230699.Stephen Hines2015-03-231-6/+6
| | | | Change-Id: I2b5be30509658cb8266be782de0ab24f9099f9b9
* Update aosp/master LLVM for rebase to r222494.Stephen Hines2014-12-021-12/+14
| | | | Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d
* Update to LLVM 3.5a.Stephen Hines2014-04-241-1/+1
| | | | Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
* [weak vtables] Remove a bunch of weak vtablesJuergen Ributzka2013-11-191-0/+3
| | | | | | | | | | | | This patch removes most of the trivial cases of weak vtables by pinning them to a single object file. The memory leaks in this version have been fixed. Thanks Alexey for pointing them out. Differential Revision: http://llvm-reviews.chandlerc.com/D2068 Reviewed by Andy git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195064 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r194865 and r194874.Alexey Samsonov2013-11-181-0/+2
| | | | | | | | | | | | | This change is incorrect. If you delete virtual destructor of both a base class and a subclass, then the following code: Base *foo = new Child(); delete foo; will not cause the destructor for members of Child class. As a result, I observe plently of memory leaks. Notable examples I investigated are: ObjectBuffer and ObjectBufferStream, AttributeImpl and StringSAttributeImpl. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194997 91177308-0d34-0410-b5e6-96231b3b80d8
* [weak vtables] Remove a bunch of weak vtablesJuergen Ributzka2013-11-151-2/+0
| | | | | | | | | | | This patch removes most of the trivial cases of weak vtables by pinning them to a single object file. Differential Revision: http://llvm-reviews.chandlerc.com/D2068 Reviewed by Andy git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194865 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Give internal classes hidden visibility."Benjamin Kramer2013-09-111-6/+6
| | | | | | | It works with clang, but GCC has different rules so we can't make all of those hidden. This reverts commit r190534. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190536 91177308-0d34-0410-b5e6-96231b3b80d8
* Give internal classes hidden visibility.Benjamin Kramer2013-09-111-6/+6
| | | | | | Worth 100k on a linux/x86_64 Release+Asserts clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190534 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a AttributeSetImpl::dump function.Peter Collingbourne2013-08-021-0/+2
| | | | | | | This is for the benefit of those of us with inferior debuggers which do not permit member function calls on value types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187685 91177308-0d34-0410-b5e6-96231b3b80d8
* Make one of the AttributeSet ctors maintain the invariant that thePeter Collingbourne2013-08-021-0/+9
| | | | | | | | attribute list is ordered by index. Differential Revision: http://llvm-reviews.chandlerc.com/D1265 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187682 91177308-0d34-0410-b5e6-96231b3b80d8
* Reduce the number of indirections in the attributes implementation.Benjamin Kramer2013-07-111-114/+92
| | | | | | | | | | | - Coallocate entires for AttributeSetImpls and Nodes after the class itself. - Remove mutable iterators from immutable classes. - Remove unused context field from AttributeImpl. - Derive Enum/Align/String attribute implementations from AttributeImpl instead of having a whole new inheritance tree for them. - Derive AlignAttributeImpl from EnumAttributeImpl. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186075 91177308-0d34-0410-b5e6-96231b3b80d8
* Now that the underlying issue is fixed, revert r180750 and r180722.Rafael Espindola2013-05-011-1/+1
| | | | | | | | | | | The cause of the windows failures was fixed by r180791. Revert to the state after Sabre's original revert. Original message: revert r179735, it has no testcases, and doesn't really make sense. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180844 91177308-0d34-0410-b5e6-96231b3b80d8
* 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! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180791 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "revert r179735, it has no testcases, and doesn't really make sense."Reid Kleckner2013-04-291-1/+1
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180722 91177308-0d34-0410-b5e6-96231b3b80d8
* revert r179735, it has no testcases, and doesn't really make sense.Chris Lattner2013-04-251-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180574 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup patch:Bill Wendling2013-04-181-9/+9
| | | | | | | | | | | | | | | | 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! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179791 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an option `-enable-old-style-attr-syntax' to print out function ↵Bill Wendling2013-04-171-1/+1
| | | | | | | | | | | 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> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179735 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't add the 'Value' string if there isn't one.Bill Wendling2013-02-281-1/+1
| | | | | | | | | This was causing the folding set to fail to fold attributes, because it was being calculated in one spot without an empty values string but here with an empty values string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176301 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some accessor and query methods for retrieving Attribute objects and such.Bill Wendling2013-02-131-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175046 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for printing out the attribute groups.Bill Wendling2013-02-111-1/+1
| | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174867 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused private field to suppress a build warning.Craig Topper2013-02-061-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174491 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert to storing the attribute's internals as enums, integers, and strings.Bill Wendling2013-02-051-21/+101
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174456 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the AttributeSet's iterators.Bill Wendling2013-02-021-1/+0
| | | | | | | | Use the AttributeSet's iterators in AttrBuilder::hasAttributes() when determining of the intersection of the AttrBuilder and AttributeSet is non-null. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174250 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the AttributeImpl to hold a single Constant* for the values.Bill Wendling2013-02-011-12/+10
| | | | | | | This Constant could be an aggregate to represent multiple values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174228 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some dead code, improve some asserts, and other assorted changes. No ↵Bill Wendling2013-02-011-7/+2
| | | | | | functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174132 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove one of the odious 'Raw' methods.Bill Wendling2013-02-011-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174130 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the AttrBuilder form of the Attribute::get creators.Bill Wendling2013-01-311-0/+2
| | | | | | | | | | | | | | 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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174110 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for emitting a string attribute.Bill Wendling2013-01-311-3/+4
| | | | | | | | | | | Attributes that are strings are typically target-dependent attributes. They are of this form in the IR: "attr" "attr" = "val" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174090 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the Attribute::hasAttributes() function.Bill Wendling2013-01-311-1/+0
| | | | | | | That function doesn't make sense anymore because there's only one attribute per Attribute object now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174044 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r174026, "Remove Attribute::hasAttributes() and make ↵NAKAMURA Takumi2013-01-311-0/+1
| | | | | | | | Attribute::hasAttribute() private." It broke many hosts to crash. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174035 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove Attribute::hasAttributes() and make Attribute::hasAttribute() private.Bill Wendling2013-01-311-1/+0
| | | | | | | | 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(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174026 91177308-0d34-0410-b5e6-96231b3b80d8
* s/Data/Kind/g. No functionality change.Bill Wendling2013-01-291-6/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173827 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert getAttributes() to return an AttributeSetNode.Bill Wendling2013-01-291-0/+14
| | | | | | | | The AttributeSetNode contains all of the attributes. This removes one (hopefully last) use of the Attribute class as a container of multiple attributes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173761 91177308-0d34-0410-b5e6-96231b3b80d8
* Reorder some functions and add comments. No functionality change.Bill Wendling2013-01-291-11/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173733 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to appease some broken compilers by using 'unsigned' instead of 'uint64_t'.Bill Wendling2013-01-281-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173725 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the AttributeWithIndex class.Bill Wendling2013-01-281-14/+5
| | | | | | | | The AttributeWithIndex class exposed the interior structure of the AttributeSet class. That was gross. Remove it and all of the code that relied upon it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173722 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a use of AttributeWithIndex.Bill Wendling2013-01-281-2/+18
| | | | | | | | | | | We want to remove AttributeWithIndex because it provides a non-encapsulated view of the AttributeSetImpl object. Instead, use accessor methods and iterators. Eventually, this code can be simplified because the Attribute object will hold only one attribute instead of multiple attributes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173641 91177308-0d34-0410-b5e6-96231b3b80d8
* Use proper return type for attribute index.Bill Wendling2013-01-271-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173638 91177308-0d34-0410-b5e6-96231b3b80d8
* Push the calculation of the 'Raw' attribute mask down into the ↵Bill Wendling2013-01-271-0/+3
| | | | | | implementation. It in turn uses the correct list for calculating the 'Raw' value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173637 91177308-0d34-0410-b5e6-96231b3b80d8
* Privitize some the copy c'tor and assignment operator of uniquified objects.Bill Wendling2013-01-271-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173632 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some helpful comments.Bill Wendling2013-01-271-6/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173631 91177308-0d34-0410-b5e6-96231b3b80d8
* Start using more of the AttrNode in the AttributeSetImpl class.Bill Wendling2013-01-271-5/+4
| | | | | | | Also add some asserts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173627 91177308-0d34-0410-b5e6-96231b3b80d8
* In the AttributeSetImpl c'tor, fill in the AttrNodes data structure with the ↵Bill Wendling2013-01-271-4/+2
| | | | | | attributes being passed in. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173618 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some introspection functions.Bill Wendling2013-01-251-0/+6
| | | | | | | | | The 'getSlot' function and its ilk allow introspection into the AttributeSet class. However, that class should be opaque. Allow access through accessor methods instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173522 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an accessor method to get the slot's index. This will limit the use of ↵Bill Wendling2013-01-251-0/+4
| | | | | | AttributeWithIndex. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173495 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a profile for uniquifying the AttributeSet with the AttributeSetNodes.Bill Wendling2013-01-241-1/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173313 91177308-0d34-0410-b5e6-96231b3b80d8
* Create a new class: AttributeSetNode.Bill Wendling2013-01-241-1/+34
| | | | | | | | | | | This is a helper class for the AttributeSetImpl class. It holds a set of attributes that apply to a single element: function, return type, or parameter. These are uniqued. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173310 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead methods.Bill Wendling2013-01-231-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173302 91177308-0d34-0410-b5e6-96231b3b80d8
* Make AttributeSet::getFnAttributes() return an AttributeSet instead of an ↵Bill Wendling2013-01-211-0/+2
| | | | | | | | | | Attribute. This is more code to isolate the use of the Attribute class to that of just holding one attribute instead of a collection of attributes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173094 91177308-0d34-0410-b5e6-96231b3b80d8