summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Attributes.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Use AttributeSet accessor methods instead of Attribute accessor methods.Bill Wendling2013-01-181-0/+5
| | | | | | | Further encapsulation of the Attribute object. Don't allow direct access to the Attribute object as an aggregate. llvm-svn: 172853
* Push some more methods down to hide the use of the Attribute class.Bill Wendling2013-01-181-2/+21
| | | | | | | | Because the Attribute class is going to stop representing a collection of attributes, limit the use of it as an aggregate in favor of using AttributeSet. This replaces some of the uses for querying the function attributes. llvm-svn: 172844
* Revert s/Raw/getBitMask/g name change. This is possibly causing LTO test ↵Bill Wendling2013-01-091-17/+20
| | | | | | hangings. llvm-svn: 172020
* Alter the hasing computation when inserting into the folding set.Bill Wendling2013-01-091-2/+1
| | | | llvm-svn: 171960
* Forgot the namespace identifier.Bill Wendling2013-01-091-2/+2
| | | | llvm-svn: 171924
* Add the integer value of the ConstantInt instead of the Constant* value.Bill Wendling2013-01-091-0/+8
| | | | | | This is causing some problems. The root cause is unknown at this time. llvm-svn: 171923
* Rough out a new c'tor for the AttrBuilder class.Bill Wendling2013-01-071-0/+20
| | | | | | | | This c'tor takes the AttributeSet class as the parameter. It will eventually grab the attributes from the specified index and create a new attribute builder with those attributes. llvm-svn: 171712
* Attribute: Make hashes match when looking up AttributeImpls.Benjamin Kramer2013-01-051-1/+2
| | | | | | | This isn't optimal either but fixes a massive compile time regression from the attribute uniquing work. llvm-svn: 171624
* Switch the empty and tombstone key enumerators to not have explicitChandler Carruth2013-01-051-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | values -- that's not required to fix the bug that was cropping up, and the values selected made the enumeration's underlying type signed and introduced some warnings. This fixes the -Werror build. The underlying issue here was that the DenseMapInfo was casting values completely outside the range of the underlying storage of the enumeration to the enumeration's type. GCC went and "optimized" that into infloops and other misbehavior. By providing designated special values for these keys in the dense map, we ensure they are indeed representable and that they won't be used for anything else. It might be better to reuse None for the empty key and have the tombstone share the value of the sentinel enumerator, but honestly having 2 extra enumerators seemed not to matter and this seems a bit simpler. I'll let Bill shuffle this around (or ask me to shuffle it around) if he prefers it to look a different way. I also made the switch a bit more clear (and produce a better assert) that the enumerators are *never* going to show up and are errors if they do. llvm-svn: 171614
* IR/Attributes: Provide EmptyKey and TombstoneKey in part of enum, as ↵NAKAMURA Takumi2013-01-051-0/+2
| | | | | | | | workaround for gcc-4.4 take #2. I will investigate, later, what was wrong. I am too tired for now. llvm-svn: 171611
* Add a method to create an AttributeSet from an AttrBuilder.Bill Wendling2013-01-051-6/+46
| | | | | | | | The Attribute class is eventually going to represent one attribute. So we need this class to create the set of attributes. Add some iterator methods to the builder to access its internal bits in a nice way. llvm-svn: 171586
* Get rid of the 'Bits' mask in the attribute builder.Bill Wendling2013-01-041-26/+91
| | | | | | | | The bit mask thing will be a thing of the past. It's not extensible enough. Get rid of its use here. Opt instead for using a vector to hold the attributes. Note: Some of this code will become obsolete once the rewrite is further along. llvm-svn: 171553
* General cleanups.Bill Wendling2013-01-041-24/+23
| | | | | | | | | | * Remove dead methods. * Use the 'operator==' method instead of 'contains', which isn't needed. * Fix some comments. No functionality change. llvm-svn: 171523
* Revert everything to r171366 to try to fix the build.Bill Wendling2013-01-031-22/+3
| | | | llvm-svn: 171450
* Try again to revert the bad patch. The tree was reverted for some unknown reasonBill Wendling2013-01-031-15/+5
| | | | | | | | | | | before the last time. --- Reverse-merging r171442 into '.': U include/llvm/IR/Attributes.h U lib/IR/Attributes.cpp U lib/IR/AttributeImpl.h llvm-svn: 171448
* Revert patch. Something snuck in there that shouldn't be.Bill Wendling2013-01-031-1/+20
| | | | | | | | --- Reverse-merging r171441 into '.': U include/llvm/IR/Attributes.h U lib/IR/Attributes.cpp llvm-svn: 171444
* Remove the 'contains' methods in favor of the 'operator==' method.Bill Wendling2013-01-031-5/+15
| | | | | | | The 'operator==' method is a bit clearer and much less verbose for somethings that should have only one value. Remove from the AttrBuilder for consistency. llvm-svn: 171442
* Revert r171427, "An intermediate step in the Attributes rewrite."NAKAMURA Takumi2013-01-031-20/+1
| | | | llvm-svn: 171441
* Make the type signature more strict.Bill Wendling2013-01-031-2/+2
| | | | llvm-svn: 171434
* An intermediate step in the Attributes rewrite.Bill Wendling2013-01-021-1/+20
| | | | | | | | | | Modify the AttrBuilder class to store the attributes as a set instead of as a bit mask. The Attribute class will represent only one attribute instead of a collection of attributes. This is the wave of the future! llvm-svn: 171427
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-021-2/+2
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
OpenPOWER on IntegriCloud