diff options
Diffstat (limited to 'lib/Module/LowerSwitch.cpp')
-rw-r--r-- | lib/Module/LowerSwitch.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Module/LowerSwitch.cpp b/lib/Module/LowerSwitch.cpp index fb37da86..9ccf4804 100644 --- a/lib/Module/LowerSwitch.cpp +++ b/lib/Module/LowerSwitch.cpp @@ -117,9 +117,9 @@ void LowerSwitchPass::processSwitchInst(SwitchInst *SI) { CaseVector cases; #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 1) - for (unsigned i = 0; i < SI->getNumCases(); ++i) - cases.push_back(SwitchCase(SI->getCaseValue(i), - SI->getCaseSuccessor(i))); + for (SwitchInst::CaseIt i = SI->caseBegin(), e = SI->caseEnd(); i != e; ++i) + cases.push_back(SwitchCase(i.getCaseValue(), + i.getCaseSuccessor())); #else for (unsigned i = 1; i < SI->getNumSuccessors(); ++i) cases.push_back(SwitchCase(SI->getSuccessorValue(i), |