diff options
Diffstat (limited to 'lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r-- | lib/Transforms/Utils/SimplifyCFG.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp index 61da0d998f..846c3bf9d9 100644 --- a/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/lib/Transforms/Utils/SimplifyCFG.cpp @@ -1370,7 +1370,7 @@ bool llvm::SimplifyCFG(BasicBlock *BB) { new UnwindInst(Pred); // Use unwind. Changed = true; } - } else if (InvokeInst *II = dyn_cast<InvokeInst>(Pred->getTerminator())) + } else if (InvokeInst *II = dyn_cast<InvokeInst>(Pred->getTerminator())) { if (II->getUnwindDest() == BB) { // Insert a new branch instruction before the invoke, because this // is now a fall through... @@ -1388,6 +1388,9 @@ bool llvm::SimplifyCFG(BasicBlock *BB) { delete II; Changed = true; } + } else if (Pred->getUnwindDest() == BB) { + Pred->setUnwindDest(NULL); + } Preds.pop_back(); } |