[llvm] r249569 - [WinEH] Update CoreCLR EH for catchpad MBBs
Joseph Tremoulet via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 7 10:16:26 PDT 2015
Author: josepht
Date: Wed Oct 7 12:16:25 2015
New Revision: 249569
URL: http://llvm.org/viewvc/llvm-project?rev=249569&view=rev
Log:
[WinEH] Update CoreCLR EH for catchpad MBBs
Summary:
Set the pad MBB as a funclet entry for CoreCLR as well as MSVCCXX, and
update state numbering to put the catchpad block rather than its normal
successor into the unwind map.
Reviewers: majnemer
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D13492
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/trunk/lib/CodeGen/WinEHPrepare.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=249569&r1=249568&r2=249569&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Wed Oct 7 12:16:25 2015
@@ -1163,9 +1163,10 @@ void SelectionDAGBuilder::visitCatchPad(
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++, catchblocks are funclets and need prologues.
- if (IsMSVCCXX)
+ // In MSVC C++ and CoreCLR, catchblocks are funclets and need prologues.
+ if (IsMSVCCXX || IsCoreCLR)
CatchPadMBB->setIsEHFuncletEntry();
MachineBasicBlock *NormalDestMBB = FuncInfo.MBBMap[I.getNormalDest()];
Modified: llvm/trunk/lib/CodeGen/WinEHPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/WinEHPrepare.cpp?rev=249569&r1=249568&r2=249569&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/WinEHPrepare.cpp (original)
+++ llvm/trunk/lib/CodeGen/WinEHPrepare.cpp Wed Oct 7 12:16:25 2015
@@ -2928,11 +2928,11 @@ void llvm::calculateClrEHStateNumbers(co
// Preds of the endpad should get the parent state.
PredState = ParentState;
} else if (const CatchPadInst *Catch = dyn_cast<CatchPadInst>(Pad)) {
- const BasicBlock *Handler = Catch->getNormalDest();
+ const BasicBlock *PadBlock = Catch->getParent();
uint32_t TypeToken = static_cast<uint32_t>(
cast<ConstantInt>(Catch->getArgOperand(0))->getZExtValue());
int NewState = addClrEHHandler(FuncInfo, ParentState,
- ClrHandlerType::Catch, TypeToken, Handler);
+ ClrHandlerType::Catch, TypeToken, PadBlock);
FuncInfo.EHPadStateMap[Catch] = NewState;
// Preds of the catch get its state
PredState = NewState;
More information about the llvm-commits
mailing list