1
0
mirror of https://github.com/c64scene-ar/llvm-6502.git synced 2025-01-03 13:31:05 +00:00
llvm-6502/tools
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
..
bugpoint
edis
gold
llc add .o file writing for inline asm in llc. Here's a silly 2010-04-05 23:11:24 +00:00
lli
llvm-ar
llvm-as
llvm-bcanalyzer
llvm-config
llvm-dis
llvm-extract
llvm-ld
llvm-link
llvm-mc tidy #includes. 2010-04-05 23:07:18 +00:00
llvm-nm
llvm-prof
llvm-ranlib
llvm-shlib
llvm-stub
llvmc
lto
opt
CMakeLists.txt
Makefile