MachineBasicBlock::remove should not modify the iterator passed in

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12571 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-03-31 21:59:29 +00:00
parent 0c58897d1c
commit 4f6410f5cb

View File

@ -71,8 +71,7 @@ bool PNE::EliminatePHINodes(MachineFunction &MF, MachineBasicBlock &MBB) {
while (MBB.front().getOpcode() == TargetInstrInfo::PHI) {
// Unlink the PHI node from the basic block... but don't delete the PHI yet
MachineBasicBlock::iterator begin = MBB.begin();
MachineInstr *MI = MBB.remove(begin);
MachineInstr *MI = MBB.remove(MBB.begin());
assert(MRegisterInfo::isVirtualRegister(MI->getOperand(0).getReg()) &&
"PHI node doesn't write virt reg?");