summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/UnreachableBlockElim.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/UnreachableBlockElim.cpp')
-rw-r--r--llvm/lib/CodeGen/UnreachableBlockElim.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/UnreachableBlockElim.cpp b/llvm/lib/CodeGen/UnreachableBlockElim.cpp
index 0476a1292f8..2e220820b92 100644
--- a/llvm/lib/CodeGen/UnreachableBlockElim.cpp
+++ b/llvm/lib/CodeGen/UnreachableBlockElim.cpp
@@ -79,8 +79,8 @@ bool UnreachableBlockElim::runOnFunction(Function &F) {
PN->replaceAllUsesWith(Constant::getNullValue(PN->getType()));
BB->getInstList().pop_front();
}
- for (BasicBlock *S : successors(BB))
- S->removePredecessor(BB);
+ for (succ_iterator SI = succ_begin(BB), E = succ_end(BB); SI != E; ++SI)
+ (*SI)->removePredecessor(BB);
BB->dropAllReferences();
}
OpenPOWER on IntegriCloud