Dan Gohman | 9911405 | 2009-06-03 20:30:14 +0000 | [diff] [blame] | 1 | //====- AlphaMachineFuctionInfo.h - Alpha 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 | // This file declares Alpha-specific per-machine-function information. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef ALPHAMACHINEFUNCTIONINFO_H |
| 15 | #define ALPHAMACHINEFUNCTIONINFO_H |
| 16 | |
| 17 | #include "llvm/CodeGen/MachineFunction.h" |
| 18 | |
| 19 | namespace llvm { |
| 20 | |
| 21 | /// AlphaMachineFunctionInfo - This class is derived from MachineFunction |
| 22 | /// private Alpha target-specific information for each MachineFunction. |
| 23 | class AlphaMachineFunctionInfo : public MachineFunctionInfo { |
| 24 | /// GlobalBaseReg - keeps track of the virtual register initialized for |
| 25 | /// use as the global base register. This is used for PIC in some PIC |
| 26 | /// relocation models. |
| 27 | unsigned GlobalBaseReg; |
| 28 | |
| 29 | /// GlobalRetAddr = keeps track of the virtual register initialized for |
| 30 | /// the return address value. |
| 31 | unsigned GlobalRetAddr; |
| 32 | |
Dan Gohman | 1e93df6 | 2010-04-17 14:41:14 +0000 | [diff] [blame] | 33 | /// VarArgsOffset - What is the offset to the first vaarg |
| 34 | int VarArgsOffset; |
| 35 | /// VarArgsBase - What is the base FrameIndex |
| 36 | int VarArgsBase; |
| 37 | |
Dan Gohman | 9911405 | 2009-06-03 20:30:14 +0000 | [diff] [blame] | 38 | public: |
Dan Gohman | 1e93df6 | 2010-04-17 14:41:14 +0000 | [diff] [blame] | 39 | AlphaMachineFunctionInfo() : GlobalBaseReg(0), GlobalRetAddr(0), |
| 40 | VarArgsOffset(0), VarArgsBase(0) {} |
Dan Gohman | 9911405 | 2009-06-03 20:30:14 +0000 | [diff] [blame] | 41 | |
Dan Gohman | 2392efe | 2009-06-05 23:05:51 +0000 | [diff] [blame] | 42 | explicit AlphaMachineFunctionInfo(MachineFunction &MF) : GlobalBaseReg(0), |
Dan Gohman | 1e93df6 | 2010-04-17 14:41:14 +0000 | [diff] [blame] | 43 | GlobalRetAddr(0), |
| 44 | VarArgsOffset(0), |
| 45 | VarArgsBase(0) {} |
Dan Gohman | 9911405 | 2009-06-03 20:30:14 +0000 | [diff] [blame] | 46 | |
| 47 | unsigned getGlobalBaseReg() const { return GlobalBaseReg; } |
| 48 | void setGlobalBaseReg(unsigned Reg) { GlobalBaseReg = Reg; } |
| 49 | |
| 50 | unsigned getGlobalRetAddr() const { return GlobalRetAddr; } |
| 51 | void setGlobalRetAddr(unsigned Reg) { GlobalRetAddr = Reg; } |
Dan Gohman | 1e93df6 | 2010-04-17 14:41:14 +0000 | [diff] [blame] | 52 | |
| 53 | int getVarArgsOffset() const { return VarArgsOffset; } |
| 54 | void setVarArgsOffset(int Offset) { VarArgsOffset = Offset; } |
| 55 | |
| 56 | int getVarArgsBase() const { return VarArgsBase; } |
| 57 | void setVarArgsBase(int Base) { VarArgsBase = Base; } |
Dan Gohman | 9911405 | 2009-06-03 20:30:14 +0000 | [diff] [blame] | 58 | }; |
| 59 | |
| 60 | } // End llvm namespace |
| 61 | |
| 62 | #endif |