Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 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 | |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 10 | #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZMACHINEFUNCTIONINFO_H |
| 11 | #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZMACHINEFUNCTIONINFO_H |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 12 | |
| 13 | #include "llvm/CodeGen/MachineFunction.h" |
| 14 | |
| 15 | namespace llvm { |
| 16 | |
| 17 | class SystemZMachineFunctionInfo : public MachineFunctionInfo { |
Juergen Ributzka | d12ccbd | 2013-11-19 00:57:56 +0000 | [diff] [blame] | 18 | virtual void anchor(); |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 19 | unsigned LowSavedGPR; |
| 20 | unsigned HighSavedGPR; |
| 21 | unsigned VarArgsFirstGPR; |
| 22 | unsigned VarArgsFirstFPR; |
| 23 | unsigned VarArgsFrameIndex; |
| 24 | unsigned RegSaveFrameIndex; |
| 25 | bool ManipulatesSP; |
Ulrich Weigand | 7db6918 | 2015-02-18 09:13:27 +0000 | [diff] [blame^] | 26 | unsigned NumLocalDynamics; |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 27 | |
| 28 | public: |
| 29 | explicit SystemZMachineFunctionInfo(MachineFunction &MF) |
Richard Sandiford | db39b4a | 2013-07-03 09:11:00 +0000 | [diff] [blame] | 30 | : LowSavedGPR(0), HighSavedGPR(0), VarArgsFirstGPR(0), VarArgsFirstFPR(0), |
Ulrich Weigand | 7db6918 | 2015-02-18 09:13:27 +0000 | [diff] [blame^] | 31 | VarArgsFrameIndex(0), RegSaveFrameIndex(0), ManipulatesSP(false), |
| 32 | NumLocalDynamics(0) {} |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 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. |
| 36 | unsigned getLowSavedGPR() const { return LowSavedGPR; } |
| 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. |
| 41 | unsigned getHighSavedGPR() const { return HighSavedGPR; } |
| 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. |
| 46 | unsigned getVarArgsFirstGPR() const { return VarArgsFirstGPR; } |
| 47 | void setVarArgsFirstGPR(unsigned GPR) { VarArgsFirstGPR = GPR; } |
| 48 | |
| 49 | // Likewise FPRs. |
| 50 | unsigned getVarArgsFirstFPR() const { return VarArgsFirstFPR; } |
| 51 | void setVarArgsFirstFPR(unsigned FPR) { VarArgsFirstFPR = FPR; } |
| 52 | |
| 53 | // Get and set the frame index of the first stack vararg. |
| 54 | unsigned getVarArgsFrameIndex() const { return VarArgsFrameIndex; } |
| 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). |
| 59 | unsigned getRegSaveFrameIndex() const { return RegSaveFrameIndex; } |
| 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. |
| 64 | bool getManipulatesSP() const { return ManipulatesSP; } |
| 65 | void setManipulatesSP(bool MSP) { ManipulatesSP = MSP; } |
Ulrich Weigand | 7db6918 | 2015-02-18 09:13:27 +0000 | [diff] [blame^] | 66 | |
| 67 | // Count number of local-dynamic TLS symbols used. |
| 68 | unsigned getNumLocalDynamicTLSAccesses() const { return NumLocalDynamics; } |
| 69 | void incNumLocalDynamicTLSAccesses() { ++NumLocalDynamics; } |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 70 | }; |
| 71 | |
Richard Sandiford | c231269 | 2014-03-06 10:38:30 +0000 | [diff] [blame] | 72 | } // end namespace llvm |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 73 | |
| 74 | #endif |