LLVM  8.0.1
RISCVMachineFunctionInfo.h
Go to the documentation of this file.
1 //=- RISCVMachineFunctionInfo.h - RISCV 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 RISCV-specific per-machine-function information.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_RISCV_RISCVMACHINEFUNCTIONINFO_H
15 #define LLVM_LIB_TARGET_RISCV_RISCVMACHINEFUNCTIONINFO_H
16 
19 
20 namespace llvm {
21 
22 /// RISCVMachineFunctionInfo - This class is derived from MachineFunctionInfo
23 /// and contains private RISCV-specific information for each MachineFunction.
25 private:
26  MachineFunction &MF;
27  /// FrameIndex for start of varargs area
28  int VarArgsFrameIndex = 0;
29  /// Size of the save area used for varargs
30  int VarArgsSaveSize = 0;
31  /// FrameIndex used for transferring values between 64-bit FPRs and a pair
32  /// of 32-bit GPRs via the stack.
33  int MoveF64FrameIndex = -1;
34 
35 public:
36  // RISCVMachineFunctionInfo() = default;
37 
39 
40  int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
41  void setVarArgsFrameIndex(int Index) { VarArgsFrameIndex = Index; }
42 
43  unsigned getVarArgsSaveSize() const { return VarArgsSaveSize; }
44  void setVarArgsSaveSize(int Size) { VarArgsSaveSize = Size; }
45 
47  if (MoveF64FrameIndex == -1)
48  MoveF64FrameIndex = MF.getFrameInfo().CreateStackObject(8, 8, false);
49  return MoveF64FrameIndex;
50  }
51 };
52 
53 } // end namespace llvm
54 
55 #endif // LLVM_LIB_TARGET_RISCV_RISCVMACHINEFUNCTIONINFO_H
This class represents lattice values for constants.
Definition: AllocatorList.h:24
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:47
RISCVMachineFunctionInfo - This class is derived from MachineFunctionInfo and contains private RISCV-...