1251607Sdim//==- SystemZMachineFuctionInfo.h - SystemZ machine function info -*- C++ -*-=//
2251607Sdim//
3251607Sdim//                     The LLVM Compiler Infrastructure
4251607Sdim//
5251607Sdim// This file is distributed under the University of Illinois Open Source
6251607Sdim// License. See LICENSE.TXT for details.
7251607Sdim//
8251607Sdim//===----------------------------------------------------------------------===//
9251607Sdim
10251607Sdim#ifndef SYSTEMZMACHINEFUNCTIONINFO_H
11251607Sdim#define SYSTEMZMACHINEFUNCTIONINFO_H
12251607Sdim
13251607Sdim#include "llvm/CodeGen/MachineFunction.h"
14251607Sdim
15251607Sdimnamespace llvm {
16251607Sdim
17251607Sdimclass SystemZMachineFunctionInfo : public MachineFunctionInfo {
18263509Sdim  virtual void anchor();
19251607Sdim  unsigned LowSavedGPR;
20251607Sdim  unsigned HighSavedGPR;
21251607Sdim  unsigned VarArgsFirstGPR;
22251607Sdim  unsigned VarArgsFirstFPR;
23251607Sdim  unsigned VarArgsFrameIndex;
24251607Sdim  unsigned RegSaveFrameIndex;
25251607Sdim  bool ManipulatesSP;
26251607Sdim
27251607Sdimpublic:
28251607Sdim  explicit SystemZMachineFunctionInfo(MachineFunction &MF)
29263509Sdim    : LowSavedGPR(0), HighSavedGPR(0), VarArgsFirstGPR(0), VarArgsFirstFPR(0),
30263509Sdim      VarArgsFrameIndex(0), RegSaveFrameIndex(0), ManipulatesSP(false) {}
31251607Sdim
32251607Sdim  // Get and set the first call-saved GPR that should be saved and restored
33251607Sdim  // by this function.  This is 0 if no GPRs need to be saved or restored.
34251607Sdim  unsigned getLowSavedGPR() const { return LowSavedGPR; }
35251607Sdim  void setLowSavedGPR(unsigned Reg) { LowSavedGPR = Reg; }
36251607Sdim
37251607Sdim  // Get and set the last call-saved GPR that should be saved and restored
38251607Sdim  // by this function.
39251607Sdim  unsigned getHighSavedGPR() const { return HighSavedGPR; }
40251607Sdim  void setHighSavedGPR(unsigned Reg) { HighSavedGPR = Reg; }
41251607Sdim
42251607Sdim  // Get and set the number of fixed (as opposed to variable) arguments
43251607Sdim  // that are passed in GPRs to this function.
44251607Sdim  unsigned getVarArgsFirstGPR() const { return VarArgsFirstGPR; }
45251607Sdim  void setVarArgsFirstGPR(unsigned GPR) { VarArgsFirstGPR = GPR; }
46251607Sdim
47251607Sdim  // Likewise FPRs.
48251607Sdim  unsigned getVarArgsFirstFPR() const { return VarArgsFirstFPR; }
49251607Sdim  void setVarArgsFirstFPR(unsigned FPR) { VarArgsFirstFPR = FPR; }
50251607Sdim
51251607Sdim  // Get and set the frame index of the first stack vararg.
52251607Sdim  unsigned getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
53251607Sdim  void setVarArgsFrameIndex(unsigned FI) { VarArgsFrameIndex = FI; }
54251607Sdim
55251607Sdim  // Get and set the frame index of the register save area
56251607Sdim  // (i.e. the incoming stack pointer).
57251607Sdim  unsigned getRegSaveFrameIndex() const { return RegSaveFrameIndex; }
58251607Sdim  void setRegSaveFrameIndex(unsigned FI) { RegSaveFrameIndex = FI; }
59251607Sdim
60251607Sdim  // Get and set whether the function directly manipulates the stack pointer,
61251607Sdim  // e.g. through STACKSAVE or STACKRESTORE.
62251607Sdim  bool getManipulatesSP() const { return ManipulatesSP; }
63251607Sdim  void setManipulatesSP(bool MSP) { ManipulatesSP = MSP; }
64251607Sdim};
65251607Sdim
66251607Sdim} // end llvm namespace
67251607Sdim
68251607Sdim#endif
69