aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/SimplifyCFG.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-04-02 18:15:10 +0000
committerChris Lattner <sabre@nondot.org>2004-04-02 18:15:10 +0000
commit7aa773bc07fd6125c0e4a965760fa06c5679cc8d (patch)
tree603724ae398a13b0f94b048ce9c46b0ab56e5e70 /lib/Transforms/Utils/SimplifyCFG.cpp
parent147af6b75f2e9a71baf46a12cf1312f627f1590b (diff)
Fix the obvious bug in my previous checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12618 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r--lib/Transforms/Utils/SimplifyCFG.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp
index b606c58d52..9c3610830e 100644
--- a/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -701,6 +701,9 @@ bool llvm::SimplifyCFG(BasicBlock *BB) {
if (FVPN->getParent() == FalseSucc)
FalseValue = FVPN->getIncomingValueForBlock(BI->getParent());
+ TrueSucc->removePredecessor(BI->getParent());
+ FalseSucc->removePredecessor(BI->getParent());
+
// Insert a new select instruction.
Value *NewRetVal = new SelectInst(BI->getCondition(), TrueValue,
FalseValue, "retval", BI);