summaryrefslogtreecommitdiff
path: root/lib/IR/Attributes.cpp
Commit message (Collapse)AuthorAge
...
* Add accessor for the LLVMContext.Bill Wendling2013-02-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174824 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a 'StringRef' version of hasAttribute.Bill Wendling2013-02-06
| | | | | | | | Fix the 'operator==' and 'hasAttributes' queries to take into account target-dependent attributes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174481 91177308-0d34-0410-b5e6-96231b3b80d8
* Add methods to merge an AttrBuilder into another builder.Bill Wendling2013-02-06
| | | | | | | | | This is useful when parsing an object that references multiple attribute groups. N.B. If both builders have alignments specified, then they should match! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174480 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the target-dependent (string) attributes from the AttrBuilder to the ↵Bill Wendling2013-02-05
| | | | | | AttributeSet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174467 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert to storing the attribute's internals as enums, integers, and strings.Bill Wendling2013-02-05
| | | | | | | | | 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
* Add target-dependent versions of addAttribute/removeAttribute to AttrBuilder.Bill Wendling2013-02-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174356 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial cleanups of the param-attribute code in the bitcode reader/writer.Bill Wendling2013-02-04
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174335 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove AttrBuilder::Raw().Bill Wendling2013-02-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174251 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the AttributeSet's iterators.Bill Wendling2013-02-02
| | | | | | | | 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-01
| | | | | | | 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-01
| | | | | | 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-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174130 91177308-0d34-0410-b5e6-96231b3b80d8
* Use iterators instead of relying upon a bitmask of attributes to remove ↵Bill Wendling2013-02-01
| | | | | | attributes from an AttrBuilder. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174123 91177308-0d34-0410-b5e6-96231b3b80d8
* Add iterators to the AttributeSet class so that we can access the Attributes ↵Bill Wendling2013-01-31
| | | | | | in a nice way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174120 91177308-0d34-0410-b5e6-96231b3b80d8
* s/AttrBuilder::addAttributes/AttrBuilder::addAttribute/g because that's more ↵Bill Wendling2013-01-31
| | | | | | descriptive of what it actually is. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174116 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the AttrBuilder form of the Attribute::get creators.Bill Wendling2013-01-31
| | | | | | | | | | | | | | 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-31
| | | | | | | | | | | 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-31
| | | | | | | 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-31
| | | | | | | | 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-31
| | | | | | | | 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
* Revert for now:Bill Wendling2013-01-31
| | | | | | | | | | | --- Reverse-merging r174010 into '.': U include/llvm/IR/Attributes.h U lib/IR/Verifier.cpp U lib/IR/Attributes.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174012 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the AttrBuilder version of the Attribute::get function.Bill Wendling2013-01-31
| | | | | | | | The AttrBuilder is there to build up multiple attributes. The Attribute class represents only one attribute at a time. So remove this unnecessary builder creator method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174010 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure that the Attribute object represents one attribute only.Bill Wendling2013-01-31
| | | | | | | | Several places were still treating the Attribute object as respresenting multiple attributes. Those places now use the AttributeSet to represent multiple attributes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174003 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert typeIncompatible to return an AttributeSet.Bill Wendling2013-01-30
| | | | | | | There are still places which treat the Attribute object as a collection of attributes. I'm systematically removing them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173990 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove redundant code.Bill Wendling2013-01-30
| | | | | | | It was creating a new AttrBuilder when we could just fill in the AttrBuilder we're building. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173975 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a couple of accessor methods to get the kind and values of an attribute.Bill Wendling2013-01-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173828 91177308-0d34-0410-b5e6-96231b3b80d8
* s/Data/Kind/g. No functionality change.Bill Wendling2013-01-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173827 91177308-0d34-0410-b5e6-96231b3b80d8
* AttributeSet::get(): Fix a valgrind error. It doesn't affect actual ↵NAKAMURA Takumi2013-01-29
| | | | | | | | behavior, though. Don't touch I->first on the end iterator, I == E! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173804 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert getAttributes() to return an AttributeSetNode.Bill Wendling2013-01-29
| | | | | | | | 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
* Use an AttrBuilder to generate the correct AttributeSet.Bill Wendling2013-01-29
| | | | | | | | | | We no longer accept an encoded integer as representing all of the attributes. Convert this via the AttrBuilder class into an AttributeSet with the correct representation (an AttributeSetImpl that holds a list of Attribute objects). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173750 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert the AttrBuilder into a list of Attributes instead of one Attribute ↵Bill Wendling2013-01-29
| | | | | | object that holds all of its attributes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173742 91177308-0d34-0410-b5e6-96231b3b80d8
* S'more small non-functional changes in comments and #includes.Bill Wendling2013-01-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173738 91177308-0d34-0410-b5e6-96231b3b80d8
* Reorder some functions and add comments. No functionality change.Bill Wendling2013-01-29
| | | | 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-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173725 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the AttributeWithIndex class.Bill Wendling2013-01-28
| | | | | | | | 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
* Mid-air collision. reapply r173656.Bill Wendling2013-01-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173661 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrite the removeAttr() method.Bill Wendling2013-01-28
| | | | | | | | | | | This now uses the AttributeSet object instead of the Attribute / AttributeWithIndex objects. It's fairly simple now. It goes through all of the subsets before the one we're modifying, adds them to the new set. It then adds the modified subset (with the requested attributes removed). And then adds the rest of the subsets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173660 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrite the addAttr() method.Bill Wendling2013-01-28
| | | | | | | | | | This now uses the AttributeSet object instead of the Attribute / AttributeWithIndex objects. It's fairly simple now. It goes through all of the subsets before the one we're modifying, adds them to the new set. It then adds the modified subset. And then adds the rest of the subsets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173659 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r173646, "Use proper type for the index."NAKAMURA Takumi2013-01-28
| | | | | | Unfortunately, msvc miscompiles it. Investigating. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173656 91177308-0d34-0410-b5e6-96231b3b80d8
* Use proper type for the index.Bill Wendling2013-01-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173646 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove another use of AttributeWithIndex, using the AttributeSetImpl ↵Bill Wendling2013-01-28
| | | | | | accessors instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173644 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove another use of AttributeWithIndex, using the AttributeSetImpl ↵Bill Wendling2013-01-28
| | | | | | accessors instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173642 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a use of AttributeWithIndex.Bill Wendling2013-01-28
| | | | | | | | | | | 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
* Improve the debug output a bit.Bill Wendling2013-01-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173640 91177308-0d34-0410-b5e6-96231b3b80d8
* Use proper return type for attribute index.Bill Wendling2013-01-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173639 91177308-0d34-0410-b5e6-96231b3b80d8
* Push the calculation of the 'Raw' attribute mask down into the ↵Bill Wendling2013-01-27
| | | | | | 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
* Add special 'get' methods to create an Attribute with an alignment. Also do ↵Bill Wendling2013-01-27
| | | | | | some random cleanup. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173635 91177308-0d34-0410-b5e6-96231b3b80d8
* s/AttrList/pImpl/g in AttributeSet. No functionality change.Bill Wendling2013-01-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173628 91177308-0d34-0410-b5e6-96231b3b80d8
* Start using more of the AttrNode in the AttributeSetImpl class.Bill Wendling2013-01-27
| | | | | | | 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-27
| | | | | | attributes being passed in. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173618 91177308-0d34-0410-b5e6-96231b3b80d8