LLVM  9.0.0svn
RISCVMachineFunctionInfo.h
Go to the documentation of this file.
1 //=- RISCVMachineFunctionInfo.h - RISCV machine function 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 RISCV-specific per-machine-function information.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_RISCV_RISCVMACHINEFUNCTIONINFO_H
14 #define LLVM_LIB_TARGET_RISCV_RISCVMACHINEFUNCTIONINFO_H
15 
18 
19 namespace llvm {
20 
21 /// RISCVMachineFunctionInfo - This class is derived from MachineFunctionInfo
22 /// and contains private RISCV-specific information for each MachineFunction.
24 private:
25  MachineFunction &MF;
26  /// FrameIndex for start of varargs area
27  int VarArgsFrameIndex = 0;
28  /// Size of the save area used for varargs
29  int VarArgsSaveSize = 0;
30  /// FrameIndex used for transferring values between 64-bit FPRs and a pair
31  /// of 32-bit GPRs via the stack.
32  int MoveF64FrameIndex = -1;
33 
34 public:
35  // RISCVMachineFunctionInfo() = default;
36 
38 
39  int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
40  void setVarArgsFrameIndex(int Index) { VarArgsFrameIndex = Index; }
41 
42  unsigned getVarArgsSaveSize() const { return VarArgsSaveSize; }
43  void setVarArgsSaveSize(int Size) { VarArgsSaveSize = Size; }
44 
46  if (MoveF64FrameIndex == -1)
47  MoveF64FrameIndex = MF.getFrameInfo().CreateStackObject(8, 8, false);
48  return MoveF64FrameIndex;
49  }
50 };
51 
52 } // end namespace llvm
53 
54 #endif // LLVM_LIB_TARGET_RISCV_RISCVMACHINEFUNCTIONINFO_H
This class represents lattice values for constants.
Definition: AllocatorList.h:23
int CreateStackObject(uint64_t Size, unsigned Alignment, bool isSpillSlot, const AllocaInst *Alloca=nullptr, uint8_t ID=0)
Create a new statically sized stack object, returning a nonnegative identifier to represent it...
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
RISCVMachineFunctionInfo(MachineFunction &MF)
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
uint32_t Size
Definition: Profile.cpp:46
RISCVMachineFunctionInfo - This class is derived from MachineFunctionInfo and contains private RISCV-...