aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocSimple.cpp
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2002-12-04 19:24:45 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2002-12-04 19:24:45 +0000
commit06f8aecc882b90d23206233fe95b2df6078f987c (patch)
tree0f56cfc74ccd4c8f743861df6e02bff686b101a6 /lib/CodeGen/RegAllocSimple.cpp
parent0d2cf3a533572ee2f4a08f997499d18e41a37176 (diff)
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
Diffstat (limited to 'lib/CodeGen/RegAllocSimple.cpp')
-rw-r--r--lib/CodeGen/RegAllocSimple.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/RegAllocSimple.cpp b/lib/CodeGen/RegAllocSimple.cpp
index 0daab42c3e..596ade5fac 100644
--- a/lib/CodeGen/RegAllocSimple.cpp
+++ b/lib/CodeGen/RegAllocSimple.cpp
@@ -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);
}