1 //=== SystemZMachineFunctionInfo.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 LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZMACHINEFUNCTIONINFO_H
11 #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZMACHINEFUNCTIONINFO_H
12 
13 #include "llvm/CodeGen/MachineFunction.h"
14 
15 namespace llvm {
16 
17 class SystemZMachineFunctionInfo : public MachineFunctionInfo {
18   virtual void anchor();
19   unsigned LowSavedGPR;
20   unsigned HighSavedGPR;
21   unsigned VarArgsFirstGPR;
22   unsigned VarArgsFirstFPR;
23   unsigned VarArgsFrameIndex;
24   unsigned RegSaveFrameIndex;
25   bool ManipulatesSP;
26   unsigned NumLocalDynamics;
27 
28 public:
SystemZMachineFunctionInfo(MachineFunction & MF)29   explicit SystemZMachineFunctionInfo(MachineFunction &MF)
30     : LowSavedGPR(0), HighSavedGPR(0), VarArgsFirstGPR(0), VarArgsFirstFPR(0),
31       VarArgsFrameIndex(0), RegSaveFrameIndex(0), ManipulatesSP(false),
32       NumLocalDynamics(0) {}
33 
34   // Get and set the first call-saved GPR that should be saved and restored
35   // by this function.  This is 0 if no GPRs need to be saved or restored.
getLowSavedGPR()36   unsigned getLowSavedGPR() const { return LowSavedGPR; }
setLowSavedGPR(unsigned Reg)37   void setLowSavedGPR(unsigned Reg) { LowSavedGPR = Reg; }
38 
39   // Get and set the last call-saved GPR that should be saved and restored
40   // by this function.
getHighSavedGPR()41   unsigned getHighSavedGPR() const { return HighSavedGPR; }
setHighSavedGPR(unsigned Reg)42   void setHighSavedGPR(unsigned Reg) { HighSavedGPR = Reg; }
43 
44   // Get and set the number of fixed (as opposed to variable) arguments
45   // that are passed in GPRs to this function.
getVarArgsFirstGPR()46   unsigned getVarArgsFirstGPR() const { return VarArgsFirstGPR; }
setVarArgsFirstGPR(unsigned GPR)47   void setVarArgsFirstGPR(unsigned GPR) { VarArgsFirstGPR = GPR; }
48 
49   // Likewise FPRs.
getVarArgsFirstFPR()50   unsigned getVarArgsFirstFPR() const { return VarArgsFirstFPR; }
setVarArgsFirstFPR(unsigned FPR)51   void setVarArgsFirstFPR(unsigned FPR) { VarArgsFirstFPR = FPR; }
52 
53   // Get and set the frame index of the first stack vararg.
getVarArgsFrameIndex()54   unsigned getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
setVarArgsFrameIndex(unsigned FI)55   void setVarArgsFrameIndex(unsigned FI) { VarArgsFrameIndex = FI; }
56 
57   // Get and set the frame index of the register save area
58   // (i.e. the incoming stack pointer).
getRegSaveFrameIndex()59   unsigned getRegSaveFrameIndex() const { return RegSaveFrameIndex; }
setRegSaveFrameIndex(unsigned FI)60   void setRegSaveFrameIndex(unsigned FI) { RegSaveFrameIndex = FI; }
61 
62   // Get and set whether the function directly manipulates the stack pointer,
63   // e.g. through STACKSAVE or STACKRESTORE.
getManipulatesSP()64   bool getManipulatesSP() const { return ManipulatesSP; }
setManipulatesSP(bool MSP)65   void setManipulatesSP(bool MSP) { ManipulatesSP = MSP; }
66 
67   // Count number of local-dynamic TLS symbols used.
getNumLocalDynamicTLSAccesses()68   unsigned getNumLocalDynamicTLSAccesses() const { return NumLocalDynamics; }
incNumLocalDynamicTLSAccesses()69   void incNumLocalDynamicTLSAccesses() { ++NumLocalDynamics; }
70 };
71 
72 } // end namespace llvm
73 
74 #endif
75