Eliminate MachineFunction& argument from eliminateFrameIndex in x86 Target. Get MachineFunction from MachineInstruction's parent's parent

llvm-svn: 15739
This commit is contained in:
Nate Begeman 2004-08-14 22:05:10 +00:00
parent 1b0142d54e
commit a4da0d6294
2 changed files with 3 additions and 4 deletions

View File

@ -372,10 +372,10 @@ eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
MBB.erase(I); MBB.erase(I);
} }
void X86RegisterInfo::eliminateFrameIndex(MachineFunction &MF, void X86RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II) const{
MachineBasicBlock::iterator II) const {
unsigned i = 0; unsigned i = 0;
MachineInstr &MI = *II; MachineInstr &MI = *II;
MachineFunction &MF = *MI.getParent()->getParent();
while (!MI.getOperand(i).isFrameIndex()) { while (!MI.getOperand(i).isFrameIndex()) {
++i; ++i;
assert(i < MI.getNumOperands() && "Instr doesn't have FrameIndex operand!"); assert(i < MI.getNumOperands() && "Instr doesn't have FrameIndex operand!");

View File

@ -57,8 +57,7 @@ struct X86RegisterInfo : public X86GenRegisterInfo {
MachineBasicBlock &MBB, MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI) const; MachineBasicBlock::iterator MI) const;
void eliminateFrameIndex(MachineFunction &MF, void eliminateFrameIndex(MachineBasicBlock::iterator MI) const;
MachineBasicBlock::iterator MI) const;
void processFunctionBeforeFrameFinalized(MachineFunction &MF) const; void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;