Commit Graph

4463 Commits

Author SHA1 Message Date
Bill Wendling
07aae2e7d5 Add an enum for the return and function indexes into the AttrListPtr object. This gets rid of some magic numbers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165924 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15 07:29:08 +00:00
Bill Wendling
ad4643f54b Use a ::get method to create the attribute from Attributes::AttrVals instead of a constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165923 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15 06:53:28 +00:00
Bill Wendling
05cc40d20c Move the AttributesImpl header file into the VMCore directory so that it can be opaque.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165920 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15 05:40:12 +00:00
Bill Wendling
cb3de0bc80 Attributes Rewrite
Convert the internal representation of the Attributes class into a pointer to an
opaque object that's uniqued by and stored in the LLVMContext object. The
Attributes class then becomes a thin wrapper around this opaque
object. Eventually, the internal representation will be expanded to include
attributes that represent code generation options, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165917 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15 04:46:55 +00:00
Bill Wendling
e82a040ee0 Remove dead methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165902 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14 09:21:44 +00:00
Bill Wendling
7be7848e17 Remove operator cast method in favor of querying with the correct method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165899 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14 08:54:26 +00:00
Benjamin Kramer
fd8d62c0b4 Fix use after free when deleting attributes in a chained folding set.
Can't follow the intrusive linked list when the element is gone.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165898 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14 08:48:40 +00:00
Bill Wendling
2492a38afc Don't use the new syntax just yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165897 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14 08:25:35 +00:00
Bill Wendling
1feacad0ca Remove the bitwise AND operators from the Attributes class. Replace it with the equivalent from the builder class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165896 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14 07:52:48 +00:00
Bill Wendling
c416795fea Remove the bitwise assignment OR operator from the Attributes class. Replace it with the equivalent from the builder class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165895 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14 07:35:59 +00:00
Bill Wendling
432e606cf1 Remove the bitwise OR operator from the Attributes class. Replace it with the equivalent from the builder class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165894 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14 07:17:34 +00:00
Bill Wendling
3756e70af6 Remove the bitwise XOR operator from the Attributes class. Replace it with the equivalent from the builder class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165893 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14 06:56:13 +00:00
Bill Wendling
5886b7bfc8 Remove the bitwise NOT operator from the Attributes class. Replace it with the equivalent from the builder class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165892 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14 06:39:53 +00:00
Bill Wendling
a19a53065f Decode the LLVM attributes from bitcode using the attributes builder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165891 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14 04:10:01 +00:00
Bill Wendling
da3f9d8edc Use builder to create alignment attributes. Remove dead function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165890 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14 03:58:29 +00:00
Bill Wendling
96a2794ab0 Add the LLVM context to this c'tor. It will be needed in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165687 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11 01:10:00 +00:00
Bill Wendling
3183951d88 Support a common idiom on how to build an Attributes class with a single attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165686 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11 01:05:52 +00:00
Nadav Rotem
e3d0e86919 Add a new interface to allow IR-level passes to access codegen-specific information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165665 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-10 22:04:55 +00:00
Sean Silva
d2139c4e7a Revert r165652: "Remove unnecessary RTTI from the build."
... Apparently the RTTI is still necessary for some reason.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165654 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-10 20:50:36 +00:00
Sean Silva
ef31271dc8 Remove unnecessary RTTI from the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165652 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-10 20:27:20 +00:00
Bill Wendling
5054c35969 Cleanup. Get rid of now dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165613 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-10 08:03:34 +00:00
Bill Wendling
7d2f2496c1 Remove the final bits of Attributes being declared in the Attribute
namespace. Use the attribute's enum value instead. No functionality change
intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165610 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-10 07:36:45 +00:00
Bill Wendling
2fa8af224e Use the attribute enums to query if a function has an attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165551 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09 21:49:51 +00:00
Bill Wendling
3e2d76c946 Use the attribute enums to query if a parameter has an attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165550 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09 21:38:14 +00:00
Bill Wendling
9ef99c96da Revert r165547 to fix build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165548 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09 20:56:48 +00:00
Bill Wendling
f8db977b68 Use a single location for calculating the alignments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165547 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09 20:55:16 +00:00
Bill Wendling
6b73e8a280 Use appropriate method calls to get the alignment value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165541 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09 20:28:54 +00:00
Bill Wendling
28d1c60f89 Inline the checks for mutually exclusive attributes since they're used in only one module.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165539 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09 20:11:19 +00:00
Bill Wendling
3a106e6036 Move the 'FunctionOnly' attributes thingy inside of the Attributes class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165530 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09 19:01:18 +00:00
Micah Villmow
7d66146868 Add in the first step of the multiple pointer support. This adds in support to the data layout for specifying a per address space pointer size.
The next step is to update the optimizers to allow them to optimize the different address spaces with this information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165505 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09 16:06:12 +00:00
Bill Wendling
943c29135e Move the 'ParameterOnly' variable inside of the Attributes class and make it a method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165497 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09 09:51:10 +00:00
Bill Wendling
15c3789763 Remove the now dead VarArgsIncompatible variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165496 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09 09:33:01 +00:00
Bill Wendling
dc4efcbdba Use the enum value of the attributes when removing them from the attributes builder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165495 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09 09:17:28 +00:00
Bill Wendling
2e879bcd52 Use the enum value of the attributes when adding them to the attributes builder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165494 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09 09:11:20 +00:00
Alexey Samsonov
e97a3a4b4f Fix PR14016.
DeadArgumentElimination pass can replace one LLVM function with another,
invalidating a pointer stored in debug info metadata entry for this function.
To fix this, we collect debug info descriptors for functions before
running a DeadArgumentElimination pass and "patch" pointers in metadata nodes
if we replace a function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165490 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09 08:13:15 +00:00
Bill Wendling
6765834754 Create enums for the different attributes.
We use the enums to query whether an Attributes object has that attribute. The
opaque layer is responsible for knowing where that specific attribute is stored.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165488 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09 07:45:08 +00:00
Bill Wendling
50cf36351c Remove some dead methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165485 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09 05:54:39 +00:00
Bill Wendling
060f20a0fa Remove more uses of the attribute enums by supplying appropriate query methods for them.
No functionality change intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165466 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09 00:28:54 +00:00
Bill Wendling
8831c0605b Convert to using the Attributes::Builder interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165465 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09 00:01:21 +00:00
Bill Wendling
f385f4ca1c Use the Attributes::Builder to build the attributes in the parser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165458 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-08 23:27:46 +00:00
Bill Wendling
0327244ec6 Convert the LLVM parser over to using the new Attributes::Builder to build its
attributes objects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165436 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-08 22:20:14 +00:00
Bill Wendling
8e635dbc78 Begin the transition to using the AttributesImpl object for the Attributes ivar.
Start using the AttributesImpl object to hold the value of the attributes. All
queries go through the interfaces now.

This has one unfortunate consequence. I needed to move the AttributesImpl.h file
into include/llvm. But this is only temporary! Otherwise, the changes needed to
support this would be too large.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165433 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-08 21:47:17 +00:00
Micah Villmow
3574eca1b0 Move TargetData to DataLayout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165402 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-08 16:38:25 +00:00
Bill Wendling
b10c88f175 Move more methods out-of-line. This is in preparation for changing the internal
contents of the Attributes class over to an AttributesImpl.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165373 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-07 08:55:05 +00:00
Micah Villmow
bf07a512f2 Implement TargetData with the DataLayout class, this will allow LLVM projects to transition to DataLayout without loosing functionality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165318 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 17:02:14 +00:00
Bill Wendling
e66f3d3ba0 Move methods out-of-line.
The internal representation of the Attributes class will be opaque. All of the
query methods will need to query the opaque class. Therefore, these methods need
to be out-of-line.
No functionality change intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165305 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 06:44:41 +00:00
Bill Wendling
1fddc9d916 Use method to query for attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165304 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 06:18:50 +00:00
Eli Friedman
ce3da6f1d5 Make sure to generate the right kind of MDNode for enum forward declarations.
PR14029, LLVM part.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165288 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 01:49:14 +00:00
Micah Villmow
99b11484d9 Rename the Target specific passes in the DataLayout class to be Target agnostic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165270 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 23:01:22 +00:00
Micah Villmow
e18c2ae7b2 Resubmit the copying of TargetData to DataLayout without any changes to the files, this should fix the problems and the changes to rename to DataLayout will come next.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165262 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 22:08:14 +00:00