summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/WinEHPrepare.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/WinEHPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/WinEHPrepare.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/WinEHPrepare.cpp b/llvm/lib/CodeGen/WinEHPrepare.cpp
index 68384f08b7c..3cc9c395c22 100644
--- a/llvm/lib/CodeGen/WinEHPrepare.cpp
+++ b/llvm/lib/CodeGen/WinEHPrepare.cpp
@@ -2956,8 +2956,7 @@ static const BasicBlock *getEHPadFromPredecessor(const BasicBlock *BB) {
if (isa<CatchPadInst>(TI) || isa<CatchEndPadInst>(TI) ||
isa<TerminatePadInst>(TI))
return BB;
- return cast<CleanupPadInst>(cast<CleanupReturnInst>(TI)->getReturnValue())
- ->getParent();
+ return cast<CleanupReturnInst>(TI)->getCleanupPad()->getParent();
}
static void calculateExplicitStateNumbers(WinEHFuncInfo &FuncInfo,
@@ -3242,11 +3241,11 @@ bool WinEHPrepare::prepareExplicitEH(Function &F) {
// The token consumed by a CatchReturnInst must match the funclet token.
bool IsUnreachableCatchret = false;
if (auto *CRI = dyn_cast<CatchReturnInst>(TI))
- IsUnreachableCatchret = CRI->getReturnValue() != CatchPad;
+ IsUnreachableCatchret = CRI->getCatchPad() != CatchPad;
// The token consumed by a CleanupPadInst must match the funclet token.
bool IsUnreachableCleanupret = false;
if (auto *CRI = dyn_cast<CleanupReturnInst>(TI))
- IsUnreachableCleanupret = CRI->getReturnValue() != CleanupPad;
+ IsUnreachableCleanupret = CRI->getCleanupPad() != CleanupPad;
if (IsUnreachableRet || IsUnreachableCatchret || IsUnreachableCleanupret) {
new UnreachableInst(BB->getContext(), TI);
TI->eraseFromParent();
OpenPOWER on IntegriCloud