Taken into account Duncan's comments for r149481 dated by 2nd Feb 2012:
[oota-llvm.git] / lib / Bitcode / Writer / BitcodeWriter.cpp
index 937699068014a502561fe63d2cf205a65e950512..c04c0097a0f3c09d92244d08c13a9d0df425c5d4 100644 (file)
@@ -1142,9 +1142,10 @@ static void WriteInstruction(const Instruction &I, unsigned InstID,
       Vals.push_back(VE.getTypeID(SI.getCondition()->getType()));
       Vals.push_back(VE.getValueID(SI.getCondition()));
       Vals.push_back(VE.getValueID(SI.getDefaultDest()));
-      for (unsigned i = 0, e = SI.getNumCases(); i != e; ++i) {
-        Vals.push_back(VE.getValueID(SI.getCaseValue(i)));
-        Vals.push_back(VE.getValueID(SI.getCaseSuccessor(i)));
+      for (SwitchInst::CaseIt i = SI.caseBegin(), e = SI.caseEnd();
+           i != e; ++i) {
+        Vals.push_back(VE.getValueID(i.getCaseValue()));
+        Vals.push_back(VE.getValueID(i.getCaseSuccessor()));
       }
     }
     break;