From db96ae9607ddca2e0627c8b87a160d61689663ca Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Sun, 9 Mar 2008 07:36:38 +0000 Subject: A BB that unwind_to an "unwind" inst is that same as one that doesn't unwind_to at all. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48096 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/SimplifyCFG.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/Transforms/Utils/SimplifyCFG.cpp') 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(Pred->getTerminator())) + } else if (InvokeInst *II = dyn_cast(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(); } -- cgit v1.2.3-18-g5258