blob: 4f64f4c65f1d0d8dfea006c5daed183a8504490f [file] [log] [blame]
Nick Lewyckyc3890d22015-07-29 22:32:47 +00001//=== SystemZMachineFunctionInfo.h - SystemZ machine function info -*- C++ -*-//
Ulrich Weigand5f613df2013-05-06 16:15:19 +00002//
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
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000010#ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZMACHINEFUNCTIONINFO_H
11#define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZMACHINEFUNCTIONINFO_H
Ulrich Weigand5f613df2013-05-06 16:15:19 +000012
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;
Ulrich Weigandf557d082016-04-04 12:44:55 +000025 int FramePointerSaveIndex;
Ulrich Weigand5f613df2013-05-06 16:15:19 +000026 bool ManipulatesSP;
Ulrich Weigand7db69182015-02-18 09:13:27 +000027 unsigned NumLocalDynamics;
Ulrich Weigand5f613df2013-05-06 16:15:19 +000028
29public:
30 explicit SystemZMachineFunctionInfo(MachineFunction &MF)
Richard Sandiforddb39b4a2013-07-03 09:11:00 +000031 : LowSavedGPR(0), HighSavedGPR(0), VarArgsFirstGPR(0), VarArgsFirstFPR(0),
Ulrich Weigandf557d082016-04-04 12:44:55 +000032 VarArgsFrameIndex(0), RegSaveFrameIndex(0), FramePointerSaveIndex(0),
33 ManipulatesSP(false), NumLocalDynamics(0) {}
Ulrich Weigand5f613df2013-05-06 16:15:19 +000034
35 // Get and set the first call-saved GPR that should be saved and restored
36 // by this function. This is 0 if no GPRs need to be saved or restored.
37 unsigned getLowSavedGPR() const { return LowSavedGPR; }
38 void setLowSavedGPR(unsigned Reg) { LowSavedGPR = Reg; }
39
40 // Get and set the last call-saved GPR that should be saved and restored
41 // by this function.
42 unsigned getHighSavedGPR() const { return HighSavedGPR; }
43 void setHighSavedGPR(unsigned Reg) { HighSavedGPR = Reg; }
44
45 // Get and set the number of fixed (as opposed to variable) arguments
46 // that are passed in GPRs to this function.
47 unsigned getVarArgsFirstGPR() const { return VarArgsFirstGPR; }
48 void setVarArgsFirstGPR(unsigned GPR) { VarArgsFirstGPR = GPR; }
49
50 // Likewise FPRs.
51 unsigned getVarArgsFirstFPR() const { return VarArgsFirstFPR; }
52 void setVarArgsFirstFPR(unsigned FPR) { VarArgsFirstFPR = FPR; }
53
54 // Get and set the frame index of the first stack vararg.
55 unsigned getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
56 void setVarArgsFrameIndex(unsigned FI) { VarArgsFrameIndex = FI; }
57
58 // Get and set the frame index of the register save area
59 // (i.e. the incoming stack pointer).
60 unsigned getRegSaveFrameIndex() const { return RegSaveFrameIndex; }
61 void setRegSaveFrameIndex(unsigned FI) { RegSaveFrameIndex = FI; }
62
Ulrich Weigandf557d082016-04-04 12:44:55 +000063 // Get and set the frame index of where the old frame pointer is stored.
64 int getFramePointerSaveIndex() const { return FramePointerSaveIndex; }
65 void setFramePointerSaveIndex(int Idx) { FramePointerSaveIndex = Idx; }
66
Ulrich Weigand5f613df2013-05-06 16:15:19 +000067 // Get and set whether the function directly manipulates the stack pointer,
68 // e.g. through STACKSAVE or STACKRESTORE.
69 bool getManipulatesSP() const { return ManipulatesSP; }
70 void setManipulatesSP(bool MSP) { ManipulatesSP = MSP; }
Ulrich Weigand7db69182015-02-18 09:13:27 +000071
72 // Count number of local-dynamic TLS symbols used.
73 unsigned getNumLocalDynamicTLSAccesses() const { return NumLocalDynamics; }
74 void incNumLocalDynamicTLSAccesses() { ++NumLocalDynamics; }
Ulrich Weigand5f613df2013-05-06 16:15:19 +000075};
76
Richard Sandifordc2312692014-03-06 10:38:30 +000077} // end namespace llvm
Ulrich Weigand5f613df2013-05-06 16:15:19 +000078
79#endif