return true;
else if (p.second->getNumber() > q.second->getNumber())
return false;
- else
+ else {
+ // _GLIBCXX_DEBUG checks strict weak ordering, which involves comparing
+ // an object with itself.
+#ifndef _GLIBCXX_DEBUG
assert(0 && "Predecessor appears twice");
+#endif
+ return(false);
+ }
}
// See if any of the blocks in MergePotentials (which all have a common single
}
// Iterate through all the predecessors, revectoring each in-turn.
- MachineBasicBlock::pred_iterator PI = MBB->pred_begin();
+ size_t PI = 0;
bool DidChange = false;
bool HasBranchToSelf = false;
- while (PI != MBB->pred_end()) {
- if (*PI == MBB) {
+ while(PI != MBB->pred_size()) {
+ MachineBasicBlock *PMBB = *(MBB->pred_begin() + PI);
+ if (PMBB == MBB) {
// If this block has an uncond branch to itself, leave it.
++PI;
HasBranchToSelf = true;
} else {
DidChange = true;
- (*PI)->ReplaceUsesOfBlockWith(MBB, CurTBB);
+ PMBB->ReplaceUsesOfBlockWith(MBB, CurTBB);
}
}