1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

54 Commits

Author SHA1 Message Date
Bill Wendling
5534b9814d Use proper type for the index.
llvm-svn: 173646
2013-01-28 01:30:29 +00:00
Bill Wendling
d3dbdfbd8e Remove another use of AttributeWithIndex, using the AttributeSetImpl accessors instead.
llvm-svn: 173644
2013-01-28 01:11:42 +00:00
Bill Wendling
46c2463ec4 Remove another use of AttributeWithIndex, using the AttributeSetImpl accessors instead.
llvm-svn: 173642
2013-01-28 00:46:02 +00:00
Bill Wendling
7de8bf67ce Remove a use of AttributeWithIndex.
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
2013-01-28 00:21:34 +00:00
Bill Wendling
ebbee6a7f6 Improve the debug output a bit.
llvm-svn: 173640
2013-01-27 23:53:56 +00:00
Bill Wendling
5783e1e4be Use proper return type for attribute index.
llvm-svn: 173639
2013-01-27 23:50:44 +00:00
Bill Wendling
dd604e3b22 Push the calculation of the 'Raw' attribute mask down into the implementation. It in turn uses the correct list for calculating the 'Raw' value.
llvm-svn: 173637
2013-01-27 23:41:29 +00:00
Bill Wendling
89179c02f8 Add special 'get' methods to create an Attribute with an alignment. Also do some random cleanup. No functionality change.
llvm-svn: 173635
2013-01-27 22:43:04 +00:00
Bill Wendling
bc0a92c4bd s/AttrList/pImpl/g in AttributeSet. No functionality change.
llvm-svn: 173628
2013-01-27 21:23:46 +00:00
Bill Wendling
2b431a6fb5 Start using more of the AttrNode in the AttributeSetImpl class.
Also add some asserts.

llvm-svn: 173627
2013-01-27 21:20:06 +00:00
Bill Wendling
a298631a83 In the AttributeSetImpl c'tor, fill in the AttrNodes data structure with the attributes being passed in.
llvm-svn: 173618
2013-01-27 12:50:02 +00:00
Bill Wendling
8e66ee6471 Fix miscompile. Add back the use of the ArrayRef version of the ::get method.
llvm-svn: 173613
2013-01-27 10:28:39 +00:00
Bill Wendling
920cb6d54f Remove dead methods.
llvm-svn: 173611
2013-01-27 09:55:44 +00:00
Bill Wendling
d5b4c9438f Convert BuildLibCalls.cpp to using the AttributeSet methods instead of AttributeWithIndex.
llvm-svn: 173536
2013-01-26 00:03:11 +00:00
Bill Wendling
46a6a632dc Remove dead method.
llvm-svn: 173524
2013-01-25 23:14:36 +00:00
Bill Wendling
47efd8b988 Remove some introspection functions.
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
2013-01-25 23:09:36 +00:00
Bill Wendling
c5e0fb9b77 Use the new 'getSlotIndex' method to retrieve the attribute's slot index.
llvm-svn: 173499
2013-01-25 21:46:52 +00:00
Bill Wendling
4e9de7c89b Add an accessor method to get the slot's index. This will limit the use of AttributeWithIndex.
llvm-svn: 173495
2013-01-25 21:30:53 +00:00
Reid Kleckner
3ad597372e Fix MSVC 2012 warning about a 32-bit shift that should be 64-bit
llvm-svn: 173454
2013-01-25 15:35:56 +00:00
Bill Wendling
8e189381a8 Add a profile for uniquifying the AttributeSet with the AttributeSetNodes.
llvm-svn: 173313
2013-01-24 01:01:34 +00:00
Bill Wendling
1898f7c8a5 Create a new class: AttributeSetNode.
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
2013-01-24 00:06:56 +00:00
Bill Wendling
de48b99148 Push down the conversion of the alignment from the bit mask to a real number into the attribute implementation class.
llvm-svn: 173304
2013-01-23 23:00:05 +00:00
Bill Wendling
2d899a78d1 Remove dead methods.
llvm-svn: 173302
2013-01-23 22:38:33 +00:00
Bill Wendling
9e0064d80b Add the IR attribute 'sspstrong'.
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
2013-01-23 06:41:41 +00:00
Bill Wendling
c31f99d129 Remove the last of uses that use the Attribute object as a collection of 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
2013-01-23 06:14:59 +00:00
Bill Wendling
e11164c08d Use the AttributeSet when removing multiple attributes. Use Attribute::AttrKind
when removing one attribute. This further encapsulates the use of the attributes.

llvm-svn: 173214
2013-01-23 00:45:55 +00:00
Bill Wendling
82711f5390 More encapsulation work.
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
2013-01-22 21:15:51 +00:00
Bill Wendling
695b24a4e3 Add a new method that adds the AttributeSet at the given index. No functional change.
llvm-svn: 173109
2013-01-22 00:53:12 +00:00
Bill Wendling
b5cdca5e71 Add the attributes that are passed in instead of the ones we're merging into.
llvm-svn: 173108
2013-01-22 00:41:33 +00:00
Bill Wendling
f8c0d4f9cd Have AttributeSet::getRetAttributes() return an AttributeSet instead of Attribute.
This further restricts the use of the Attribute class to the Attribute family of
classes.

llvm-svn: 173098
2013-01-21 22:44:49 +00:00
Bill Wendling
991cef6573 Make AttributeSet::getFnAttributes() return an AttributeSet instead of an 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
2013-01-21 21:57:28 +00:00
Bill Wendling
198832d632 If the attributes don't exist, just bail for now.
llvm-svn: 172854
2013-01-18 21:56:07 +00:00
Bill Wendling
7777bbbbf3 Use AttributeSet accessor methods instead of Attribute accessor methods.
Further encapsulation of the Attribute object. Don't allow direct access to the
Attribute object as an aggregate.

llvm-svn: 172853
2013-01-18 21:53:16 +00:00
Bill Wendling
b5ddc9a5f8 Push some more methods down to hide the use of the Attribute class.
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
2013-01-18 21:11:39 +00:00
Bill Wendling
3090ccbb64 Revert s/Raw/getBitMask/g name change. This is possibly causing LTO test hangings.
llvm-svn: 172020
2013-01-09 23:36:50 +00:00
Bill Wendling
8416bf8a7e Alter the hasing computation when inserting into the folding set.
llvm-svn: 171960
2013-01-09 09:26:23 +00:00
Bill Wendling
4fe54a5965 Forgot the namespace identifier.
llvm-svn: 171924
2013-01-09 00:32:55 +00:00
Bill Wendling
0b4cfb71d8 Add the integer value of the ConstantInt instead of the Constant* value.
This is causing some problems. The root cause is unknown at this time.

llvm-svn: 171923
2013-01-09 00:32:08 +00:00
Bill Wendling
802784dba2 Rough out a new c'tor for the AttrBuilder class.
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
2013-01-07 08:24:35 +00:00
Benjamin Kramer
a2577beadb Attribute: Make hashes match when looking up AttributeImpls.
This isn't optimal either but fixes a massive compile time regression from the
attribute uniquing work.

llvm-svn: 171624
2013-01-05 12:08:00 +00:00
Chandler Carruth
6e67e85cf1 Switch the empty and tombstone key enumerators to not have explicit
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
2013-01-05 08:47:26 +00:00
NAKAMURA Takumi
86de69e093 IR/Attributes: Provide EmptyKey and TombstoneKey in part of enum, as workaround for gcc-4.4 take #2.
I will investigate, later, what was wrong. I am too tired for now.

llvm-svn: 171611
2013-01-05 07:55:47 +00:00
Bill Wendling
1760ac5cdf Add a method to create an AttributeSet from an AttrBuilder.
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
2013-01-05 01:36:54 +00:00
Bill Wendling
c6b2b9e992 Get rid of the 'Bits' mask in the attribute builder.
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
2013-01-04 23:27:34 +00:00
Bill Wendling
fee1eee2b0 General cleanups.
* Remove dead methods.
* Use the 'operator==' method instead of 'contains', which isn't needed.
* Fix some comments.

No functionality change.

llvm-svn: 171523
2013-01-04 20:54:35 +00:00
Bill Wendling
bc7a24c036 Revert everything to r171366 to try to fix the build.
llvm-svn: 171450
2013-01-03 02:01:50 +00:00
Bill Wendling
e0967fda18 Try again to revert the bad patch. The tree was reverted for some unknown reason
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
2013-01-03 01:54:39 +00:00
Bill Wendling
bc6183b1fb Revert patch. Something snuck in there that shouldn't be.
--- Reverse-merging r171441 into '.':
U    include/llvm/IR/Attributes.h
U    lib/IR/Attributes.cpp

llvm-svn: 171444
2013-01-03 01:46:27 +00:00
Bill Wendling
aa9022eef7 Remove the 'contains' methods in favor of the 'operator==' method.
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
2013-01-03 01:43:05 +00:00
NAKAMURA Takumi
ecc0c04042 Revert r171427, "An intermediate step in the Attributes rewrite."
llvm-svn: 171441
2013-01-03 01:42:06 +00:00