diff options
author | Chris Lattner <sabre@nondot.org> | 2002-04-27 03:15:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-04-27 03:15:45 +0000 |
commit | f2361c5e5c2917e6f19a55927b221d8671753a40 (patch) | |
tree | 096c093f33f851d65205de8e053ac2849d70a721 /lib/Transforms/Scalar/SCCP.cpp | |
parent | 35504209a0ddbc70d97a7ef16c504acc863bfeec (diff) | |
download | external_llvm-f2361c5e5c2917e6f19a55927b221d8671753a40.tar.gz external_llvm-f2361c5e5c2917e6f19a55927b221d8671753a40.tar.bz2 external_llvm-f2361c5e5c2917e6f19a55927b221d8671753a40.zip |
Changes because the Terminator::getSuccessor function now FAILS if successor
IDX is out of range instead of returning null.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2332 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/SCCP.cpp')
-rw-r--r-- | lib/Transforms/Scalar/SCCP.cpp | 4 |
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 |