summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
Commit message (Collapse)AuthorAgeFilesLines
* implicit defs get added to the end of machine instrs sometimes. Scan the ↵Chris Lattner2010-04-081-4/+9
| | | | | | whole instruction for the metadata operand instead of assuming it will be at the end of the instruction. llvm-svn: 100792
* Use twines to simplify calls to report_fatal_error. For code size and ↵Benjamin Kramer2010-04-081-12/+12
| | | | | | readability. llvm-svn: 100756
* introduce a new recoverable error handling API to LLVMContextChris Lattner2010-04-071-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | and use it in one place in inline asm handling stuff. Before we'd generate this for an invalid modifier letter: $ clang asm.c -c -o t.o fatal error: error in backend: Invalid operand found in inline asm: 'abc incl ${0:Z}' INLINEASM <es:abc incl ${0:Z}>, 10, %EAX<def>, 2147483657, %EAX, 14, %EFLAGS<earlyclobber,def,dead>, <!-1> Now we generate this: $ clang asm.c -c -o t.o error: invalid operand in inline asm: 'incl ${0:Z}' asm.c:3:12: note: generated from here __asm__ ("incl %Z0" : "+r" (X)); ^ 1 error generated. This is much better but still admittedly not great ("why" is the operand invalid??), codegen should try harder with its diagnostics :) llvm-svn: 100723
* rename llvm::llvm_report_error -> llvm::report_fatal_errorChris Lattner2010-04-071-10/+10
| | | | llvm-svn: 100709
* Have the inst emitter add the !srcloc mdnode to the machine instr.Chris Lattner2010-04-071-2/+12
| | | | | | | Have the asmprinter use the mdnode to scavenge a source location if present. Document this nonsense in langref. llvm-svn: 100607
* remove another magic number.Chris Lattner2010-04-071-3/+2
| | | | llvm-svn: 100606
* propagate cookie management out one layer of function calls.Chris Lattner2010-04-061-4/+3
| | | | llvm-svn: 100510
* report errors through LLVMContext's inline asm handler if available.Chris Lattner2010-04-061-1/+15
| | | | llvm-svn: 100509
* Give AsmParser an option to control whether it finalizesChris Lattner2010-04-051-1/+2
| | | | | | | | | | | | | | | | | | | | the stream. New demo: $ 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 000000000000000b movl %eax,(%rsp) 000000000000000e movl %eax,0x04(%rsp) 0000000000000012 addq $0x08,%rsp 0000000000000016 ret llvm-svn: 100492
* add .o file writing for inline asm in llc. Here's a sillyChris Lattner2010-04-051-3/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* stringref-ize the MemoryBuffer::get apis. This requiresChris Lattner2010-04-051-9/+7
| | | | | | a co-committed clang patch. llvm-svn: 100485
* move uleb/sleb printing into AsmPrinter from DwarfPrinter.Chris Lattner2010-04-041-3/+3
| | | | llvm-svn: 100344
* use stringref instead of strtol to avoid errno gymnastics.Chris Lattner2010-04-041-7/+6
| | | | llvm-svn: 100341
* split inline asm support out to its own .cpp file.Chris Lattner2010-04-041-0/+315
llvm-svn: 100340
OpenPOWER on IntegriCloud