summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-10-06 23:31:59 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-10-06 23:31:59 +0000
commit7735a6d07ac83620379273aa19566de172cf06c3 (patch)
treecf1df5815568680069913c9083aeb2e1d34c2620 /llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
parent083ca9bb3233fb4df575bfb8c4198e3f9d6e3acd (diff)
downloadbcm5719-llvm-7735a6d07ac83620379273aa19566de172cf06c3.tar.gz
bcm5719-llvm-7735a6d07ac83620379273aa19566de172cf06c3.zip
[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 llvm-svn: 249483
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
index d718ede35cd..a7f5ba1269e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
@@ -216,14 +216,17 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf,
// are really data, and no instructions can live here.
if (BB->isEHPad()) {
const Instruction *I = BB->getFirstNonPHI();
+ // FIXME: Don't mark SEH functions without __finally blocks as having
+ // funclets.
if (!isa<LandingPadInst>(I))
MMI.setHasEHFunclets(true);
- if (isa<CatchPadInst>(I) || isa<CatchEndPadInst>(I) ||
- isa<CleanupEndPadInst>(I)) {
+ if (isa<CatchEndPadInst>(I) || isa<CleanupEndPadInst>(I)) {
assert(&*BB->begin() == I &&
"WinEHPrepare failed to remove PHIs from imaginary BBs");
continue;
}
+ if (isa<CatchPadInst>(I) || isa<CleanupPadInst>(I))
+ assert(&*BB->begin() == I && "WinEHPrepare failed to demote PHIs");
}
MachineBasicBlock *MBB = mf.CreateMachineBasicBlock(BB);
OpenPOWER on IntegriCloud