blob: 845291f4f3fa44b4fb194b4c75b9c2c4a26cb1c6 [file] [log] [blame]
Ulrich Weigand5f613df2013-05-06 16:15:19 +00001//==- 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
15namespace llvm {
16
17class SystemZMachineFunctionInfo : public MachineFunctionInfo {
Juergen Ributzkad12ccbd2013-11-19 00:57:56 +000018 virtual void anchor();
Ulrich Weigand5f613df2013-05-06 16:15:19 +000019 unsigned LowSavedGPR;
20 unsigned HighSavedGPR;
21 unsigned VarArgsFirstGPR;
22 unsigned VarArgsFirstFPR;
23 unsigned VarArgsFrameIndex;
24 unsigned RegSaveFrameIndex;
25 bool ManipulatesSP;
26
27public:
28 explicit SystemZMachineFunctionInfo(MachineFunction &MF)
Richard Sandiforddb39b4a2013-07-03 09:11:00 +000029 : LowSavedGPR(0), HighSavedGPR(0), VarArgsFirstGPR(0), VarArgsFirstFPR(0),
30 VarArgsFrameIndex(0), RegSaveFrameIndex(0), ManipulatesSP(false) {}
Ulrich Weigand5f613df2013-05-06 16:15:19 +000031
32 // Get and set the first call-saved GPR that should be saved and restored
33 // by this function. This is 0 if no GPRs need to be saved or restored.
34 unsigned getLowSavedGPR() const { return LowSavedGPR; }
35 void setLowSavedGPR(unsigned Reg) { LowSavedGPR = Reg; }
36
37 // Get and set the last call-saved GPR that should be saved and restored
38 // by this function.
39 unsigned getHighSavedGPR() const { return HighSavedGPR; }
40 void setHighSavedGPR(unsigned Reg) { HighSavedGPR = Reg; }
41
42 // Get and set the number of fixed (as opposed to variable) arguments
43 // that are passed in GPRs to this function.
44 unsigned getVarArgsFirstGPR() const { return VarArgsFirstGPR; }
45 void setVarArgsFirstGPR(unsigned GPR) { VarArgsFirstGPR = GPR; }
46
47 // Likewise FPRs.
48 unsigned getVarArgsFirstFPR() const { return VarArgsFirstFPR; }
49 void setVarArgsFirstFPR(unsigned FPR) { VarArgsFirstFPR = FPR; }
50
51 // Get and set the frame index of the first stack vararg.
52 unsigned getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
53 void setVarArgsFrameIndex(unsigned FI) { VarArgsFrameIndex = FI; }
54
55 // Get and set the frame index of the register save area
56 // (i.e. the incoming stack pointer).
57 unsigned getRegSaveFrameIndex() const { return RegSaveFrameIndex; }
58 void setRegSaveFrameIndex(unsigned FI) { RegSaveFrameIndex = FI; }
59
60 // Get and set whether the function directly manipulates the stack pointer,
61 // e.g. through STACKSAVE or STACKRESTORE.
62 bool getManipulatesSP() const { return ManipulatesSP; }
63 void setManipulatesSP(bool MSP) { ManipulatesSP = MSP; }
64};
65
66} // end llvm namespace
67
68#endif