forked from OSchip/llvm-project
Eliminate MachineFunction& argument from eliminateFrameIndex in x86 Target. Get MachineFunction from MachineInstruction's parent's parent
llvm-svn: 15739
This commit is contained in:
parent
1b0142d54e
commit
a4da0d6294
|
@ -372,10 +372,10 @@ eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
|
|||
MBB.erase(I);
|
||||
}
|
||||
|
||||
void X86RegisterInfo::eliminateFrameIndex(MachineFunction &MF,
|
||||
MachineBasicBlock::iterator II) const {
|
||||
void X86RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II) const{
|
||||
unsigned i = 0;
|
||||
MachineInstr &MI = *II;
|
||||
MachineFunction &MF = *MI.getParent()->getParent();
|
||||
while (!MI.getOperand(i).isFrameIndex()) {
|
||||
++i;
|
||||
assert(i < MI.getNumOperands() && "Instr doesn't have FrameIndex operand!");
|
||||
|
|
|
@ -57,8 +57,7 @@ struct X86RegisterInfo : public X86GenRegisterInfo {
|
|||
MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI) const;
|
||||
|
||||
void eliminateFrameIndex(MachineFunction &MF,
|
||||
MachineBasicBlock::iterator MI) const;
|
||||
void eliminateFrameIndex(MachineBasicBlock::iterator MI) const;
|
||||
|
||||
void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
|
||||
|
||||
|
|
Loading…
Reference in New Issue