Victor Hernandez
23d77b1e51
Simplify code that chooses when to enumerate function-local metadata operands
...
llvm-svn: 93446
2010-01-14 19:54:11 +00:00
Victor Hernandez
292297e8e2
Avoid modifying ValueEnumerator's MD ValueList by choosing which function-local MD to write based on the function currently being written
...
llvm-svn: 93441
2010-01-14 19:38:44 +00:00
Victor Hernandez
6878a7e7b6
In WriteFunction(), write function-local metadata before we write the instructions, so instruction's references to metadata are fully resolved by the time they get written.
...
llvm-svn: 93403
2010-01-14 01:50:08 +00:00
Victor Hernandez
367ef8bf4a
Clean up unnecessary return and brackets
...
llvm-svn: 93401
2010-01-14 01:46:02 +00:00
Victor Hernandez
55e8dacfed
Fix comment typo
...
llvm-svn: 93355
2010-01-13 21:25:04 +00:00
Victor Hernandez
d250df09f5
Write function-local metadata as a metadata subblock of a funciton block
...
llvm-svn: 93339
2010-01-13 19:37:33 +00:00
Victor Hernandez
9938929f1f
Enumerate function-local metadata (and its types and operands) only during function-incorporation, global metadata continues to be enumerated during creation of ValueEnumerator
...
llvm-svn: 93338
2010-01-13 19:36:16 +00:00
Victor Hernandez
6de2f65f80
Revert 93270 pending investigation of how stray non-constant values end up in ValueEnumerator's ValueList during WriteConstants()
...
llvm-svn: 93289
2010-01-13 03:18:30 +00:00
Victor Hernandez
9b62aee9ad
Make WriteConstants() more robust against stray values in ValueEnumerator's ValueList
...
llvm-svn: 93270
2010-01-12 23:37:59 +00:00
Victor Hernandez
f4272b50d6
Compute isFunctionLocal in MDNode ctor or via argument in new function getWhenValsUnresolved().
...
Document PFS argument to ParseValID() and ConvertGlobalOrMetadataValIDToValue().
llvm-svn: 93108
2010-01-10 07:14:18 +00:00
Devang Patel
de49dd9087
NamedMDNode is never used so there is no need to enumerate it here.
...
llvm-svn: 93039
2010-01-09 01:24:03 +00:00
Devang Patel
ea208bf99c
Derive NamedMDNode from Value.
...
llvm-svn: 93032
2010-01-09 00:30:14 +00:00
Devang Patel
10ee76f7f4
Use separate namespace for named metadata.
...
llvm-svn: 92931
2010-01-07 19:39:36 +00:00
Devang Patel
311b5584e5
Allow null to be an element of NamedMDNode. e.g. !llvm.stuff = !{!0, !1 , null}
...
llvm-svn: 92783
2010-01-05 21:47:32 +00:00
Benjamin Kramer
e90a3c66c4
Avoid going through the LLVMContext for type equality where it's safe to dereference the type pointer.
...
llvm-svn: 92726
2010-01-05 13:12:22 +00:00
Ted Kremenek
15f320fa10
Remove derelict serialization code.
...
llvm-svn: 92374
2009-12-31 23:40:17 +00:00
Chris Lattner
c12382b7c8
rename "elements" of metadata to "operands". "Elements" are
...
things that occur in types. "operands" are things that occur
in values.
llvm-svn: 92322
2009-12-31 01:22:29 +00:00
Chris Lattner
6108ad9dd5
tidy
...
llvm-svn: 92320
2009-12-31 00:51:46 +00:00
Chris Lattner
84e9de4a58
Final step in the metadata API restructuring: move the
...
getMDKindID/getMDKindNames methods to LLVMContext (and add
convenience methods to Module), eliminating MetadataContext.
Move the state that it maintains out to LLVMContext.
llvm-svn: 92259
2009-12-29 09:01:33 +00:00
Chris Lattner
9ec640a902
This is a major cleanup of the instruction metadata interfaces that
...
I asked Devang to do back on Sep 27. Instead of going through the
MetadataContext class with methods like getMD() and getMDs(), just
ask the instruction directly for its metadata with getMetadata()
and getAllMetadata().
This includes a variety of other fixes and improvements: previously
all Value*'s were bloated because the HasMetadata bit was thrown into
value, adding a 9th bit to a byte. Now this is properly sunk down to
the Instruction class (the only place where it makes sense) and it
will be folded away somewhere soon.
This also fixes some confusion in getMDs and its clients about
whether the returned list is indexed by the MDID or densely packed.
This is now returned sorted and densely packed and the comments make
this clear.
This introduces a number of fixme's which I'll follow up on.
llvm-svn: 92235
2009-12-28 23:41:32 +00:00
Chris Lattner
2b65f2d7d4
rename getHandlerNames to getMDKindNames, simplify its interface
...
and simplify all the clients that use it.
llvm-svn: 92224
2009-12-28 20:10:43 +00:00
Chris Lattner
739292d361
change the strange MetadataContext::getMDs function to expose less
...
irrelevant internal implementation details to clients.
llvm-svn: 92210
2009-12-28 08:14:54 +00:00
Chris Lattner
0a47dbff64
eliminate the elem_* iterator stuff from NamedMDNode.
...
llvm-svn: 92208
2009-12-28 07:57:01 +00:00
David Greene
7d1f350ec6
Change errs() to dbgs().
...
llvm-svn: 92092
2009-12-24 00:06:26 +00:00
Chris Lattner
2bbe57b2b8
Revert 85678/85680. The decision is to stay with the current form of
...
indirectbr, thus we don't need "blockaddr(@func, null)". Eliminate it
for simplicity.
llvm-svn: 85699
2009-11-01 01:27:45 +00:00
Chris Lattner
cbab35746f
Make blockaddress(@func, null) be valid, and make 'deleting a basic
...
block with a blockaddress still referring to it' replace the invalid
blockaddress with a new blockaddress(@func, null) instead of a
inttoptr(1).
This changes the bitcode encoding format, and still needs codegen
support (this should produce a non-zero value, referring to the entry
block of the function would also be quite reasonable).
llvm-svn: 85678
2009-10-31 20:08:37 +00:00
Chris Lattner
075e225442
bitcode writer support for blockaddress.
...
llvm-svn: 85376
2009-10-28 05:24:40 +00:00
Chris Lattner
f605b2e8f9
Previously, all operands to Constant were themselves constant.
...
In the new world order, BlockAddress can have a BasicBlock operand.
This doesn't permute much, because if you have a ConstantExpr (or
anything more specific than Constant) we still know the operand has
to be a Constant.
llvm-svn: 85375
2009-10-28 05:14:34 +00:00
Chris Lattner
2bc8002f4c
rename indbr -> indirectbr to appease the residents of #llvm.
...
llvm-svn: 85351
2009-10-28 00:19:10 +00:00
Chris Lattner
fdda543cea
add enough support for indirect branch for the feature test to pass
...
(assembler,asmprinter, bc reader+writer) and document it. Codegen
currently aborts on it.
llvm-svn: 85274
2009-10-27 19:13:16 +00:00
Chris Lattner
fa5b1df64a
Type.h doesn't need to #include LLVMContext.h
...
llvm-svn: 85254
2009-10-27 17:08:31 +00:00
Victor Hernandez
673c036bc7
Remove FreeInst.
...
Remove LowerAllocations pass.
Update some more passes to treate free calls just like they were treating FreeInst.
llvm-svn: 85176
2009-10-26 23:43:48 +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
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
Dale Johannesen
2bb120a97f
Rename msasm to alignstack per review.
...
llvm-svn: 84795
2009-10-21 23:28:00 +00:00
Devang Patel
d10159397a
Do not use SmallVector to store MDNode elements.
...
llvm-svn: 84784
2009-10-21 21:25:09 +00:00
Chris Lattner
3c31b79b45
simplify.
...
llvm-svn: 84465
2009-10-19 05:51:03 +00:00
Victor Hernandez
a25a2890fa
Remove MallocInst from LLVM Instructions.
...
llvm-svn: 84299
2009-10-17 01:18:07 +00:00
Dale Johannesen
7db511a23e
Add an "msasm" flag to inline asm as suggested in PR 5125.
...
A little ugliness is accepted to keep the binary file format
compatible. No functional change yet.
llvm-svn: 84020
2009-10-13 20:46:56 +00:00
Devang Patel
8f81b906ab
Do not write empty METADATA_ATTACHMENT record.
...
llvm-svn: 84006
2009-10-13 18:51:28 +00:00
Chris Lattner
a3cf123e86
strength reduce a ton of type equality tests to check the typeid (Through
...
the new predicates I added) instead of going through a context and doing a
pointer comparison. Besides being cheaper, this allows a smart compiler
to turn the if sequence into a switch.
llvm-svn: 83297
2009-10-05 05:54:46 +00:00
Devang Patel
1070b7a713
s/class Metadata/class MetadataContext/g
...
llvm-svn: 83019
2009-09-28 21:41:20 +00:00
Daniel Dunbar
378331a13d
Tabs -> spaces, and remove trailing whitespace.
...
llvm-svn: 82355
2009-09-20 02:20:51 +00:00
Devang Patel
c195f74dee
Write and read metadata attachments.
...
llvm-svn: 82259
2009-09-18 19:26:43 +00:00
Gabor Greif
4604e0739b
back out my recent commit (r80858), it seems to break self-hosting buildbot's stage 2 configure
...
llvm-svn: 80871
2009-09-03 02:02:59 +00:00
Gabor Greif
68c4f27e59
re-commit r66920 (which has been backed out in r66953) I may have more luck this time. I'll back out if needed...
...
llvm-svn: 80858
2009-09-03 00:18:58 +00:00
Dan Gohman
53f0d68f87
Make LLVM command-line tools overwrite their output files without -f.
...
This is conventional command-line tool behavior. -f now just means
"enable binary output on terminals".
Add a -f option to llvm-extract and llvm-link, for consistency.
Remove F_Force from raw_fd_ostream and enable overwriting and
truncating by default. Introduce an F_Excl flag to permit users to
enable a failure when the file already exists. This flag is
currently unused.
Update Makefiles and documentation accordingly.
llvm-svn: 79990
2009-08-25 15:34:52 +00:00
Chris Lattner
e22a1d941e
remove some uses of llvm/Support/Streams.h
...
llvm-svn: 79842
2009-08-23 08:43:55 +00:00
Chris Lattner
b0478019b4
eliminate the std::ostream forms of the bitcode writing APIs.
...
llvm-svn: 79840
2009-08-23 07:49:08 +00:00