Consider this function:
authorBill Wendling <isanbard@gmail.com>
Fri, 16 Jul 2010 22:51:10 +0000 (22:51 +0000)
committerBill Wendling <isanbard@gmail.com>
Fri, 16 Jul 2010 22:51:10 +0000 (22:51 +0000)
commitdc86704114a065da0ff1d835edcd62aae51481dd
tree79aea34e161f14b04e390a3319385fb5a1b032dc
parent78e6e009223a38739797629ca2d217acf86dda93
Consider this function:

  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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108568 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
test/CodeGen/PowerPC/2008-01-25-EmptyFunction.ll [deleted file]
test/CodeGen/PowerPC/empty-functions.ll [new file with mode: 0644]
test/CodeGen/X86/2008-01-25-EmptyFunction.ll [deleted file]
test/CodeGen/X86/empty-functions.ll [new file with mode: 0644]