summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/2008-01-25-EmptyFunction.ll
Commit message (Collapse)AuthorAgeFilesLines
* Consider this function:Bill Wendling2010-07-161-8/+0
| | | | | | | | | | | | | | | | | | | | | | void foo() { __builtin_unreachable(); } It will output the following on Darwin X86: _func1: Leh_func_begin0: pushq %rbp Ltmp0: movq %rsp, %rbp Ltmp1: Leh_func_end0: This prolog adds a new Call Frame Information (CFI) row to the FDE with an address that is not within the address range of the code it describes -- part is equal to the end of the function -- and therefore results in an invalid EH frame. If we emit a nop in this situation, then the CFI row is now within the address range. llvm-svn: 108568
* Revert. This isn't the correct way to go.Bill Wendling2010-07-151-11/+2
| | | | llvm-svn: 108478
* Handle code gen for the unreachable instruction if it's the only instruction inBill Wendling2010-07-151-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the function. We'll just turn it into a "trap" instruction instead. The problem with not handling this is that it might generate a prologue without the equivalent epilogue to go with it: $ cat t.ll define void @foo() { entry: unreachable } $ llc -o - t.ll -relocation-model=pic -disable-fp-elim -unwind-tables .section __TEXT,__text,regular,pure_instructions .globl _foo .align 4, 0x90 _foo: ## @foo Leh_func_begin0: ## BB#0: ## %entry pushq %rbp Ltmp0: movq %rsp, %rbp Ltmp1: Leh_func_end0: ... The unwind tables then have bad data in them causing all sorts of problems. Fixes <rdar://problem/8096481>. llvm-svn: 108473
* on darwin empty functions need to codegen into something of non-zero length,Chris Lattner2010-04-261-1/+1
| | | | | | | | | | | otherwise labels get incorrectly merged. We handled this by emitting a ".byte 0", but this isn't correct on thumb/arm targets where the text segment needs to be a multiple of 2/4 bytes. Handle this by emitting a noop. This is more gross than it should be because arm/ppc are not fully mc'ized yet. This fixes rdar://7908505 llvm-svn: 102400
* emit a 0 byte instead of a noop if a function is empty on darwin.Chris Lattner2010-01-281-1/+1
| | | | | | "0" is nice and target independent. llvm-svn: 94718
* Eliminate more uses of llvm-as and llvm-dis.Dan Gohman2009-09-081-1/+1
| | | | llvm-svn: 81290
* Add target triples to these so they don't fail on linux.Chris Lattner2008-01-291-0/+2
| | | | llvm-svn: 46496
* If there's no instructions being emitted on X86 for a function, emit aBill Wendling2008-01-261-0/+6
nop. Emit the nop directly for PPC. llvm-svn: 46398
OpenPOWER on IntegriCloud