1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
Commit Graph

66 Commits

Author SHA1 Message Date
Eli Friedman
a5dba5246a Fix gcc warning.
llvm-svn: 91715
2009-12-18 21:07:18 +00:00
Victor Hernandez
44652ca549 Formalize MDNode's function-localness:
- an MDNode is designated as function-local when created, and continues to be even if its operands are modified not to refer to function-local IR
- function-localness is designated via lowest bit in SubclassData
- getLocalFunction() descends MDNode tree to see if it is consistently function-local

Add verification of MDNodes to checks that MDNodes are consistently function-local.
Update AsmWriter to use isFunctionLocal().

llvm-svn: 91708
2009-12-18 20:09:14 +00:00
Victor Hernandez
f6bcc2747e Use different name for argument and field
llvm-svn: 91524
2009-12-16 08:10:57 +00:00
Victor Hernandez
e91192950c MDNodes that refer to an instruction are local to a function; in that case, explicitly keep track of the function they are local to
llvm-svn: 91497
2009-12-16 02:52:09 +00:00
Nick Lewycky
44573bb42b Oops! Fix bug introduced in my recent cleanup change. Thanks to Tobias Grosser
for pointing this out.

llvm-svn: 90015
2009-11-27 19:57:53 +00:00
Nick Lewycky
c0a516186a Fix typo spotted by Gabor Greif.
llvm-svn: 89976
2009-11-26 23:19:05 +00:00
Nick Lewycky
07c3eb54a4 Clean up file, no functionality change.
llvm-svn: 89974
2009-11-26 22:54:26 +00:00
Devang Patel
c70b8eefb7 Do not use StringRef in DebugInfo interface.
This allows StringRef to skip controversial if(str) check in constructor.
Buildbots, wait for corresponding clang and llvm-gcc FE check-ins!

llvm-svn: 86914
2009-11-12 00:50:58 +00:00
Jeffrey Yasskin
23ac706aab Fix DenseMap iterator constness.
This patch forbids implicit conversion of DenseMap::const_iterator to
DenseMap::iterator which was possible because DenseMapIterator inherited
(publicly) from DenseMapConstIterator. Conversion the other way around is now
allowed as one may expect.

The template DenseMapConstIterator is removed and the template parameter
IsConst which specifies whether the iterator is constant is added to
DenseMapIterator.

Actually IsConst parameter is not necessary since the constness can be
determined from KeyT but this is not relevant to the fix and can be addressed
later.

Patch by Victor Zverovich!

llvm-svn: 86636
2009-11-10 01:02:17 +00:00
Devang Patel
9027c8f10f Do not use expensive sort().
llvm-svn: 85130
2009-10-26 17:09:00 +00:00
Devang Patel
5c461d6dcd Hide MetadataContext implementation details.
llvm-svn: 84886
2009-10-22 19:36:54 +00:00
Devang Patel
2a0e2f1794 Fix getMDs() interface such that it does not expose implementation details.
llvm-svn: 84885
2009-10-22 18:55:16 +00:00
Devang Patel
1fa3e26912 Using TrackingVH instead of WeakVH or WeakMetadataVH.
llvm-svn: 84884
2009-10-22 18:25:28 +00:00
Devang Patel
944cbf7647 Sort handler names to ensure deterministic behavior.
llvm-svn: 84878
2009-10-22 17:40:37 +00:00
Devang Patel
6df2865e24 Fix getHandlerNames() interface. Now it populate clinet supplied small vector with handler names.
llvm-svn: 84820
2009-10-22 01:01:24 +00:00
Devang Patel
125861a48c Use StringRef to construct MDString.
llvm-svn: 84811
2009-10-22 00:22:05 +00:00
Devang Patel
068e5420ce Remove meaningless const.
Pass StringRef by value.

llvm-svn: 84804
2009-10-22 00:10:15 +00:00
Devang Patel
f9d56f4830 Derive metadata hierarchy from Value instead of User.
llvm-svn: 84801
2009-10-21 23:57:35 +00:00
Benjamin Kramer
1af3b8ca4d Fix thinko noticed by Chris.
llvm-svn: 84797
2009-10-21 23:29:32 +00:00
Benjamin Kramer
87ca5b37b6 Remove pointless return; at end of function.
llvm-svn: 84794
2009-10-21 23:27:54 +00:00
Benjamin Kramer
a5cb240184 Simplify code. No intended functionality change.
llvm-svn: 84790
2009-10-21 22:55:51 +00:00
Devang Patel
7e3d4b199c Use StringRef.
llvm-svn: 84786
2009-10-21 21:57:13 +00:00
Devang Patel
d10159397a Do not use SmallVector to store MDNode elements.
llvm-svn: 84784
2009-10-21 21:25:09 +00:00
Devang Patel
7137e5f065 Incorporate various suggestions Chris gave during metadata review.
- i < getNumElements()  instead of getNumElements() > i
- Make setParent() private
- Fix use of resizeOperands
- Reset HasMetadata bit after removing all metadata attached to an instruction
- Efficient use of iterators

llvm-svn: 84765
2009-10-21 17:33:41 +00:00
Devang Patel
7edc7aa34d Cosmetic changes.
s/validName/isValidName/g
s/with an Instruction/to an Instruction/g
s/RegisterMDKind/registerMDKind/g

llvm-svn: 84689
2009-10-20 22:50:27 +00:00
Owen Anderson
fb4db70d0f Banish ConstantsLock. It's serving no purpose other than slowing things down
at the moment.

llvm-svn: 84529
2009-10-19 20:11:52 +00:00
Chris Lattner
1971f7636b various cleanups.
llvm-svn: 84471
2009-10-19 07:10:59 +00:00
Devang Patel
95b6efe972 Add copyMD to copy metadata from one instruction to another instruction.
llvm-svn: 84113
2009-10-14 17:02:49 +00:00
Devang Patel
729589a539 Copy metadata when value is RAUW'd. It is debatable whether this is the right approach for custom metadata data in general. However, right now the only custom data user, "dbg", expects this behavior while FE is constructing llvm IR with debug info.
llvm-svn: 83977
2009-10-13 17:00:54 +00:00
Devang Patel
c1e370a29c Lookup handler name only when assertions are enabled.
llvm-svn: 83114
2009-09-29 22:05:52 +00:00
Devang Patel
39b5b72d74 Add removeMD().
llvm-svn: 83107
2009-09-29 20:42:25 +00:00
Devang Patel
292bcd8ca1 Only one custom meadata of each kind can be attached with an instruction.
llvm-svn: 83105
2009-09-29 20:30:57 +00:00
Devang Patel
351585921d Use assertion instead of early exit to catch malformed custom metadata store.
llvm-svn: 83102
2009-09-29 20:01:19 +00:00
Devang Patel
629ad89954 Parse custom metadata attached with an instruction.
llvm-svn: 83033
2009-09-29 00:01:14 +00:00
Devang Patel
1070b7a713 s/class Metadata/class MetadataContext/g
llvm-svn: 83019
2009-09-28 21:41:20 +00:00
Devang Patel
d836a7d651 Do not use global typedef for MDKindID.
llvm-svn: 83016
2009-09-28 21:14:55 +00:00
Devang Patel
18dae0848f Do not leave behind metadata while cloning an instruction.
llvm-svn: 82638
2009-09-23 18:32:25 +00:00
Devang Patel
c195f74dee Write and read metadata attachments.
llvm-svn: 82259
2009-09-18 19:26:43 +00:00
Devang Patel
f15eea3399 Print debug info attached with an instruction.
llvm-svn: 82075
2009-09-16 20:21:17 +00:00
Devang Patel
253aa4d192 Add llvm::Metadata to manage metadata used in a context.
This interface will be used to attach metadata with an instruction.

llvm-svn: 82060
2009-09-16 18:09:00 +00:00
Devang Patel
2cbc3ef1e9 Take lock before removing a node from MDNodeSet.
llvm-svn: 81356
2009-09-09 17:44:26 +00:00
Devang Patel
2898d3cb86 Enable MDNode uniquing.
llvm-svn: 81355
2009-09-09 17:30:04 +00:00
Daniel Dunbar
b258ff7cee Disable MDNode uniquing.
- Hopefully this unbreaks some llvm-gcc bootstraps.

llvm-svn: 81141
2009-09-07 04:05:49 +00:00
Devang Patel
40a0a72be8 While replacing an MDNode elment, properly update MDNode's operand list.
MDNode's operand list does not include all elements.

llvm-svn: 81045
2009-09-04 21:32:05 +00:00
Devang Patel
27616c3c80 Now Bitcode reader bug is fixed. Reapply 80839.
Use CallbackVH, instead of WeakVH, to hold MDNode elements.
Use FoldingSetNode to unique MDNodes in a context.
Use CallbackVH hooks to update context's MDNodeSet appropriately.

llvm-svn: 80868
2009-09-03 01:39:20 +00:00
Devang Patel
317ab82083 Revert 80839 for now. It causes test failures.
llvm-svn: 80841
2009-09-02 21:49:26 +00:00
Devang Patel
c4be6559c4 Use CallbackVH, instead of WeakVH, to hold MDNode elements.
Use FoldingSetNode to unique MDNodes in a context.
Use CallbackVH hooks to update context's MDNodeSet appropriately.

llvm-svn: 80839
2009-09-02 21:22:09 +00:00
Devang Patel
2d78fddeb4 For now disable MDNode uniquing. This fixes llvm-gcc bootstrap failure on certain Mac OS X 10.5. I am working on a proper fix.
llvm-svn: 80738
2009-09-01 23:56:42 +00:00
Devang Patel
0ac8889288 Remove an entry from ValueMap before removing elements.
llvm-svn: 80247
2009-08-27 15:32:38 +00:00
Devang Patel
10c075a316 Revert 79977. It causes llvm-gcc bootstrap failures on some platforms.
llvm-svn: 80073
2009-08-26 05:01:18 +00:00