Commit Graph

3057 Commits

Author SHA1 Message Date
Chris Lattner
af632c91a0 add .o file writing for inline asm in llc. Here's a silly
demo:

$ clang asm.c -S -o - -emit-llvm | llc -filetype=obj -o t.o
<inline asm>:1:2: error: unrecognized instruction
	abc incl    %eax
	^
LLVM ERROR: Error parsing inline asm

Only problem seems to be that the parser finalizes OutStreamer 
at the end of the first inline asm, which isn't what we want.
For example:

$ cat asm.c
int foo(int X) {
 __asm__ ("incl    %0" : "+r" (X));
 return X;
}
$ clang asm.c -S -o - -emit-llvm | llc
...
	subq	$8, %rsp
	movl	%edi, (%rsp)
	movl	%edi, %eax
	## InlineAsm Start
	incl    %eax
	## InlineAsm End
	movl	%eax, (%rsp)
	movl	%eax, 4(%rsp)
	addq	$8, %rsp
	ret
$ clang asm.c -S -o - -emit-llvm | llc -filetype=obj -o t.o
$ otool -tv t.o
t.o:
(__TEXT,__text) section
_foo:
0000000000000000	subq	$0x08,%rsp
0000000000000004	movl	%edi,(%rsp)
0000000000000007	movl	%edi,%eax
0000000000000009	incl	%eax
$ 

don't stop at inc!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100491 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 23:11:24 +00:00
Chris Lattner
519466c32f tidy #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100489 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 23:07:18 +00:00
Chris Lattner
4c842dda39 stringref-ize the MemoryBuffer::get apis. This requires
a co-committed clang patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100485 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 22:42:30 +00:00
Chris Lattner
d374087be5 fix an ugly wart in the MCInstPrinter api where the
raw_ostream to print an instruction to had to be specified
at MCInstPrinter construction time instead of being able
to pick at each call to printInstruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100307 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 05:04:31 +00:00
Chris Lattner
4d12fdc2d9 remove some extraneous casts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100287 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 21:03:50 +00:00
Chris Lattner
a6245247e9 Add special case bitcode support for DebugLoc. This avoids
having the bitcode writer materialize mdnodes for all the
debug location tuples when writing out the bc file and 
stores the information in a more compact form.  For example,
the -O0 -g bc file for combine.c in 176.gcc shrinks from
739392 to 512096 bytes.

This concludes my planned short-term debug info work.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100261 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 02:17:50 +00:00
Mikhail Glushenkov
cbf1aa9e31 Pass -shared to the linker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100260 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 02:00:03 +00:00
Chris Lattner
d3a5fa8e96 add a couple missing enum names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100257 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 01:05:24 +00:00
Sean Callanan
eb3a1ab796 Updated the install location for EnhancedDisassembly
on Mac OS X to use @rpath rather than an absolute
path.  Also allowed the version to be set using an
environment variable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100163 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 00:53:42 +00:00
Mikhail Glushenkov
62d1da0bb9 Pass -m32/-m64 to assembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100064 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 23:51:55 +00:00
Dan Gohman
132a9946bf Fix llvm-ld to clean up its output files in case of an error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99915 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 19:56:41 +00:00
Chris Lattner
46475cb08e revert r99719 which is breaking the botz.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99721 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 18:01:10 +00:00
Dan Gohman
00ad278500 Make llvm-ld remove its output files in the event of an error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99719 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 16:49:51 +00:00
Dan Gohman
92f5fccb4d No need to check the same condition twice.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99716 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 16:36:08 +00:00
Daniel Dunbar
ac2884a717 llvm-mc: Add a -mc-relax-all option, which relaxes every fixup. We always need
exactly two passes in that case, and don't ever need to recompute any layout,
so this is a nice baseline for relaxation performance.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99563 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 22:49:09 +00:00
Dan Gohman
51ecc389a9 Trim #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99416 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 19:56:17 +00:00
Dan Gohman
34b96f4fb3 It's not necessary to call raw_ostream::close explicitly on automatic
raw_ostream variables immediately before they go out of scope.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99413 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 19:00:02 +00:00
Daniel Dunbar
2d9f5d1d7f llvm-mc: Support -filetype=null, for timing purposes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99349 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 23:47:12 +00:00
Bill Wendling
fa256c6eee Remove if DISABLED not if not DISABLED...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99343 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 23:09:03 +00:00
Bill Wendling
602d005083 Use "DISABLE_EDIS" to disable building "edis" explicitly. Don't build it for
Apple-style builds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99336 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 22:15:33 +00:00
Chris Lattner
25c54c09ef make sure to delete the llvm module before calling llvm_shutdown,
this fixes crashes in error cases, PR6683


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99334 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 21:59:43 +00:00
Dan Gohman
50fc9f319e llc doesn't need LinkAllVMCore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99186 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 16:59:44 +00:00
Jeffrey Yasskin
bd85e8e3ad Avoid leaking the FunctionPassManager from opt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99180 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 15:56:04 +00:00
Jeffrey Yasskin
c1dc067970 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().



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99160 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 05:23:37 +00:00
Daniel Dunbar
c6ab1901f9 llvm-mc: Fix MCInstPrinter memory leaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99101 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 22:36:35 +00:00
Daniel Dunbar
d40297ce49 llvm-mc: Fix memory leak of MCAsmInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99098 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 22:36:25 +00:00
Daniel Dunbar
4d4358e8b0 llvm-mc: Fix target selection for --disassemble to use GetTarget.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98973 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 18:07:50 +00:00
Chris Lattner
4c42a6de9f fix an MCInstPrinter leak that jyasskin pointed out:
createAsmStreamer now takes ownership of the instprinter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98939 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 05:48:53 +00:00
Jeffrey Yasskin
c3e6859d8d Bugpoint's default memory limit (100MB) was too low for valgrind, so
this patch raises the default to 800MB when valgrind's active.  800
was chosen semi-arbitrarily.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98905 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 00:09:28 +00:00
Sean Callanan
e340da73ed Changed install_name for libEnhancedDisassembly.dylib on
Mac OS X to match current install location.  This has no
effect on other platforms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98773 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 22:01:36 +00:00
Chris Lattner
50010429a7 add support for bugpointing the integrated assembler. Something like this
works for me: bugpoint Output/bisort.llvm.bc -run-llc-ia -safe-run-llc

This uses llc with the integrated assembler as the test compiler and llc
without it as the safe compiler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98618 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 06:41:47 +00:00
Daniel Dunbar
4ca906560a llvm-mc: Delete output files on error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98445 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 19:31:47 +00:00
Daniel Dunbar
5e6a7a248b llvm-mc: Support -n, useful for comparing -integrated-as output since the
compiler may not lead with the text section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98418 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 02:20:57 +00:00
Daniel Dunbar
181ab6a854 llvm-mc: Support -arch as a simplified form of -triple.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98417 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 02:20:38 +00:00
Chris Lattner
b87c305fa7 give Mangler access to TargetData.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98378 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 20:47:28 +00:00
Chris Lattner
5ef31a039d make the mangler take an MCContext instead of an MAI.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98363 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 18:44:54 +00:00
Chris Lattner
fdab14b105 remove MAI argument from createAsmStreamer since it
can get it from the context now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98361 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 18:28:53 +00:00
Chris Lattner
c18409aed8 change MCContext to always have an MCAsmInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98293 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 22:53:35 +00:00
Daniel Dunbar
1f3e445184 MC: Provide MCAssembler with a TargetAsmBackend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98222 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 01:34:27 +00:00
Duncan Sands
7ebc3777de Attempt to fix random build failures seen when doing highly
parallel builds: the gold plugin fails to link because the lto
library is in the middle of being written out by the linker.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98054 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 09:03:21 +00:00
Mikhail Glushenkov
b5c4239606 Make it not an error to specify -O* options several times.
As in 'llvmc -O2 -O2 test.c'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97787 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 04:46:39 +00:00
Chris Lattner
e5605778f5 apparently if gold is around lto needs to be part of DIRS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97780 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 02:34:34 +00:00
Chris Lattner
23e6d2b88a Only build libedis if ENABLE_SHARED is specified, just like liblto.
Don't build any of the dynamic library stuff on cygwin/mingw.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97771 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 00:59:18 +00:00
Chris Lattner
f6dc18f9eb liblto and gold don't need to be built in serial
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97770 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 00:54:45 +00:00
Erick Tryzelaar
d4076cfc83 Rewrite makefiles to explicitly reference DESTDIR to fix bug 3153.
We need this so can not bake DESTDIR into the O'Caml symlinks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97743 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 20:56:19 +00:00
Dan Gohman
d44f16fce7 Make llc opt into the addPassesToEmitFile verify pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97502 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 21:45:21 +00:00
Chris Lattner
68e326689d don't build edis if the x86 target isn't enabld.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97268 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 21:26:33 +00:00
Sanjiv Gupta
ad597f99d9 disable-mem2reg and disable-gvn options should not be used by the driver.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97236 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 18:38:44 +00:00
Jeffrey Yasskin
c90171961d Try r96559 for the third time. This time the shared library is only built if
--enable-shared is passed to configure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97119 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 06:34:33 +00:00
Jeffrey Yasskin
407fbdd161 Roll back r96959 again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96981 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 20:53:37 +00:00