summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-11-09 23:07:48 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-11-09 23:07:48 +0000
commit2652b7570096b694b012de014aa08a88a816f29b (patch)
treebadab991ee83b190110479eafa802cd298871f1f /llvm/lib/CodeGen
parent7ccc6136b9087e4c71c83d8c3f535fc7eb9b5078 (diff)
downloadbcm5719-llvm-2652b7570096b694b012de014aa08a88a816f29b.tar.gz
bcm5719-llvm-2652b7570096b694b012de014aa08a88a816f29b.zip
[WinEH] Don't emit CATCHRET from visitCatchPad
Instead, emit a CATCHPAD node which will get selected to a target specific sequence. llvm-svn: 252528
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 60b06b4ab0e..5090bfbfb14 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -1178,7 +1178,6 @@ SDValue SelectionDAGBuilder::getValueImpl(const Value *V) {
void SelectionDAGBuilder::visitCatchPad(const CatchPadInst &I) {
auto Pers = classifyEHPersonality(FuncInfo.Fn->getPersonalityFn());
bool IsMSVCCXX = Pers == EHPersonality::MSVC_CXX;
- bool IsSEH = isAsynchronousEHPersonality(Pers);
bool IsCoreCLR = Pers == EHPersonality::CoreCLR;
MachineBasicBlock *CatchPadMBB = FuncInfo.MBB;
// In MSVC C++ and CoreCLR, catchblocks are funclets and need prologues.
@@ -1190,22 +1189,16 @@ void SelectionDAGBuilder::visitCatchPad(const CatchPadInst &I) {
// Update machine-CFG edge.
FuncInfo.MBB->addSuccessor(NormalDestMBB);
- // CatchPads in SEH are not funclets, they are merely markers which indicate
- // where to insert register restoration code.
- if (IsSEH) {
- DAG.setRoot(DAG.getNode(ISD::CATCHRET, getCurSDLoc(), MVT::Other,
- getControlRoot(), DAG.getBasicBlock(NormalDestMBB),
- DAG.getBasicBlock(&FuncInfo.MF->front())));
- return;
- }
+ SDValue Chain =
+ DAG.getNode(ISD::CATCHPAD, getCurSDLoc(), MVT::Other, getControlRoot());
// If this is not a fall-through branch or optimizations are switched off,
// emit the branch.
if (NormalDestMBB != NextBlock(CatchPadMBB) ||
TM.getOptLevel() == CodeGenOpt::None)
- DAG.setRoot(DAG.getNode(ISD::BR, getCurSDLoc(), MVT::Other,
- getControlRoot(),
- DAG.getBasicBlock(NormalDestMBB)));
+ Chain = DAG.getNode(ISD::BR, getCurSDLoc(), MVT::Other, Chain,
+ DAG.getBasicBlock(NormalDestMBB));
+ DAG.setRoot(Chain);
}
void SelectionDAGBuilder::visitCatchRet(const CatchReturnInst &I) {
OpenPOWER on IntegriCloud