mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
Simplify code by using SwitchInst::findCaseValue instead of reimplementing it.
llvm-svn: 50957
This commit is contained in:
parent
cc084a6ba1
commit
858c3299c1
@ -448,20 +448,8 @@ void SCCPSolver::getFeasibleSuccessors(TerminatorInst &TI,
|
||||
(SCValue.isConstant() && !isa<ConstantInt>(SCValue.getConstant()))) {
|
||||
// All destinations are executable!
|
||||
Succs.assign(TI.getNumSuccessors(), true);
|
||||
} else if (SCValue.isConstant()) {
|
||||
Constant *CPV = SCValue.getConstant();
|
||||
// Make sure to skip the "default value" which isn't a value
|
||||
for (unsigned i = 1, E = SI->getNumSuccessors(); i != E; ++i) {
|
||||
if (SI->getSuccessorValue(i) == CPV) {// Found the right branch...
|
||||
Succs[i] = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Constant value not equal to any of the branches... must execute
|
||||
// default branch then...
|
||||
Succs[0] = true;
|
||||
}
|
||||
} else if (SCValue.isConstant())
|
||||
Succs[SI->findCaseValue(cast<ConstantInt>(SCValue.getConstant()))] = true;
|
||||
} else {
|
||||
assert(0 && "SCCP: Don't know how to handle this terminator!");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user