summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Nuke trailing whitespace.Jim Grosbach2010-10-011-28/+28
| | | | llvm-svn: 115377
* Target: Give the TargetAsmParser access to the TargetMachine.Daniel Dunbar2010-07-191-1/+1
| | | | | | - Unfortunate, but necessary for now to handle subtarget instruction matching. Eventually we should factor out the lower level target machine information so we don't need to do this. llvm-svn: 108664
* MC: Move several clients to using AsmParser constructor function.Daniel Dunbar2010-07-181-6/+7
| | | | llvm-svn: 108645
* a more graceful fix for test/Other/inline-asm-newline-terminator.ll,Chris Lattner2010-07-151-14/+0
| | | | | | follow on to r103765 llvm-svn: 108390
* Propagate the AlignStack bit in InlineAsm's to the Dale Johannesen2010-07-021-1/+1
| | | | | | | | | | | | | | | | | | | PrologEpilog code, and use it to determine whether the asm forces stack alignment or not. gcc consistently does not do this for GCC-style asms; Apple gcc inconsistently sometimes does it for asm blocks. There is no convenient place to put a bit in either the SDNode or the MachineInstr form, so I've added an extra operand to each; unlovely, but it does allow for expansion for more bits, should we need it. PR 5125. Some existing testcases are affected. The operand lists of the SDNode and MachineInstr forms are indexed with awesome mnemonics, like "2"; I may fix this someday, but not now. I'm not making it any worse. If anyone is inspired I think you can find all the right places from this patch. llvm-svn: 107506
* MC: Pass the target instance to the AsmParser constructor.Daniel Dunbar2010-07-011-1/+1
| | | | llvm-svn: 107426
* Inline Asm: Ensure buffer is newline terminated to match how the text is ↵Daniel Dunbar2010-05-141-0/+14
| | | | | | | | printed. - This is a hack, but I can't decide the best place to handle this. Chris? llvm-svn: 103765
* 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