summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/SimplifyCFGPass.cpp
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2012-07-16 22:49:40 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2012-07-16 22:49:40 +0000
commitd49981a9bbeb49626389119ebec3b0626337b233 (patch)
tree913385fb6f617d793a233261b1467edccc98d9b8 /lib/Transforms/Scalar/SimplifyCFGPass.cpp
parent7e733eab2f11fceb24d6b4f25c27d7ba7d92d97e (diff)
downloadllvm-d49981a9bbeb49626389119ebec3b0626337b233.tar.gz
llvm-d49981a9bbeb49626389119ebec3b0626337b233.tar.bz2
llvm-d49981a9bbeb49626389119ebec3b0626337b233.tar.xz
fix PR13339 (remove the predecessor from the unwind BB when removing an invoke)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160325 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/SimplifyCFGPass.cpp')
-rw-r--r--lib/Transforms/Scalar/SimplifyCFGPass.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/lib/Transforms/Scalar/SimplifyCFGPass.cpp
index 91158b429e..99e236f543 100644
--- a/lib/Transforms/Scalar/SimplifyCFGPass.cpp
+++ b/lib/Transforms/Scalar/SimplifyCFGPass.cpp
@@ -165,6 +165,7 @@ static bool MarkAliveBlocks(BasicBlock *BB,
if (II->use_empty() && II->onlyReadsMemory()) {
// jump to the normal destination branch.
BranchInst::Create(II->getNormalDest(), II);
+ II->getUnwindDest()->removePredecessor(II->getParent());
II->eraseFromParent();
} else
ChangeToCall(II);