Fix a bug in the range remover
[oota-llvm.git] / lib / CodeGen / LiveInterval.cpp
index 79aa710c03b94f1564b0ec2543588444d2fb1488..e5331530807c3e4983efcd50b78673461e8b6865 100644 (file)
@@ -75,8 +75,8 @@ bool LiveInterval::overlaps(const LiveInterval& other) const {
       return true;
 
     if (i->start > j->start) {
-      swap(i, j);
-      swap(ie, je);
+      std::swap(i, j);
+      std::swap(ie, je);
     }
     assert(i->start < j->start);
 
@@ -223,7 +223,7 @@ void LiveInterval::removeRange(unsigned Start, unsigned End) {
   // Otherwise if the span we are removing is at the end of the LiveRange,
   // adjust the other way.
   if (I->end == End) {
-    I->start = Start;
+    I->end = Start;
     return;
   }