RegisterPressure: Hide non-const iterators of PressureDiff
[oota-llvm.git] / lib / CodeGen / RegisterPressure.cpp
index 87c3d46866e8274f26890f2769eed74547dcbd52..88566d88732abfa7d97eb08cbb79a35fae4cffff 100644 (file)
@@ -389,7 +389,7 @@ void PressureDiff::addPressureChange(unsigned RegUnit, bool IsDec,
   int Weight = IsDec ? -PSetI.getWeight() : PSetI.getWeight();
   for (; PSetI.isValid(); ++PSetI) {
     // Find an existing entry in the pressure diff for this PSet.
-    PressureDiff::iterator I = begin(), E = end();
+    PressureDiff::iterator I = nonconst_begin(), E = nonconst_end();
     for (; I != E && I->isValid(); ++I) {
       if (I->getPSet() >= *PSetI)
         break;