xref: /aosp_15_r20/external/llvm/lib/Target/MSP430/MSP430MachineFunctionInfo.h (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker //=== MSP430MachineFunctionInfo.h - MSP430 machine function info -*- C++ -*-==//
2*9880d681SAndroid Build Coastguard Worker //
3*9880d681SAndroid Build Coastguard Worker //                     The LLVM Compiler Infrastructure
4*9880d681SAndroid Build Coastguard Worker //
5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source
6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details.
7*9880d681SAndroid Build Coastguard Worker //
8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*9880d681SAndroid Build Coastguard Worker //
10*9880d681SAndroid Build Coastguard Worker // This file declares MSP430-specific per-machine-function information.
11*9880d681SAndroid Build Coastguard Worker //
12*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
13*9880d681SAndroid Build Coastguard Worker 
14*9880d681SAndroid Build Coastguard Worker #ifndef LLVM_LIB_TARGET_MSP430_MSP430MACHINEFUNCTIONINFO_H
15*9880d681SAndroid Build Coastguard Worker #define LLVM_LIB_TARGET_MSP430_MSP430MACHINEFUNCTIONINFO_H
16*9880d681SAndroid Build Coastguard Worker 
17*9880d681SAndroid Build Coastguard Worker #include "llvm/CodeGen/MachineFunction.h"
18*9880d681SAndroid Build Coastguard Worker 
19*9880d681SAndroid Build Coastguard Worker namespace llvm {
20*9880d681SAndroid Build Coastguard Worker 
21*9880d681SAndroid Build Coastguard Worker /// MSP430MachineFunctionInfo - This class is derived from MachineFunction and
22*9880d681SAndroid Build Coastguard Worker /// contains private MSP430 target-specific information for each MachineFunction.
23*9880d681SAndroid Build Coastguard Worker class MSP430MachineFunctionInfo : public MachineFunctionInfo {
24*9880d681SAndroid Build Coastguard Worker   virtual void anchor();
25*9880d681SAndroid Build Coastguard Worker 
26*9880d681SAndroid Build Coastguard Worker   /// CalleeSavedFrameSize - Size of the callee-saved register portion of the
27*9880d681SAndroid Build Coastguard Worker   /// stack frame in bytes.
28*9880d681SAndroid Build Coastguard Worker   unsigned CalleeSavedFrameSize;
29*9880d681SAndroid Build Coastguard Worker 
30*9880d681SAndroid Build Coastguard Worker   /// ReturnAddrIndex - FrameIndex for return slot.
31*9880d681SAndroid Build Coastguard Worker   int ReturnAddrIndex;
32*9880d681SAndroid Build Coastguard Worker 
33*9880d681SAndroid Build Coastguard Worker   /// VarArgsFrameIndex - FrameIndex for start of varargs area.
34*9880d681SAndroid Build Coastguard Worker   int VarArgsFrameIndex;
35*9880d681SAndroid Build Coastguard Worker 
36*9880d681SAndroid Build Coastguard Worker public:
MSP430MachineFunctionInfo()37*9880d681SAndroid Build Coastguard Worker   MSP430MachineFunctionInfo() : CalleeSavedFrameSize(0) {}
38*9880d681SAndroid Build Coastguard Worker 
MSP430MachineFunctionInfo(MachineFunction & MF)39*9880d681SAndroid Build Coastguard Worker   explicit MSP430MachineFunctionInfo(MachineFunction &MF)
40*9880d681SAndroid Build Coastguard Worker     : CalleeSavedFrameSize(0), ReturnAddrIndex(0) {}
41*9880d681SAndroid Build Coastguard Worker 
getCalleeSavedFrameSize()42*9880d681SAndroid Build Coastguard Worker   unsigned getCalleeSavedFrameSize() const { return CalleeSavedFrameSize; }
setCalleeSavedFrameSize(unsigned bytes)43*9880d681SAndroid Build Coastguard Worker   void setCalleeSavedFrameSize(unsigned bytes) { CalleeSavedFrameSize = bytes; }
44*9880d681SAndroid Build Coastguard Worker 
getRAIndex()45*9880d681SAndroid Build Coastguard Worker   int getRAIndex() const { return ReturnAddrIndex; }
setRAIndex(int Index)46*9880d681SAndroid Build Coastguard Worker   void setRAIndex(int Index) { ReturnAddrIndex = Index; }
47*9880d681SAndroid Build Coastguard Worker 
getVarArgsFrameIndex()48*9880d681SAndroid Build Coastguard Worker   int getVarArgsFrameIndex() const { return VarArgsFrameIndex;}
setVarArgsFrameIndex(int Index)49*9880d681SAndroid Build Coastguard Worker   void setVarArgsFrameIndex(int Index) { VarArgsFrameIndex = Index; }
50*9880d681SAndroid Build Coastguard Worker };
51*9880d681SAndroid Build Coastguard Worker 
52*9880d681SAndroid Build Coastguard Worker } // End llvm namespace
53*9880d681SAndroid Build Coastguard Worker 
54*9880d681SAndroid Build Coastguard Worker #endif
55