1 //==- SystemZMachineFuctionInfo.h - SystemZ machine function info -*- C++ -*-=// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #ifndef SYSTEMZMACHINEFUNCTIONINFO_H 11 #define SYSTEMZMACHINEFUNCTIONINFO_H 12 13 #include "llvm/CodeGen/MachineFunction.h" 14 15 namespace llvm { 16 17 class SystemZMachineFunctionInfo : public MachineFunctionInfo { 18 unsigned LowSavedGPR; 19 unsigned HighSavedGPR; 20 unsigned VarArgsFirstGPR; 21 unsigned VarArgsFirstFPR; 22 unsigned VarArgsFrameIndex; 23 unsigned RegSaveFrameIndex; 24 bool ManipulatesSP; 25 26 virtual void anchor(); 27 28 public: 29 explicit SystemZMachineFunctionInfo(MachineFunction &MF) 30 : LowSavedGPR(0), HighSavedGPR(0), VarArgsFirstGPR(0), VarArgsFirstFPR(0), 31 VarArgsFrameIndex(0), RegSaveFrameIndex(0), ManipulatesSP(false) {} 32 33 // Get and set the first call-saved GPR that should be saved and restored 34 // by this function. This is 0 if no GPRs need to be saved or restored. 35 unsigned getLowSavedGPR() const { return LowSavedGPR; } 36 void setLowSavedGPR(unsigned Reg) { LowSavedGPR = Reg; } 37 38 // Get and set the last call-saved GPR that should be saved and restored 39 // by this function. 40 unsigned getHighSavedGPR() const { return HighSavedGPR; } 41 void setHighSavedGPR(unsigned Reg) { HighSavedGPR = Reg; } 42 43 // Get and set the number of fixed (as opposed to variable) arguments 44 // that are passed in GPRs to this function. 45 unsigned getVarArgsFirstGPR() const { return VarArgsFirstGPR; } 46 void setVarArgsFirstGPR(unsigned GPR) { VarArgsFirstGPR = GPR; } 47 48 // Likewise FPRs. 49 unsigned getVarArgsFirstFPR() const { return VarArgsFirstFPR; } 50 void setVarArgsFirstFPR(unsigned FPR) { VarArgsFirstFPR = FPR; } 51 52 // Get and set the frame index of the first stack vararg. 53 unsigned getVarArgsFrameIndex() const { return VarArgsFrameIndex; } 54 void setVarArgsFrameIndex(unsigned FI) { VarArgsFrameIndex = FI; } 55 56 // Get and set the frame index of the register save area 57 // (i.e. the incoming stack pointer). 58 unsigned getRegSaveFrameIndex() const { return RegSaveFrameIndex; } 59 void setRegSaveFrameIndex(unsigned FI) { RegSaveFrameIndex = FI; } 60 61 // Get and set whether the function directly manipulates the stack pointer, 62 // e.g. through STACKSAVE or STACKRESTORE. 63 bool getManipulatesSP() const { return ManipulatesSP; } 64 void setManipulatesSP(bool MSP) { ManipulatesSP = MSP; } 65 }; 66 67 } // end llvm namespace 68 69 #endif 70