LiveInterval: Use more range based for loops for value numbers and segments.

llvm-svn: 223978
diff --git a/llvm/lib/CodeGen/VirtRegMap.cpp b/llvm/lib/CodeGen/VirtRegMap.cpp
index a43e334..e9fb913 100644
--- a/llvm/lib/CodeGen/VirtRegMap.cpp
+++ b/llvm/lib/CodeGen/VirtRegMap.cpp
@@ -255,9 +255,8 @@
     if (LI.hasSubRanges()) {
       for (LiveInterval::subrange_iterator S = LI.subrange_begin(),
            SE = LI.subrange_end(); S != SE; ++S) {
-        for (LiveRange::const_iterator I = S->begin(), E = S->end(); I != E;
-             ++I) {
-          if (!Indexes->findLiveInMBBs(I->start, I->end, LiveIn))
+        for (const auto &Seg : S->segments) {
+          if (!Indexes->findLiveInMBBs(Seg.start, Seg.end, LiveIn))
             continue;
           for (MCSubRegIndexIterator SR(PhysReg, TRI); SR.isValid(); ++SR) {
             unsigned SubReg = SR.getSubReg();
@@ -275,9 +274,8 @@
       }
     } else {
       // Scan the segments of LI.
-      for (LiveInterval::const_iterator I = LI.begin(), E = LI.end(); I != E;
-           ++I) {
-        if (!Indexes->findLiveInMBBs(I->start, I->end, LiveIn))
+      for (const auto &Seg : LI.segments) {
+        if (!Indexes->findLiveInMBBs(Seg.start, Seg.end, LiveIn))
           continue;
         for (unsigned i = 0, e = LiveIn.size(); i != e; ++i)
           if (!LiveIn[i]->isLiveIn(PhysReg))