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);
|
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!");
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue