summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Attributes.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove the AttrBuilder version of the Attribute::get function.Bill Wendling2013-01-311-19/+12
| | | | | | | | 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. llvm-svn: 174010
* Make sure that the Attribute object represents one attribute only.Bill Wendling2013-01-311-0/+3
| | | | | | | | Several places were still treating the Attribute object as respresenting multiple attributes. Those places now use the AttributeSet to represent multiple attributes. llvm-svn: 174003
* Convert typeIncompatible to return an AttributeSet.Bill Wendling2013-01-301-10/+8
| | | | | | | There are still places which treat the Attribute object as a collection of attributes. I'm systematically removing them. llvm-svn: 173990
* Remove redundant code.Bill Wendling2013-01-301-20/+2
| | | | | | | It was creating a new AttrBuilder when we could just fill in the AttrBuilder we're building. llvm-svn: 173975
* Add a couple of accessor methods to get the kind and values of an attribute.Bill Wendling2013-01-291-0/+8
| | | | llvm-svn: 173828
* s/Data/Kind/g. No functionality change.Bill Wendling2013-01-291-24/+24
| | | | llvm-svn: 173827
* AttributeSet::get(): Fix a valgrind error. It doesn't affect actual ↵NAKAMURA Takumi2013-01-291-1/+1
| | | | | | | | behavior, though. Don't touch I->first on the end iterator, I == E! llvm-svn: 173804
* Convert getAttributes() to return an AttributeSetNode.Bill Wendling2013-01-291-62/+93
| | | | | | | The AttributeSetNode contains all of the attributes. This removes one (hopefully last) use of the Attribute class as a container of multiple attributes. llvm-svn: 173761
* Use an AttrBuilder to generate the correct AttributeSet.Bill Wendling2013-01-291-10/+14
| | | | | | | | | 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). llvm-svn: 173750
* Convert the AttrBuilder into a list of Attributes instead of one Attribute ↵Bill Wendling2013-01-291-2/+15
| | | | | | object that holds all of its attributes. llvm-svn: 173742
* S'more small non-functional changes in comments and #includes.Bill Wendling2013-01-291-2/+5
| | | | llvm-svn: 173738
* Reorder some functions and add comments. No functionality change.Bill Wendling2013-01-291-331/+326
| | | | llvm-svn: 173733
* Try to appease some broken compilers by using 'unsigned' instead of 'uint64_t'.Bill Wendling2013-01-281-18/+15
| | | | llvm-svn: 173725
* Remove the AttributeWithIndex class.Bill Wendling2013-01-281-78/+68
| | | | | | | 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. llvm-svn: 173722
* Mid-air collision. reapply r173656.Bill Wendling2013-01-281-5/+5
| | | | llvm-svn: 173661
* Rewrite the removeAttr() method.Bill Wendling2013-01-281-42/+40
| | | | | | | | | | 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. llvm-svn: 173660
* Rewrite the addAttr() method.Bill Wendling2013-01-281-73/+76
| | | | | | | | | 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. llvm-svn: 173659
* Revert r173646, "Use proper type for the index."NAKAMURA Takumi2013-01-281-7/+7
| | | | | | Unfortunately, msvc miscompiles it. Investigating. llvm-svn: 173656
* Use proper type for the index.Bill Wendling2013-01-281-7/+7
| | | | llvm-svn: 173646
* Remove another use of AttributeWithIndex, using the AttributeSetImpl ↵Bill Wendling2013-01-281-6/+14
| | | | | | accessors instead. llvm-svn: 173644
* Remove another use of AttributeWithIndex, using the AttributeSetImpl ↵Bill Wendling2013-01-281-6/+8
| | | | | | accessors instead. llvm-svn: 173642
* Remove a use of AttributeWithIndex.Bill Wendling2013-01-281-11/+15
| | | | | | | | | | 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. llvm-svn: 173641
* Improve the debug output a bit.Bill Wendling2013-01-271-2/+7
| | | | llvm-svn: 173640
* Use proper return type for attribute index.Bill Wendling2013-01-271-1/+1
| | | | llvm-svn: 173639
* Push the calculation of the 'Raw' attribute mask down into the ↵Bill Wendling2013-01-271-9/+22
| | | | | | implementation. It in turn uses the correct list for calculating the 'Raw' value. llvm-svn: 173637
* Add special 'get' methods to create an Attribute with an alignment. Also do ↵Bill Wendling2013-01-271-0/+11
| | | | | | some random cleanup. No functionality change. llvm-svn: 173635
* s/AttrList/pImpl/g in AttributeSet. No functionality change.Bill Wendling2013-01-271-23/+23
| | | | llvm-svn: 173628
* Start using more of the AttrNode in the AttributeSetImpl class.Bill Wendling2013-01-271-5/+7
| | | | | | Also add some asserts. llvm-svn: 173627
* In the AttributeSetImpl c'tor, fill in the AttrNodes data structure with the ↵Bill Wendling2013-01-271-4/+40
| | | | | | attributes being passed in. llvm-svn: 173618
* Fix miscompile. Add back the use of the ArrayRef version of the ::get method.Bill Wendling2013-01-271-2/+5
| | | | llvm-svn: 173613
* Remove dead methods.Bill Wendling2013-01-271-16/+2
| | | | llvm-svn: 173611
* Convert BuildLibCalls.cpp to using the AttributeSet methods instead of ↵Bill Wendling2013-01-261-2/+8
| | | | | | AttributeWithIndex. llvm-svn: 173536
* Remove dead method.Bill Wendling2013-01-251-8/+0
| | | | llvm-svn: 173524
* Remove some introspection functions.Bill Wendling2013-01-251-57/+81
| | | | | | | | The 'getSlot' function and its ilk allow introspection into the AttributeSet class. However, that class should be opaque. Allow access through accessor methods instead. llvm-svn: 173522
* Use the new 'getSlotIndex' method to retrieve the attribute's slot index.Bill Wendling2013-01-251-2/+2
| | | | llvm-svn: 173499
* Add an accessor method to get the slot's index. This will limit the use of ↵Bill Wendling2013-01-251-0/+6
| | | | | | AttributeWithIndex. llvm-svn: 173495
* Fix MSVC 2012 warning about a 32-bit shift that should be 64-bitReid Kleckner2013-01-251-2/+2
| | | | llvm-svn: 173454
* Add a profile for uniquifying the AttributeSet with the AttributeSetNodes.Bill Wendling2013-01-241-5/+0
| | | | llvm-svn: 173313
* Create a new class: AttributeSetNode.Bill Wendling2013-01-241-0/+72
| | | | | | | | | | 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. llvm-svn: 173310
* Push down the conversion of the alignment from the bit mask to a real number ↵Bill Wendling2013-01-231-4/+6
| | | | | | into the attribute implementation class. llvm-svn: 173304
* Remove dead methods.Bill Wendling2013-01-231-20/+0
| | | | llvm-svn: 173302
* Add the IR attribute 'sspstrong'.Bill Wendling2013-01-231-0/+3
| | | | | | | | | | | | | | | | | | | | | SSPStrong applies a heuristic to insert stack protectors in these situations: * A Protector is required for functions which contain an array, regardless of type or length. * A Protector is required for functions which contain a structure/union which contains an array, regardless of type or length. Note, there is no limit to the depth of nesting. * A protector is required when the address of a local variable (i.e., stack based variable) is exposed. (E.g., such as through a local whose address is taken as part of the RHS of an assignment or a local whose address is taken as part of a function argument.) This patch implements the SSPString attribute to be equivalent to SSPRequired. This will change in a subsequent patch. llvm-svn: 173230
* Remove the last of uses that use the Attribute object as a collection of ↵Bill Wendling2013-01-231-0/+13
| | | | | | | | | attributes. Collections of attributes are handled via the AttributeSet class now. This finally frees us up to make significant changes to how attributes are structured. llvm-svn: 173228
* Use the AttributeSet when removing multiple attributes. Use Attribute::AttrKindBill Wendling2013-01-231-0/+10
| | | | | | when removing one attribute. This further encapsulates the use of the attributes. llvm-svn: 173214
* More encapsulation work.Bill Wendling2013-01-221-28/+17
| | | | | | | Use the AttributeSet when we're talking about more than one attribute. Add a function that adds a single attribute. No functionality change intended. llvm-svn: 173196
* Add a new method that adds the AttributeSet at the given index. No ↵Bill Wendling2013-01-221-8/+3
| | | | | | functional change. llvm-svn: 173109
* Add the attributes that are passed in instead of the ones we're merging into.Bill Wendling2013-01-221-2/+2
| | | | llvm-svn: 173108
* Have AttributeSet::getRetAttributes() return an AttributeSet instead of ↵Bill Wendling2013-01-211-12/+23
| | | | | | | | | Attribute. This further restricts the use of the Attribute class to the Attribute family of classes. llvm-svn: 173098
* Make AttributeSet::getFnAttributes() return an AttributeSet instead of an ↵Bill Wendling2013-01-211-0/+20
| | | | | | | | | 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. llvm-svn: 173094
* If the attributes don't exist, just bail for now.Bill Wendling2013-01-181-1/+1
| | | | llvm-svn: 172854
OpenPOWER on IntegriCloud