Chris Lattner
ad2926bbb4
remove a bunch of locking from LLVMContextImpl. Since only one thread
...
can be banging on a context at a time, this isn't needed. Owen, please
review.
llvm-svn: 85728
2009-11-01 18:42:03 +00:00
Chris Lattner
55a53e4e79
the verifier shouldn't modify the IR.
...
llvm-svn: 85722
2009-11-01 18:11:50 +00:00
Chris Lattner
baa216cd33
fix an issue where the verifier would reject a function whose entry
...
block had its address taken even if the blockaddress was dead.
llvm-svn: 85706
2009-11-01 04:08:01 +00:00
Chris Lattner
6e87bdadb9
Fix BlockAddress::replaceUsesOfWithOnConstant to correctly
...
maintain the block use count in SubclassData.
llvm-svn: 85701
2009-11-01 03:03:03 +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
3982885b51
if basic blocks are destroyed while there are *just* BlockAddress' hanging
...
around, then zap them. This is analogous to dangling constantexprs hanging
off functions.
llvm-svn: 85627
2009-10-30 22:39:36 +00:00
Chris Lattner
74ed905748
make hasAddressTaken() constant time by storing a refcount in BB's subclass data.
...
llvm-svn: 85625
2009-10-30 22:33:29 +00:00
Chris Lattner
5b38f2ec49
it isn't valid to take the address of the entry block.
...
llvm-svn: 85621
2009-10-30 22:15:48 +00:00
Dan Gohman
42e985b07a
Simplify this code and avoid an extra space character in the output.
...
llvm-svn: 85568
2009-10-30 02:01:10 +00:00
Chris Lattner
57a8d8d4e0
add sanity check for indbr.
...
llvm-svn: 85496
2009-10-29 05:53:32 +00:00
Dan Gohman
c80f1a4033
Add a hasAddressTaken for BasicBlock.
...
llvm-svn: 85449
2009-10-29 00:09:08 +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
c22b8deb03
'static const void *X = &&y' can only be put in the
...
readonly section if a reference to the containing function
is valid in the readonly section.
llvm-svn: 85370
2009-10-28 04:12:16 +00:00
Chris Lattner
a1aa8a092d
asmprinter support for BlockAddress.
...
llvm-svn: 85367
2009-10-28 03:38:12 +00:00
Chris Lattner
24819a6e06
when we tear down a module, we need to be careful to
...
zap BlockAddress values.
llvm-svn: 85366
2009-10-28 03:37:35 +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
28895dac5b
IR support for the new BlockAddress constant kind. This is
...
untested and there is no way to use it, next up: doing battle
with asmparser.
llvm-svn: 85349
2009-10-28 00:01:44 +00:00
Jeffrey Yasskin
173c58db88
Rename lib/VMCore/ConstantsContext.h:ValueMap<> to ConstantUniqueMap<> to avoid
...
colliding with llvm/ADT/ValueMap.h:ValueMap<>.
llvm-svn: 85344
2009-10-27 23:45:55 +00:00
Devang Patel
b7572e3783
Factor out redundancy from clone() implementations.
...
llvm-svn: 85327
2009-10-27 22:16:29 +00:00
Victor Hernandez
0f662a7acf
Rename MallocFreeHelper as MemoryBuiltins
...
llvm-svn: 85286
2009-10-27 20:05:49 +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
6c86b93663
Rename MallocHelper as MallocFreeHelper, since it now also identifies calls to free()
...
llvm-svn: 85181
2009-10-26 23:58:56 +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
9027c8f10f
Do not use expensive sort().
...
llvm-svn: 85130
2009-10-26 17:09:00 +00:00
Nick Lewycky
2b8400628d
Remove includes of Support/Compiler.h that are no longer needed after the
...
VISIBILITY_HIDDEN removal.
llvm-svn: 85043
2009-10-25 06:57:41 +00:00
Nick Lewycky
711c726c97
Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.
...
Chris claims we should never have visibility_hidden inside any .cpp file but
that's still not true even after this commit.
llvm-svn: 85042
2009-10-25 06:33:48 +00:00
Nick Lewycky
cacdc4d65a
Remove ICmpInst::isSignedPredicate which was a reimplementation
...
CmpInst::isSigned.
llvm-svn: 85037
2009-10-25 05:20:17 +00:00
Nick Lewycky
a16e115bd4
Sink isTrueWhenEqual from ICmpInst to CmpInst. Add a matching isFalseWhenEqual
...
which is equal to !isTrueWhenEqual for ints but not for floats.
llvm-svn: 85036
2009-10-25 03:50:03 +00:00
Dan Gohman
e970f8a450
Make DominanceFrontierBase::print's output prettier.
...
llvm-svn: 85011
2009-10-24 20:01:11 +00:00
Victor Hernandez
e8998896f5
Auto-upgrade free instructions to calls to the builtin free function.
...
Update all analysis passes and transforms to treat free calls just like FreeInst.
Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised.
llvm-svn: 84987
2009-10-24 04:23:03 +00:00
Victor Hernandez
8428eb5720
Remove AllocationInst. Since MallocInst went away, AllocaInst is the only subclass of AllocationInst, so it no longer is necessary.
...
llvm-svn: 84969
2009-10-23 21:09:37 +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
Dale Johannesen
2bb120a97f
Rename msasm to alignstack per review.
...
llvm-svn: 84795
2009-10-21 23:28:00 +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