xref: /freebsd/contrib/llvm-project/llvm/lib/Target/MSP430/MSP430MachineFunctionInfo.h (revision 480093f4440d54b30b3025afeac24b48f2ba7a2e)
10b57cec5SDimitry Andric //=== MSP430MachineFunctionInfo.h - MSP430 machine function info -*- C++ -*-==//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric //
90b57cec5SDimitry Andric // This file declares MSP430-specific per-machine-function information.
100b57cec5SDimitry Andric //
110b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
120b57cec5SDimitry Andric 
130b57cec5SDimitry Andric #ifndef LLVM_LIB_TARGET_MSP430_MSP430MACHINEFUNCTIONINFO_H
140b57cec5SDimitry Andric #define LLVM_LIB_TARGET_MSP430_MSP430MACHINEFUNCTIONINFO_H
150b57cec5SDimitry Andric 
160b57cec5SDimitry Andric #include "llvm/CodeGen/MachineFunction.h"
170b57cec5SDimitry Andric 
180b57cec5SDimitry Andric namespace llvm {
190b57cec5SDimitry Andric 
200b57cec5SDimitry Andric /// MSP430MachineFunctionInfo - This class is derived from MachineFunction and
210b57cec5SDimitry Andric /// contains private MSP430 target-specific information for each MachineFunction.
220b57cec5SDimitry Andric class MSP430MachineFunctionInfo : public MachineFunctionInfo {
230b57cec5SDimitry Andric   virtual void anchor();
240b57cec5SDimitry Andric 
250b57cec5SDimitry Andric   /// CalleeSavedFrameSize - Size of the callee-saved register portion of the
260b57cec5SDimitry Andric   /// stack frame in bytes.
27*480093f4SDimitry Andric   unsigned CalleeSavedFrameSize = 0;
280b57cec5SDimitry Andric 
290b57cec5SDimitry Andric   /// ReturnAddrIndex - FrameIndex for return slot.
30*480093f4SDimitry Andric   int ReturnAddrIndex = 0;
310b57cec5SDimitry Andric 
320b57cec5SDimitry Andric   /// VarArgsFrameIndex - FrameIndex for start of varargs area.
33*480093f4SDimitry Andric   int VarArgsFrameIndex = 0;
340b57cec5SDimitry Andric 
350b57cec5SDimitry Andric   /// SRetReturnReg - Some subtargets require that sret lowering includes
360b57cec5SDimitry Andric   /// returning the value of the returned struct in a register. This field
370b57cec5SDimitry Andric   /// holds the virtual register into which the sret argument is passed.
38*480093f4SDimitry Andric   unsigned SRetReturnReg = 0;
390b57cec5SDimitry Andric 
400b57cec5SDimitry Andric public:
41*480093f4SDimitry Andric   MSP430MachineFunctionInfo() = default;
420b57cec5SDimitry Andric 
430b57cec5SDimitry Andric   explicit MSP430MachineFunctionInfo(MachineFunction &MF)
440b57cec5SDimitry Andric     : CalleeSavedFrameSize(0), ReturnAddrIndex(0), SRetReturnReg(0) {}
450b57cec5SDimitry Andric 
460b57cec5SDimitry Andric   unsigned getCalleeSavedFrameSize() const { return CalleeSavedFrameSize; }
470b57cec5SDimitry Andric   void setCalleeSavedFrameSize(unsigned bytes) { CalleeSavedFrameSize = bytes; }
480b57cec5SDimitry Andric 
490b57cec5SDimitry Andric   unsigned getSRetReturnReg() const { return SRetReturnReg; }
500b57cec5SDimitry Andric   void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; }
510b57cec5SDimitry Andric 
520b57cec5SDimitry Andric   int getRAIndex() const { return ReturnAddrIndex; }
530b57cec5SDimitry Andric   void setRAIndex(int Index) { ReturnAddrIndex = Index; }
540b57cec5SDimitry Andric 
550b57cec5SDimitry Andric   int getVarArgsFrameIndex() const { return VarArgsFrameIndex;}
560b57cec5SDimitry Andric   void setVarArgsFrameIndex(int Index) { VarArgsFrameIndex = Index; }
570b57cec5SDimitry Andric };
580b57cec5SDimitry Andric 
590b57cec5SDimitry Andric } // End llvm namespace
600b57cec5SDimitry Andric 
610b57cec5SDimitry Andric #endif
62