Fix a end() dereference; remove an abort() that wasn't meant to be left in.
authorEvan Cheng <evan.cheng@apple.com>
Fri, 24 Oct 2008 05:53:44 +0000 (05:53 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 24 Oct 2008 05:53:44 +0000 (05:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58072 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/PreAllocSplitting.cpp

index 498600f37b4b2fd77a3abdc242e64d1bb1b31a5f..37d0df1139d707e879243bf2c87fbc45a2abf844 100644 (file)
@@ -381,13 +381,13 @@ PreAllocSplitting::ShrinkWrapToLastUse(MachineBasicBlock *MBB,
     LastMO = Uses[0];
     LastMI = LastMO->getParent();
   } else {
+    MachineBasicBlock::iterator MEE = MBB->begin();
     MachineBasicBlock::iterator MII;
-    if (MBB == BarrierMBB) {
+    if (MBB == BarrierMBB)
       MII = Barrier;
-      --MII;
-    } else
+    else
       MII = MBB->end();
-    for (MachineBasicBlock::iterator MEE = MBB->begin(); MII != MEE; --MII) {
+    while (--MII != MEE) {
       MachineInstr *UseMI = &*MII;
       if (!UseMIs.count(UseMI))
         continue;
@@ -460,7 +460,6 @@ PreAllocSplitting::ShrinkWrapLiveInterval(VNInfo *ValNo,
   } else {
     // Remove entire live range of the bb out of the live interval.
     CurrLI->removeRange(LIs->getMBBStartIdx(MBB), LIs->getMBBEndIdx(MBB)+1);
-    abort(); // FIXME
   }
 
   if (MBB == DefMBB)