From f8be5e94aaf70d53dc043f5e541fc0bf6771db22 Mon Sep 17 00:00:00 2001 From: Nate Begeman Date: Sat, 14 Aug 2004 22:05:10 +0000 Subject: [PATCH] Eliminate MachineFunction& argument from eliminateFrameIndex in x86 Target. Get MachineFunction from MachineInstruction's parent's parent git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15739 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86RegisterInfo.cpp | 4 ++-- lib/Target/X86/X86RegisterInfo.h | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp index 8c0d08e1b57..dba98d6ed05 100644 --- a/lib/Target/X86/X86RegisterInfo.cpp +++ b/lib/Target/X86/X86RegisterInfo.cpp @@ -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!"); diff --git a/lib/Target/X86/X86RegisterInfo.h b/lib/Target/X86/X86RegisterInfo.h index b67091cd404..a582519255c 100644 --- a/lib/Target/X86/X86RegisterInfo.h +++ b/lib/Target/X86/X86RegisterInfo.h @@ -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; -- 2.34.1