return;
}
- Succs[SI->resolveSuccessorIndex(SI->findCaseValue(CI))] = true;
+ Succs[SI->findCaseValue(CI).getSuccessorIndex()] = true;
return;
}
if (CI == 0)
return !SCValue.isUndefined();
- // Make sure to skip the "default value" which isn't a value
- for (unsigned i = 0, E = SI->getNumCases(); i != E; ++i)
- if (SI->getCaseValue(i) == CI) // Found the taken branch.
- return SI->getCaseSuccessor(i) == To;
-
- // If the constant value is not equal to any of the branches, we must
- // execute default branch.
- return SI->getDefaultDest() == To;
+ return SI->findCaseValue(CI).getCaseSuccessor() == To;
}
// Just mark all destinations executable!
// If the input to SCCP is actually switch on undef, fix the undef to
// the first constant.
if (isa<UndefValue>(SI->getCondition())) {
- SI->setCondition(SI->getCaseValue(0));
- markEdgeExecutable(BB, SI->getCaseSuccessor(0));
+ SI->setCondition(SI->caseBegin().getCaseValue());
+ markEdgeExecutable(BB, SI->caseBegin().getCaseSuccessor());
return true;
}
- markForcedConstant(SI->getCondition(), SI->getCaseValue(0));
+ markForcedConstant(SI->getCondition(), SI->caseBegin().getCaseValue());
return true;
}
}