aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/SCCP.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Scalar/SCCP.cpp')
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index fd3daa5bef..51a827d14b 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -397,8 +397,8 @@ void SCCP::visitBranchInst(BranchInst *BI) {
void SCCP::visitSwitchInst(SwitchInst *SI) {
InstVal &SCValue = getValueState(SI->getCondition());
if (SCValue.isOverdefined()) { // Overdefined condition? All dests are exe
- for(unsigned i = 0; BasicBlock *Succ = SI->getSuccessor(i); ++i)
- markExecutable(Succ);
+ for(unsigned i = 0, E = SI->getNumSuccessors(); i != E; ++i)
+ markExecutable(SI->getSuccessor(i));
} else if (SCValue.isConstant()) {
Constant *CPV = SCValue.getConstant();
// Make sure to skip the "default value" which isn't a value