[WinEH] Emit the LSDA even if no lpads remain but outlining occurred
authorReid Kleckner <reid@kleckner.net>
Mon, 13 Jul 2015 20:41:46 +0000 (20:41 +0000)
committerReid Kleckner <reid@kleckner.net>
Mon, 13 Jul 2015 20:41:46 +0000 (20:41 +0000)
commitda9c587dad055ebaa2781b1292d3317d1bfcac9e
tree8c64b97b8d69deda2cc5b7e82ab318ba4c5b95cc
parent360ec4c35f279757c079ff295bcc7b8928c18503
[WinEH] Emit the LSDA even if no lpads remain but outlining occurred

The outlined funclets call intrinsics which reference labels from the
LSDA. This situation can easily arise in small functions with a single
cleanup at -O0, where Clang marks a definition as nounwind, and then
WinEHPrepare "discovers" that the landingpad is dead by accident and
deletes it.

We now need to ask the LLVM IR Function for it's personality directly,
rather than going through MachineModuleInfo.

Fixes PR23892.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242063 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/WinException.cpp
test/CodeGen/X86/cppeh-nounwind.ll [new file with mode: 0644]