1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 20:43:44 +02:00
llvm-mirror/lib
Chris Lattner 5b4c7591ac 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!

llvm-svn: 100491
2010-04-05 23:11:24 +00:00
..
Analysis Ok, third time's the charm. No changes from last time except the CMake 2010-04-02 23:17:14 +00:00
Archive Fix a grammaro. 2010-03-30 20:04:57 +00:00
AsmParser stringref-ize the MemoryBuffer::get apis. This requires 2010-04-05 22:42:30 +00:00
Bitcode Add special case bitcode support for DebugLoc. This avoids 2010-04-03 02:17:50 +00:00
CodeGen add .o file writing for inline asm in llc. Here's a silly 2010-04-05 23:11:24 +00:00
CompilerDriver Use FindExecutable as a fall-back search method. 2010-03-05 04:46:28 +00:00
ExecutionEngine Fix OProfileJITEventListener build for new DebugLoc. 2010-04-05 21:09:12 +00:00
Linker
MC eliminate the magic AbsoluteDebugSectionOffsets MAI hook, 2010-04-04 23:22:29 +00:00
Support stringref-ize the MemoryBuffer::get apis. This requires 2010-04-05 22:42:30 +00:00
System AddSignalHandler was not releasing the critical section on win32. 2010-03-31 12:07:16 +00:00
Target Fix ADD32rr_alt instruction encoding bug. Patch by Marius Wachtler. 2010-04-05 22:21:09 +00:00
Transforms fix a really nasty bug that Evan was tracking in SCCP. When resolving 2010-04-05 22:14:48 +00:00
VMCore Reapply address space patch after fixing an issue in MemCopyOptimizer. 2010-04-04 03:10:48 +00:00
Makefile