diff --git a/llvm/lib/CodeGen/SjLjEHPrepare.cpp b/llvm/lib/CodeGen/SjLjEHPrepare.cpp index e18cbeaeb36d..ed0202551274 100644 --- a/llvm/lib/CodeGen/SjLjEHPrepare.cpp +++ b/llvm/lib/CodeGen/SjLjEHPrepare.cpp @@ -145,14 +145,10 @@ void SjLjEHPass::markInvokeCallSite(InvokeInst *II, int InvokeNo, if (isa(II->getUnwindDest()->begin())) { // FIXME: New EH - This if-condition will be always true in the new scheme. if (II->getUnwindDest()->isLandingPad()) { - if (isCriticalEdge(II, 1)) { - SmallVector NewBBs; - SplitLandingPadPredecessors(II->getUnwindDest(), II->getParent(), - ".1", ".2", this, NewBBs); - LPadSuccMap[II] = *succ_begin(NewBBs[0]); - } else { - LPadSuccMap[II] = II->getUnwindDest(); - } + SmallVector NewBBs; + SplitLandingPadPredecessors(II->getUnwindDest(), II->getParent(), + ".1", ".2", this, NewBBs); + LPadSuccMap[II] = *succ_begin(NewBBs[0]); } else { SplitCriticalEdge(II, 1, this); } @@ -206,14 +202,10 @@ splitLiveRangesAcrossInvokes(SmallVector &Invokes) { // FIXME: New EH - This if-condition will be always true in the new scheme. if (II->getUnwindDest()->isLandingPad()) { - if (isCriticalEdge(II, 1)) { - SmallVector NewBBs; - SplitLandingPadPredecessors(II->getUnwindDest(), II->getParent(), - ".1", ".2", this, NewBBs); - LPadSuccMap[II] = *succ_begin(NewBBs[0]); - } else { - LPadSuccMap[II] = II->getUnwindDest(); - } + SmallVector NewBBs; + SplitLandingPadPredecessors(II->getUnwindDest(), II->getParent(), + ".1", ".2", this, NewBBs); + LPadSuccMap[II] = *succ_begin(NewBBs[0]); } else { SplitCriticalEdge(II, 1, this); }