summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/empty-functions.ll
Commit message (Collapse)AuthorAgeFilesLines
* Don't emit CFI instructions at the end of a functionAdrian Prantl2017-04-241-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | When functions are terminated by unreachable instructions, the last instruction might trigger a CFI instruction to be generated. However, emitting it would be be illegal since the function (and thus the FDE the CFI is in) has already ended with the previous instruction. Darwin's dwarfdump --verify --eh-frame complains about this and the specification supports this. Relevant bits from the DWARF 5 standard (6.4 Call Frame Information): "[The] address_range [field in an FDE]: The number of bytes of program instructions described by this entry." "Row creation instructions: [...] The new location value is always greater than the current one." The first quotation implies that a CFI cannot describe a target address outside of the enclosing FDE's range. rdar://problem/26244988 Differential Revision: https://reviews.llvm.org/D32246 llvm-svn: 301219
* Use the vanilla func_end symbol for .size.Rafael Espindola2015-03-041-1/+1
| | | | | | No need to create yet another temp symbol. llvm-svn: 231198
* Fix a lot of confusion around inserting nops on empty functions.Rafael Espindola2014-09-151-1/+30
| | | | | | | | | | | | | | | | On MachO, and MachO only, we cannot have a truly empty function since that breaks the linker logic for atomizing the section. When we are emitting a frame pointer, the presence of an unreachable will create a cfi instruction pointing past the last instruction. This is perfectly fine. The FDE information encodes the pc range it applies to. If some tool cannot handle this, we should explicitly say which bug we are working around and only work around it when it is actually relevant (not for ELF for example). Given the unreachable we could omit the .cfi_def_cfa_register, but then again, we could also omit the entire function prologue if we wanted to. llvm-svn: 217801
* Don't print an unused label before .cfi_endproc.Rafael Espindola2012-01-091-2/+0
| | | | llvm-svn: 147763
* Don't print a label before .cfi_startproc when we don't need to. This makesRafael Espindola2012-01-071-2/+0
| | | | | | the produce assembly when using CFI just a bit more readable. llvm-svn: 147743
* Use the dwarf->llvm mapping to print register names in the cfiRafael Espindola2011-05-301-2/+2
| | | | | | | | directives. Fixes PR9826. llvm-svn: 132317
* Don't produce a __debug_frame.Rafael Espindola2011-05-051-4/+18
| | | | | | | I tested both gdb on a bootstrapped clang and and the gdb testsuite on OS X (snow leopard) and both are happy using __eh_frame. llvm-svn: 130937
* Consider this function:Bill Wendling2010-07-161-0/+15
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
OpenPOWER on IntegriCloud