diff options
Diffstat (limited to 'llvm/lib/Target/SystemZ/SystemZMachineFunctionInfo.h')
-rw-r--r-- | llvm/lib/Target/SystemZ/SystemZMachineFunctionInfo.h | 52 |
1 files changed, 37 insertions, 15 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZMachineFunctionInfo.h b/llvm/lib/Target/SystemZ/SystemZMachineFunctionInfo.h index 9eec3f37bc28..d1f6511ceea3 100644 --- a/llvm/lib/Target/SystemZ/SystemZMachineFunctionInfo.h +++ b/llvm/lib/Target/SystemZ/SystemZMachineFunctionInfo.h @@ -13,10 +13,22 @@ namespace llvm { +namespace SystemZ { +// A struct to hold the low and high GPR registers to be saved/restored as +// well as the offset into the register save area of the low register. +struct GPRRegs { + unsigned LowGPR; + unsigned HighGPR; + unsigned GPROffset; + GPRRegs() : LowGPR(0), HighGPR(0), GPROffset(0) {} + }; +} + class SystemZMachineFunctionInfo : public MachineFunctionInfo { virtual void anchor(); - unsigned LowSavedGPR; - unsigned HighSavedGPR; + + SystemZ::GPRRegs SpillGPRRegs; + SystemZ::GPRRegs RestoreGPRRegs; unsigned VarArgsFirstGPR; unsigned VarArgsFirstFPR; unsigned VarArgsFrameIndex; @@ -27,19 +39,29 @@ class SystemZMachineFunctionInfo : public MachineFunctionInfo { public: explicit SystemZMachineFunctionInfo(MachineFunction &MF) - : LowSavedGPR(0), HighSavedGPR(0), VarArgsFirstGPR(0), VarArgsFirstFPR(0), - VarArgsFrameIndex(0), RegSaveFrameIndex(0), FramePointerSaveIndex(0), - ManipulatesSP(false), NumLocalDynamics(0) {} - - // Get and set the first call-saved GPR that should be saved and restored - // by this function. This is 0 if no GPRs need to be saved or restored. - unsigned getLowSavedGPR() const { return LowSavedGPR; } - void setLowSavedGPR(unsigned Reg) { LowSavedGPR = Reg; } - - // Get and set the last call-saved GPR that should be saved and restored - // by this function. - unsigned getHighSavedGPR() const { return HighSavedGPR; } - void setHighSavedGPR(unsigned Reg) { HighSavedGPR = Reg; } + : VarArgsFirstGPR(0), VarArgsFirstFPR(0), VarArgsFrameIndex(0), + RegSaveFrameIndex(0), FramePointerSaveIndex(0), ManipulatesSP(false), + NumLocalDynamics(0) {} + + // Get and set the first and last call-saved GPR that should be saved by + // this function and the SP offset for the STMG. These are 0 if no GPRs + // need to be saved or restored. + SystemZ::GPRRegs getSpillGPRRegs() const { return SpillGPRRegs; } + void setSpillGPRRegs(unsigned Low, unsigned High, unsigned Offs) { + SpillGPRRegs.LowGPR = Low; + SpillGPRRegs.HighGPR = High; + SpillGPRRegs.GPROffset = Offs; + } + + // Get and set the first and last call-saved GPR that should be restored by + // this function and the SP offset for the LMG. These are 0 if no GPRs + // need to be saved or restored. + SystemZ::GPRRegs getRestoreGPRRegs() const { return RestoreGPRRegs; } + void setRestoreGPRRegs(unsigned Low, unsigned High, unsigned Offs) { + RestoreGPRRegs.LowGPR = Low; + RestoreGPRRegs.HighGPR = High; + RestoreGPRRegs.GPROffset = Offs; + } // Get and set the number of fixed (as opposed to variable) arguments // that are passed in GPRs to this function. |