Fix bug in previous checkout: leave the iterator at the first instruction

AFTER the GEP that was emitted.  :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11712 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-02-22 17:05:38 +00:00
parent e33da36cbd
commit 827832c705
2 changed files with 6 additions and 8 deletions

View File

@ -212,7 +212,7 @@ namespace {
/// emitGEPOperation - Common code shared between visitGetElementPtrInst and /// emitGEPOperation - Common code shared between visitGetElementPtrInst and
/// constant expression GEP support. /// constant expression GEP support.
/// ///
void emitGEPOperation(MachineBasicBlock *BB, MachineBasicBlock::iterator&IP, void emitGEPOperation(MachineBasicBlock *BB, MachineBasicBlock::iterator IP,
Value *Src, User::op_iterator IdxBegin, Value *Src, User::op_iterator IdxBegin,
User::op_iterator IdxEnd, unsigned TargetReg); User::op_iterator IdxEnd, unsigned TargetReg);
@ -2202,13 +2202,12 @@ void ISel::visitVAArgInst(VAArgInst &I) {
void ISel::visitGetElementPtrInst(GetElementPtrInst &I) { void ISel::visitGetElementPtrInst(GetElementPtrInst &I) {
unsigned outputReg = getReg(I); unsigned outputReg = getReg(I);
MachineBasicBlock::iterator MI = BB->end(); emitGEPOperation(BB, BB->end(), I.getOperand(0),
emitGEPOperation(BB, MI, I.getOperand(0),
I.op_begin()+1, I.op_end(), outputReg); I.op_begin()+1, I.op_end(), outputReg);
} }
void ISel::emitGEPOperation(MachineBasicBlock *MBB, void ISel::emitGEPOperation(MachineBasicBlock *MBB,
MachineBasicBlock::iterator &IP, MachineBasicBlock::iterator IP,
Value *Src, User::op_iterator IdxBegin, Value *Src, User::op_iterator IdxBegin,
User::op_iterator IdxEnd, unsigned TargetReg) { User::op_iterator IdxEnd, unsigned TargetReg) {
const TargetData &TD = TM.getTargetData(); const TargetData &TD = TM.getTargetData();

View File

@ -212,7 +212,7 @@ namespace {
/// emitGEPOperation - Common code shared between visitGetElementPtrInst and /// emitGEPOperation - Common code shared between visitGetElementPtrInst and
/// constant expression GEP support. /// constant expression GEP support.
/// ///
void emitGEPOperation(MachineBasicBlock *BB, MachineBasicBlock::iterator&IP, void emitGEPOperation(MachineBasicBlock *BB, MachineBasicBlock::iterator IP,
Value *Src, User::op_iterator IdxBegin, Value *Src, User::op_iterator IdxBegin,
User::op_iterator IdxEnd, unsigned TargetReg); User::op_iterator IdxEnd, unsigned TargetReg);
@ -2202,13 +2202,12 @@ void ISel::visitVAArgInst(VAArgInst &I) {
void ISel::visitGetElementPtrInst(GetElementPtrInst &I) { void ISel::visitGetElementPtrInst(GetElementPtrInst &I) {
unsigned outputReg = getReg(I); unsigned outputReg = getReg(I);
MachineBasicBlock::iterator MI = BB->end(); emitGEPOperation(BB, BB->end(), I.getOperand(0),
emitGEPOperation(BB, MI, I.getOperand(0),
I.op_begin()+1, I.op_end(), outputReg); I.op_begin()+1, I.op_end(), outputReg);
} }
void ISel::emitGEPOperation(MachineBasicBlock *MBB, void ISel::emitGEPOperation(MachineBasicBlock *MBB,
MachineBasicBlock::iterator &IP, MachineBasicBlock::iterator IP,
Value *Src, User::op_iterator IdxBegin, Value *Src, User::op_iterator IdxBegin,
User::op_iterator IdxEnd, unsigned TargetReg) { User::op_iterator IdxEnd, unsigned TargetReg) {
const TargetData &TD = TM.getTargetData(); const TargetData &TD = TM.getTargetData();