1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

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

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

llvm-svn: 4923
This commit is contained in:
Misha Brukman 2002-12-04 19:24:45 +00:00
parent f8634130dc
commit 566bac5ec1

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);
}