[WinEH] Create a separate MBB for funclet prologues
authorDavid Majnemer <david.majnemer@gmail.com>
Tue, 6 Oct 2015 23:31:59 +0000 (23:31 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Tue, 6 Oct 2015 23:31:59 +0000 (23:31 +0000)
commit4d2c1b67133b43093a822290ca43b9ceb488c1e7
tree8b1adef21bf3104262f9f80e956eedac420ea50e
parent4d651e440b0e808254a9558f1328e812703842ca
[WinEH] Create a separate MBB for funclet prologues

Our current emission strategy is to emit the funclet prologue in the
CatchPad's normal destination.  This is problematic because
intra-funclet control flow to the normal destination is not erroneous
and results in us reevaluating the prologue if said control flow is
taken.

Instead, use the CatchPad's location for the funclet prologue.  This
correctly models our desire to have unwind edges evaluate the prologue
but edges to the normal destination result in typical control flow.

Differential Revision: http://reviews.llvm.org/D13424

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249483 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/CodeGen/WinEHPrepare.cpp
test/CodeGen/X86/funclet-layout.ll
test/CodeGen/X86/seh-catchpad.ll
test/CodeGen/X86/win-catchpad-csrs.ll
test/CodeGen/X86/win-catchpad.ll
test/CodeGen/X86/win-funclet-cfi.ll
test/CodeGen/X86/win32-seh-catchpad.ll