diff --git a/include/llvm/Target/MRegisterInfo.h b/include/llvm/Target/MRegisterInfo.h index 61c594ceb36..7afc95b95fd 100644 --- a/include/llvm/Target/MRegisterInfo.h +++ b/include/llvm/Target/MRegisterInfo.h @@ -17,11 +17,11 @@ #define LLVM_TARGET_MREGISTERINFO_H #include +#include "llvm/CodeGen/MachineBasicBlock.h" namespace llvm { class Type; -class MachineBasicBlock; class MachineFunction; class MachineInstr; @@ -227,17 +227,17 @@ public: // virtual int storeRegToStackSlot(MachineBasicBlock &MBB, - MachineInstr* MI, + MachineBasicBlock::iterator MI, unsigned SrcReg, int FrameIndex, const TargetRegisterClass *RC) const = 0; virtual int loadRegFromStackSlot(MachineBasicBlock &MBB, - MachineInstr* MI, + MachineBasicBlock::iterator MI, unsigned DestReg, int FrameIndex, const TargetRegisterClass *RC) const = 0; virtual int copyRegToReg(MachineBasicBlock &MBB, - MachineInstr* MI, + MachineBasicBlock::iterator MI, unsigned DestReg, unsigned SrcReg, const TargetRegisterClass *RC) const = 0; @@ -262,7 +262,7 @@ public: /// virtual int eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, - MachineInstr* MI) const { + MachineBasicBlock::iterator MI) const { assert(getCallFrameSetupOpcode()== -1 && getCallFrameDestroyOpcode()== -1 && "eliminateCallFramePseudoInstr must be implemented if using" " call frame setup/destroy pseudo instructions!"); @@ -290,7 +290,7 @@ public: /// added to (negative if removed from) the basic block. /// virtual int eliminateFrameIndex(MachineFunction &MF, - MachineInstr* MI) const = 0; + MachineBasicBlock::iterator MI) const = 0; /// emitProlog/emitEpilog - These methods insert prolog and epilog code into /// the function. The return value is the number of instructions diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp index 99f834d3051..3031762288d 100644 --- a/lib/Target/X86/X86RegisterInfo.cpp +++ b/lib/Target/X86/X86RegisterInfo.cpp @@ -47,7 +47,7 @@ static unsigned getIdx(const TargetRegisterClass *RC) { } int X86RegisterInfo::storeRegToStackSlot(MachineBasicBlock &MBB, - MachineInstr* MI, + MachineBasicBlock::iterator MI, unsigned SrcReg, int FrameIdx, const TargetRegisterClass *RC) const { static const unsigned Opcode[] = @@ -59,7 +59,7 @@ int X86RegisterInfo::storeRegToStackSlot(MachineBasicBlock &MBB, } int X86RegisterInfo::loadRegFromStackSlot(MachineBasicBlock &MBB, - MachineInstr* MI, + MachineBasicBlock::iterator MI, unsigned DestReg, int FrameIdx, const TargetRegisterClass *RC) const{ static const unsigned Opcode[] = @@ -70,7 +70,7 @@ int X86RegisterInfo::loadRegFromStackSlot(MachineBasicBlock &MBB, } int X86RegisterInfo::copyRegToReg(MachineBasicBlock &MBB, - MachineInstr* MI, + MachineBasicBlock::iterator MI, unsigned DestReg, unsigned SrcReg, const TargetRegisterClass *RC) const { static const unsigned Opcode[] = @@ -93,7 +93,7 @@ static bool hasFP(MachineFunction &MF) { int X86RegisterInfo::eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, - MachineInstr* I) const { + MachineBasicBlock::iterator I) const { MachineInstr *New = 0, *Old = I; if (hasFP(MF)) { // If we have a frame pointer, turn the adjcallstackup instruction into a @@ -127,7 +127,7 @@ int X86RegisterInfo::eliminateCallFramePseudoInstr(MachineFunction &MF, } int X86RegisterInfo::eliminateFrameIndex(MachineFunction &MF, - MachineInstr* II) const { + MachineBasicBlock::iterator II) const { unsigned i = 0; MachineInstr &MI = *II; while (!MI.getOperand(i).isFrameIndex()) { diff --git a/lib/Target/X86/X86RegisterInfo.h b/lib/Target/X86/X86RegisterInfo.h index 0087d255cf3..45e49a88470 100644 --- a/lib/Target/X86/X86RegisterInfo.h +++ b/lib/Target/X86/X86RegisterInfo.h @@ -28,26 +28,26 @@ struct X86RegisterInfo : public X86GenRegisterInfo { /// Code Generation virtual methods... int storeRegToStackSlot(MachineBasicBlock &MBB, - MachineInstr* MI, + MachineBasicBlock::iterator MI, unsigned SrcReg, int FrameIndex, const TargetRegisterClass *RC) const; int loadRegFromStackSlot(MachineBasicBlock &MBB, - MachineInstr* MI, + MachineBasicBlock::iterator MI, unsigned DestReg, int FrameIndex, const TargetRegisterClass *RC) const; int copyRegToReg(MachineBasicBlock &MBB, - MachineInstr* MI, + MachineBasicBlock::iterator MI, unsigned DestReg, unsigned SrcReg, const TargetRegisterClass *RC) const; int eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, - MachineInstr* MI) const; + MachineBasicBlock::iterator MI) const; int eliminateFrameIndex(MachineFunction &MF, - MachineInstr* MI) const; + MachineBasicBlock::iterator MI) const; int processFunctionBeforeFrameFinalized(MachineFunction &MF) const;