1//===- LanaiMachineFuctionInfo.h - Lanai machine func info -------*- C++ -*-==//
2//
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
6//
7//===----------------------------------------------------------------------===//
8//
9// This file declares Lanai-specific per-machine-function information.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_LIB_TARGET_LANAI_LANAIMACHINEFUNCTIONINFO_H
14#define LLVM_LIB_TARGET_LANAI_LANAIMACHINEFUNCTIONINFO_H
15
16#include "LanaiRegisterInfo.h"
17#include "llvm/CodeGen/MachineFunction.h"
18#include "llvm/CodeGen/MachineRegisterInfo.h"
19
20namespace llvm {
21
22// LanaiMachineFunctionInfo - This class is derived from MachineFunction and
23// contains private Lanai target-specific information for each MachineFunction.
24class LanaiMachineFunctionInfo : public MachineFunctionInfo {
25 virtual void anchor();
26
27 // SRetReturnReg - Lanai ABI require that sret lowering includes
28 // returning the value of the returned struct in a register. This field
29 // holds the virtual register into which the sret argument is passed.
30 Register SRetReturnReg;
31
32 // VarArgsFrameIndex - FrameIndex for start of varargs area.
33 int VarArgsFrameIndex;
34
35public:
36 LanaiMachineFunctionInfo(const Function &F, const TargetSubtargetInfo *STI)
37 : VarArgsFrameIndex(0) {}
38 MachineFunctionInfo *
39 clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
40 const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
41 const override;
42
43 Register getSRetReturnReg() const { return SRetReturnReg; }
44 void setSRetReturnReg(Register Reg) { SRetReturnReg = Reg; }
45
46 int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
47 void setVarArgsFrameIndex(int Index) { VarArgsFrameIndex = Index; }
48};
49
50} // namespace llvm
51
52#endif // LLVM_LIB_TARGET_LANAI_LANAIMACHINEFUNCTIONINFO_H
53