Clear spilled list at once. Remove unused vector.
[oota-llvm.git] / lib / CodeGen / RegAllocLinearScan.cpp
index 24508fbbb024f6deda4f01958b374b33239c37f2..4a55df189369f51c65db08e06cb0d575f28ea7b2 100644 (file)
@@ -123,23 +123,6 @@ namespace {
                 std::cerr << mri_->getName(reg) << '\n';
             }
         }
-
-//         void verifyAssignment() const {
-//             for (Virt2PhysMap::const_iterator i = v2pMap_.begin(),
-//                      e = v2pMap_.end(); i != e; ++i)
-//                 for (Virt2PhysMap::const_iterator i2 = next(i); i2 != e; ++i2)
-//                     if (MRegisterInfo::isVirtualRegister(i->second) &&
-//                         (i->second == i2->second ||
-//                          mri_->areAliases(i->second, i2->second))) {
-//                         const Interval
-//                             &in = li_->getInterval(i->second),
-//                             &in2 = li_->getInterval(i2->second);
-//                         if (in.overlaps(in2)) {
-//                             std::cerr << in << " overlaps " << in2 << '\n';
-//                             assert(0);
-//                         }
-//                     }
-//         }
     };
 }
 
@@ -399,8 +382,8 @@ void RA::assignRegOrStackSlotAtInterval(IntervalPtrs::value_type cur)
         std::vector<LiveInterval*>::iterator addedItEnd = added.end();
         for (IntervalPtrs::iterator i = unhandled_.begin(), e =unhandled_.end();
              i != e && addedIt != addedItEnd; ++i) {
-            while ((*i)->start() > (*addedIt)->start() && 
-                   addedIt != addedItEnd) {
+            while (addedIt != addedItEnd &&
+                   (*i)->start() > (*addedIt)->start()) {
 #ifndef NDEBUG
                 // This code only works if addIntervalsForSpills retursn a
                 // sorted interval list.  Assert this is the case now.