Fun arithmetic with iterators aimed at fixing a bug: inserting instructions

after the *current* instruction while keeping the iterator in the same
'logical' place.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4923 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Misha Brukman 2002-12-04 19:24:45 +00:00
parent 0d2cf3a533
commit 06f8aecc88

View File

@ -29,7 +29,8 @@ namespace {
unsigned NumBytesAllocated, ByteAlignment;
// Maps SSA Regs => offsets on the stack where these values are stored
std::map<unsigned, unsigned> RegMap; // FIXME: change name to VirtReg2OffsetMap
// FIXME: change name to VirtReg2OffsetMap
std::map<unsigned, unsigned> RegMap;
// Maps SSA Regs => physical regs
std::map<unsigned, unsigned> SSA2PhysRegMap;
@ -235,7 +236,8 @@ bool RegAllocSimple::runOnMachineFunction(MachineFunction &Fn) {
if (op.opIsDef()) {
physReg = getFreeReg(virtualReg);
MachineBasicBlock::iterator J = I;
I = saveVirtRegToStack(J, virtualReg, physReg);
J = saveVirtRegToStack(++J, virtualReg, physReg);
I = --J;
} else {
I = moveUseToReg(I, virtualReg, physReg);
}