Taken into account Duncan's comments for r149481 dated by 2nd Feb 2012:
[oota-llvm.git] / lib / Analysis / LazyValueInfo.cpp
index 279d6a91ec6e0a220a630379caf60f45987fe18f..6f1137eab74dd94bde4a6c1c5dae818e38b01e56 100644 (file)
@@ -866,10 +866,11 @@ bool LazyValueInfoCache::getEdgeValue(Value *Val, BasicBlock *BBFrom,
       // BBFrom to BBTo.
       unsigned NumEdges = 0;
       ConstantInt *EdgeVal = 0;
-      for (unsigned i = 0, e = SI->getNumCases(); i != e; ++i) {
-        if (SI->getCaseSuccessor(i) != BBTo) continue;
+      for (SwitchInst::CaseIt i = SI->caseBegin(), e = SI->caseEnd();
+           i != e; ++i) {
+        if (i.getCaseSuccessor() != BBTo) continue;
         if (NumEdges++) break;
-        EdgeVal = SI->getCaseValue(i);
+        EdgeVal = i.getCaseValue();
       }
       assert(EdgeVal && "Missing successor?");
       if (NumEdges == 1) {