Gabor Greif
624a31f2eb
Finally land the InvokeInst operand reordering.
...
I have audited all getOperandNo calls now, fixing
hidden assumptions. CallSite related uglyness will
be eliminated successively.
Note this patch has a long and griveous history,
for all the back-and-forths have a look at
CallSite.h's log.
llvm-svn: 99399
2010-03-24 13:21:49 +00:00
Chris Lattner
a9eb6a6987
add some accessors to callsite/callinst/invokeinst to check
...
for the noinline attribute, and make the inliner refuse to
inline a call site when the call site is marked noinline even
if the callee isn't. This fixes PR6682.
llvm-svn: 99341
2010-03-23 22:59:07 +00:00
Chris Lattner
5808510db7
fix an infinite loop in Module::getEndianness, PR6684
...
patch by Alex Mac!
llvm-svn: 99330
2010-03-23 21:48:41 +00:00
Gabor Greif
adb193f366
add assert in argpromotion, which cannot trigger
...
if Function::hasAddressTaken works as advertised
also included some cosmetic cleanups
llvm-svn: 99276
2010-03-23 14:40:20 +00:00
Gabor Greif
652eabfbb0
word-o
...
llvm-svn: 99275
2010-03-23 13:45:54 +00:00
Chris Lattner
c4be1194e5
Change intrinsic result type for void to store it as an empty list
...
instead of as a single element list with VoidTy. Now with a fix
for the verifier.
llvm-svn: 99206
2010-03-22 20:56:36 +00:00
Gabor Greif
ef64581628
backing out r99170 because it still fails on clang-x86_64-darwin10-fnt
...
llvm-svn: 99171
2010-03-22 09:11:00 +00:00
Gabor Greif
04f7f381ae
Now that hopefully all direct accesses to InvokeInst operands are fixed
...
we can reapply the InvokeInst operand reordering patch. (see r98957).
llvm-svn: 99170
2010-03-22 08:28:00 +00:00
Jeffrey Yasskin
94ecd53a3a
Free all Constants in ~LLVMConstantImpl. We avoid assertion failures
...
by dropping all references from all constants that can use other
constants before trying to destroy any of them.
I also had to free bugpoint's Module in ~BugDriver().
llvm-svn: 99160
2010-03-22 05:23:37 +00:00
Jeffrey Yasskin
f4aab98729
Re-add the Metadata.h include to LLVMContextImpl.h so that MDNode is complete
...
where FoldingSet<MDNode> is instantiated. Clang and MSVC complain; gcc
doesn't.
llvm-svn: 99147
2010-03-21 22:08:41 +00:00
Jeffrey Yasskin
98a4091e4a
Move the LLVMContextImpl implementation into a .cpp file.
...
llvm-svn: 99146
2010-03-21 21:17:34 +00:00
Jeffrey Yasskin
50a0593887
Memoize InlineAsms into the LLVMContext and delete them on shutdown.
...
Fixes PR803.
llvm-svn: 99143
2010-03-21 20:37:19 +00:00
Devang Patel
72d0d6e368
call void @llvm.dbg.declare(metadata !{i32* null}, metadata !1 )
...
is valid, but not useful, when variable identified by !1 is optimized away by the optimizer.
llvm-svn: 98986
2010-03-19 21:06:24 +00:00
Gabor Greif
0bfed2dc4e
back out r98957, it broke http://smooshlab.apple.com:8010/builders/clang-x86_64-darwin10-fnt/builds/703 in the nightly test suite
...
llvm-svn: 98958
2010-03-19 13:50:02 +00:00
Gabor Greif
953702b8e6
Recommit r80858 again (which has been backed out in r80871).
...
This time I did a self-hosted bootstrap on Linux x86-64,
with no problems. Let's see how darwin 64-bit self-hosting
goes. At the first sign of failure I'll back this out.
Maybe the valgrind bots give me a hint of what may be wrong
(it at all).
llvm-svn: 98957
2010-03-19 11:55:53 +00:00
Chris Lattner
b51960824f
add asmprinter suport for unions, fixing Feature/unions.ll to actually
...
be doing something useful.
llvm-svn: 98677
2010-03-16 21:21:35 +00:00
Chris Lattner
72761c4e3d
fix some pointless layering violations.
...
llvm-svn: 98460
2010-03-14 01:56:06 +00:00
Jeffrey Yasskin
c57043834c
Allow types that have been forwarded to to be freed.
...
Tested: make check-lit && valgrind --dsymutil=yes --leak-check=full unittests/ExecutionEngine/JIT/Debug/JITTests
llvm-svn: 98447
2010-03-13 20:09:55 +00:00
Jeffrey Yasskin
819ce89d8f
Delete MDNodes when LLVMContext is destroyed. Previous attempts: r97918, r97788.
...
Tested: clang debug bootstrap, llvm-gcc bootstrap, `make check-lit`
after configuring with --with-llvmgccdir (and this did run the
FrontendC* tests this time)
llvm-svn: 98410
2010-03-13 01:26:15 +00:00
Benjamin Kramer
adf47face1
Remove duplicated code. No functionality change.
...
llvm-svn: 98156
2010-03-10 16:04:20 +00:00
Jeffrey Yasskin
82f0356671
Roll back r97918 again. Just configuring against llvm-gcc wasn't enough to run
...
the FrontendC* tests. :(
llvm-svn: 97921
2010-03-07 19:26:40 +00:00
Jeffrey Yasskin
daae74ff0d
Reapply r97788 to free MDNodes when the LLVMContext is destroyed. It
...
bootstraps llvm-gcc this time.
llvm-svn: 97918
2010-03-07 18:46:57 +00:00
Nick Lewycky
711ead8deb
Add verification of union types.
...
llvm-svn: 97889
2010-03-06 20:26:48 +00:00
Jeffrey Yasskin
ec7d47ec83
Revert r97788 because it broke test/FrontendC/2010-02-16-DbgVarScope.c.
...
llvm-svn: 97792
2010-03-05 06:43:49 +00:00
Jeffrey Yasskin
a526081ebf
Free MDNodes when the LLVMContext is destroyed. Leak found by Valgrind.
...
llvm-svn: 97788
2010-03-05 05:47:09 +00:00
Jeffrey Yasskin
5bdd4796e4
Stop leaking MDStrings.
...
llvm-svn: 97763
2010-03-04 23:24:19 +00:00
Erick Tryzelaar
4e7593750d
Rewrite makefiles to explicitly reference DESTDIR to fix bug 3153.
...
We need this so can not bake DESTDIR into the O'Caml symlinks.
llvm-svn: 97743
2010-03-04 20:56:19 +00:00
Nick Lewycky
58ab63e179
Make the 'icmp pred trunc(ext(X)), CST --> icmp pred X, ext(trunc(CST))'
...
transformation much more careful. Truncating binary '01' to '1' sounds like it's
safe until you realize that it switched from positive to negative under a signed
interpretation, and that depends on the icmp predicate.
Also a few miscellaneous cleanups.
llvm-svn: 97721
2010-03-04 06:54:10 +00:00
Chris Lattner
9e230fb6b2
fix incorrect folding of icmp with undef, PR6481.
...
llvm-svn: 97659
2010-03-03 19:46:03 +00:00
Erick Tryzelaar
66bf49241f
Add Module functions in place of module providers.
...
llvm-svn: 97608
2010-03-02 23:58:54 +00:00
Erick Tryzelaar
0d0b778d8b
Rename LLVMUseIteratorRef to LLVMUseRef since we don't refer to iterators in llvm-c.
...
llvm-svn: 97585
2010-03-02 20:32:28 +00:00
Duncan Sands
5a60a368dd
Rather than passing "false" for InsertBefore, AddressSpace for ThreadLocal,
...
and nothing for AddressSpace, pass 0 for InsertBefore, "false" for ThreadLocal
and AddressSpace for AddressSpace. Spotted by gcc-4.5.
llvm-svn: 97563
2010-03-02 11:18:43 +00:00
Erick Tryzelaar
24ec58b50b
Fix looking up MD names to not need a module.
...
llvm-svn: 97550
2010-03-02 05:32:52 +00:00
Dan Gohman
4fc1d1236f
Don't print "Modified" for passes which haven't modified anything.
...
llvm-svn: 97446
2010-03-01 17:34:28 +00:00
Erick Tryzelaar
c6e78e3503
Add support for global variables in an address space for llvm-c and ocaml.
...
llvm-svn: 97377
2010-02-28 09:46:13 +00:00
Erick Tryzelaar
08d9f8e8fe
Add indirect br support to llvm-c and ocaml.
...
llvm-svn: 97376
2010-02-28 09:46:06 +00:00
Erick Tryzelaar
9401ea01cc
Add metadata functions to llvm-c and ocaml.
...
llvm-svn: 97375
2010-02-28 09:45:59 +00:00
Erick Tryzelaar
f7bbb83b17
Add the new builder arthmetic instructions to llvm-c and ocaml.
...
llvm-svn: 97372
2010-02-28 05:51:43 +00:00
Erick Tryzelaar
9c6bd15491
Add the new union arthmetic instructions to llvm-c and ocaml.
...
llvm-svn: 97371
2010-02-28 05:51:33 +00:00
Erick Tryzelaar
b405437c48
Add generic binary op and cast builder functions.
...
llvm-svn: 97370
2010-02-28 05:51:27 +00:00
Dale Johannesen
53dbd67b19
Add type printing for Metadata pseudo.
...
llvm-svn: 97251
2010-02-26 19:38:59 +00:00
Dan Gohman
a15e497d94
Teach the constant folder about union types.
...
llvm-svn: 97142
2010-02-25 16:45:19 +00:00
Dan Gohman
f42f098d1d
Remove code which assumes it knows how vectors are stored in memory.
...
llvm-svn: 97141
2010-02-25 16:05:33 +00:00
Nick Lewycky
c443274bc1
Dump the presence of attached metadata even if we don't know what it is. This
...
format is not parsable, even if the module is legal. To get parsable output,
dump the module instead of the function or smaller, since metadata kind are
attached to the module (not the context).
llvm-svn: 97124
2010-02-25 06:53:04 +00:00
Dan Gohman
97481fb5e0
Canonicalize ConstantInts to the right operand of commutative
...
operators.
The test difference is just due to the multiplication operands
being commuted (and thus requiring a more elaborate match). In
optimized code, that expression would be folded.
llvm-svn: 96816
2010-02-22 22:43:23 +00:00
Dan Gohman
0a0f1d2ee2
Use Instruction::isCommutative instead of duplicating it.
...
llvm-svn: 96807
2010-02-22 22:05:18 +00:00
Talin
cd8428c41f
replaceUsesOfWithOnConstant implementation for unions.
...
llvm-svn: 96616
2010-02-18 21:43:45 +00:00
Devang Patel
5c67cb332e
Destroy MDNodes gracefully while deleting llvm context.
...
llvm-svn: 96609
2010-02-18 20:53:16 +00:00
Kenneth Uildriks
13195c9525
Function attributes have index ~0, not 0
...
llvm-svn: 96370
2010-02-16 19:28:02 +00:00
Duncan Sands
e9a13a3c60
Introduce isOpaqueTy and use it rather than isa<OpaqueType>. Also, move some
...
methods to try to have the type predicates be more logically positioned.
llvm-svn: 96349
2010-02-16 14:50:09 +00:00