Chris Lattner | 7ff4a94 | 2009-09-15 18:03:13 +0000 | [diff] [blame] | 1 | //===- SparcMachineFunctionInfo.h - Sparc Machine Function Info -*- C++ -*-===// |
| 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Chris Lattner | 7ff4a94 | 2009-09-15 18:03:13 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // This file declares Sparc specific per-machine-function information. |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 12 | #ifndef LLVM_LIB_TARGET_SPARC_SPARCMACHINEFUNCTIONINFO_H |
| 13 | #define LLVM_LIB_TARGET_SPARC_SPARCMACHINEFUNCTIONINFO_H |
Chris Lattner | 7ff4a94 | 2009-09-15 18:03:13 +0000 | [diff] [blame] | 14 | |
| 15 | #include "llvm/CodeGen/MachineFunction.h" |
| 16 | |
| 17 | namespace llvm { |
| 18 | |
| 19 | class SparcMachineFunctionInfo : public MachineFunctionInfo { |
David Blaikie | a379b181 | 2011-12-20 02:50:00 +0000 | [diff] [blame] | 20 | virtual void anchor(); |
Chris Lattner | 7ff4a94 | 2009-09-15 18:03:13 +0000 | [diff] [blame] | 21 | private: |
| 22 | unsigned GlobalBaseReg; |
Dan Gohman | 31ae586 | 2010-04-17 14:41:14 +0000 | [diff] [blame] | 23 | |
| 24 | /// VarArgsFrameOffset - Frame offset to start of varargs area. |
| 25 | int VarArgsFrameOffset; |
| 26 | |
Venkatraman Govindaraju | cc91b7a | 2011-01-22 13:05:16 +0000 | [diff] [blame] | 27 | /// SRetReturnReg - Holds the virtual register into which the sret |
| 28 | /// argument is passed. |
| 29 | unsigned SRetReturnReg; |
Venkatraman Govindaraju | ca0fe2f5 | 2013-05-29 04:46:31 +0000 | [diff] [blame] | 30 | |
| 31 | /// IsLeafProc - True if the function is a leaf procedure. |
| 32 | bool IsLeafProc; |
Chris Lattner | 7ff4a94 | 2009-09-15 18:03:13 +0000 | [diff] [blame] | 33 | public: |
Venkatraman Govindaraju | cc91b7a | 2011-01-22 13:05:16 +0000 | [diff] [blame] | 34 | SparcMachineFunctionInfo() |
Venkatraman Govindaraju | ca0fe2f5 | 2013-05-29 04:46:31 +0000 | [diff] [blame] | 35 | : GlobalBaseReg(0), VarArgsFrameOffset(0), SRetReturnReg(0), |
| 36 | IsLeafProc(false) {} |
Dan Gohman | 31ae586 | 2010-04-17 14:41:14 +0000 | [diff] [blame] | 37 | explicit SparcMachineFunctionInfo(MachineFunction &MF) |
Venkatraman Govindaraju | ca0fe2f5 | 2013-05-29 04:46:31 +0000 | [diff] [blame] | 38 | : GlobalBaseReg(0), VarArgsFrameOffset(0), SRetReturnReg(0), |
| 39 | IsLeafProc(false) {} |
Chris Lattner | 7ff4a94 | 2009-09-15 18:03:13 +0000 | [diff] [blame] | 40 | |
| 41 | unsigned getGlobalBaseReg() const { return GlobalBaseReg; } |
| 42 | void setGlobalBaseReg(unsigned Reg) { GlobalBaseReg = Reg; } |
Dan Gohman | 31ae586 | 2010-04-17 14:41:14 +0000 | [diff] [blame] | 43 | |
| 44 | int getVarArgsFrameOffset() const { return VarArgsFrameOffset; } |
| 45 | void setVarArgsFrameOffset(int Offset) { VarArgsFrameOffset = Offset; } |
Venkatraman Govindaraju | cc91b7a | 2011-01-22 13:05:16 +0000 | [diff] [blame] | 46 | |
| 47 | unsigned getSRetReturnReg() const { return SRetReturnReg; } |
| 48 | void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; } |
Venkatraman Govindaraju | ca0fe2f5 | 2013-05-29 04:46:31 +0000 | [diff] [blame] | 49 | |
| 50 | void setLeafProc(bool rhs) { IsLeafProc = rhs; } |
| 51 | bool isLeafProc() const { return IsLeafProc; } |
Chris Lattner | 7ff4a94 | 2009-09-15 18:03:13 +0000 | [diff] [blame] | 52 | }; |
Alexander Kornienko | f00654e | 2015-06-23 09:49:53 +0000 | [diff] [blame] | 53 | } |
Chris Lattner | 7ff4a94 | 2009-09-15 18:03:13 +0000 | [diff] [blame] | 54 | |
| 55 | #endif |