All pastes #2020754 Raw Edit

Anonymous

public diff v1 · immutable
#2020754 ·published 2010-12-15 21:31 UTC
rendered paste body
Index: SelectionDAGBuilder.cpp===================================================================--- SelectionDAGBuilder.cpp	(revision 121239)+++ SelectionDAGBuilder.cpp	(working copy)@@ -2242,10 +2242,12 @@   std::sort(Cases.begin(), Cases.end(), CaseCmp());    // Merge case into clusters-  if (Cases.size() >= 2)+  if (Cases.size() >= 2) {     // Must recompute end() each iteration because it may be     // invalidated by erase if we hold on to it-    for (CaseItr I = Cases.begin(), J = ++(Cases.begin()); J != Cases.end(); ) {+    CaseItr I = Cases.begin(), J = I;+    ++J;+    while (J != Cases.end()) {       const APInt& nextValue = cast<ConstantInt>(J->Low)->getValue();       const APInt& currentValue = cast<ConstantInt>(I->High)->getValue();       MachineBasicBlock* nextBB = J->BB;@@ -2260,6 +2262,7 @@         I = J++;       }     }+  }    for (CaseItr I=Cases.begin(), E=Cases.end(); I!=E; ++I, ++numCmps) {     if (I->Low != I->High)