use range-based for loop; NFCI
authorSanjay Patel <spatel@rotateright.com>
Fri, 13 Nov 2015 16:21:23 +0000 (16:21 +0000)
committerSanjay Patel <spatel@rotateright.com>
Fri, 13 Nov 2015 16:21:23 +0000 (16:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253048 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bitcode/Writer/BitcodeWriter.cpp

index 845bbfb..62a99c7 100644 (file)
@@ -1891,10 +1891,9 @@ static void WriteInstruction(const Instruction &I, unsigned InstID,
       Vals.push_back(VE.getTypeID(SI.getCondition()->getType()));
       pushValue(SI.getCondition(), InstID, Vals, VE);
       Vals.push_back(VE.getValueID(SI.getDefaultDest()));
-      for (SwitchInst::ConstCaseIt i = SI.case_begin(), e = SI.case_end();
-           i != e; ++i) {
-        Vals.push_back(VE.getValueID(i.getCaseValue()));
-        Vals.push_back(VE.getValueID(i.getCaseSuccessor()));
+      for (SwitchInst::ConstCaseIt Case : SI.cases()) {
+        Vals.push_back(VE.getValueID(Case.getCaseValue()));
+        Vals.push_back(VE.getValueID(Case.getCaseSuccessor()));
       }
     }
     break;