Don't hang on to pointers or references after vector::push_back.

The MO reference to a MachineOperand can be invalidated by
MachineInstr::addOperand. Don't even use it for debugging.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90381 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen 2009-12-03 01:49:56 +00:00
parent fd82af0f95
commit 15d75d9f11

View File

@ -510,12 +510,9 @@ void SchedulePostRATDList::FixupKills(MachineBasicBlock *MBB) {
}
if (MO.isKill() != kill) {
bool removed = ToggleKillFlag(MI, MO);
if (removed) {
DEBUG(errs() << "Fixed <removed> in ");
} else {
DEBUG(errs() << "Fixed " << MO << " in ");
}
DEBUG(errs() << "Fixing " << MO << " in ");
// Warning: ToggleKillFlag may invalidate MO.
ToggleKillFlag(MI, MO);
DEBUG(MI->dump());
}