aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Utils/SimplifyCFG.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp
index e1910446de..1adbef9253 100644
--- a/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -201,7 +201,8 @@ bool SimplifyCFG(BasicBlock *BB) {
}
BasicBlock *OnlySucc = 0;
- if (OnlyPred && OnlyPred != BB) { // Don't break self loops
+ if (OnlyPred && OnlyPred != BB && // Don't break self loops
+ OnlyPred->getTerminator()->getOpcode() != Instruction::Invoke) {
// Check to see if there is only one distinct successor...
succ_iterator SI(succ_begin(OnlyPred)), SE(succ_end(OnlyPred));
OnlySucc = BB;