LLVM  14.0.0git
M68kMachineFunction.h
Go to the documentation of this file.
1 //===-- M68kMachineFunctionInfo.h - M68k private data ---------*- 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 /// \file
10 /// This file declares the M68k specific subclass of MachineFunctionInfo.
11 ///
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_M68K_M68KMACHINEFUNCTION_H
15 #define LLVM_LIB_TARGET_M68K_M68KMACHINEFUNCTION_H
16 
20 
21 namespace llvm {
22 
24  MachineFunction &MF;
25 
26  /// Non-zero if the function has base pointer and makes call to
27  /// llvm.eh.sjlj.setjmp. When non-zero, the value is a displacement from the
28  /// frame pointer to a slot where the base pointer is stashed.
29  signed char RestoreBasePointerOffset = 0;
30 
31  /// Size of the callee-saved register portion of the stack frame in bytes.
32  unsigned CalleeSavedFrameSize = 0;
33 
34  /// Number of bytes function pops on return (in addition to the space used by
35  /// the return address). Used on windows platform for stdcall & fastcall
36  /// name decoration
37  unsigned BytesToPopOnReturn = 0;
38 
39  /// FrameIndex for return slot.
40  int ReturnAddrIndex = 0;
41 
42  /// The number of bytes by which return address stack slot is moved as the
43  /// result of tail call optimization.
44  int TailCallReturnAddrDelta = 0;
45 
46  /// keeps track of the virtual register initialized for use as the global
47  /// base register. This is used for PIC in some PIC relocation models.
48  unsigned GlobalBaseReg = 0;
49 
50  /// FrameIndex for start of varargs area.
51  int VarArgsFrameIndex = 0;
52 
53  /// Keeps track of whether this function uses sequences of pushes to pass
54  /// function parameters.
55  bool HasPushSequences = false;
56 
57  /// Some subtargets require that sret lowering includes
58  /// returning the value of the returned struct in a register. This field
59  /// holds the virtual register into which the sret argument is passed.
60  unsigned SRetReturnReg = 0;
61 
62  /// A list of virtual and physical registers that must be forwarded to every
63  /// musttail call.
64  SmallVector<ForwardedRegister, 1> ForwardedMustTailRegParms;
65 
66  /// The number of bytes on stack consumed by the arguments being passed on
67  /// the stack.
68  unsigned ArgumentStackSize = 0;
69 
70 public:
71  explicit M68kMachineFunctionInfo(MachineFunction &MF) : MF(MF) {}
72 
73  bool getRestoreBasePointer() const { return RestoreBasePointerOffset != 0; }
74  void setRestoreBasePointer(const MachineFunction *MF);
75  int getRestoreBasePointerOffset() const { return RestoreBasePointerOffset; }
76 
77  unsigned getCalleeSavedFrameSize() const { return CalleeSavedFrameSize; }
78  void setCalleeSavedFrameSize(unsigned bytes) { CalleeSavedFrameSize = bytes; }
79 
80  unsigned getBytesToPopOnReturn() const { return BytesToPopOnReturn; }
81  void setBytesToPopOnReturn(unsigned bytes) { BytesToPopOnReturn = bytes; }
82 
83  int getRAIndex() const { return ReturnAddrIndex; }
84  void setRAIndex(int Index) { ReturnAddrIndex = Index; }
85 
86  int getTCReturnAddrDelta() const { return TailCallReturnAddrDelta; }
87  void setTCReturnAddrDelta(int delta) { TailCallReturnAddrDelta = delta; }
88 
89  unsigned getGlobalBaseReg() const { return GlobalBaseReg; }
90  void setGlobalBaseReg(unsigned Reg) { GlobalBaseReg = Reg; }
91 
92  int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
93  void setVarArgsFrameIndex(int Index) { VarArgsFrameIndex = Index; }
94 
95  bool getHasPushSequences() const { return HasPushSequences; }
96  void setHasPushSequences(bool HasPush) { HasPushSequences = HasPush; }
97 
98  unsigned getSRetReturnReg() const { return SRetReturnReg; }
99  void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; }
100 
101  unsigned getArgumentStackSize() const { return ArgumentStackSize; }
102  void setArgumentStackSize(unsigned size) { ArgumentStackSize = size; }
103 
105  return ForwardedMustTailRegParms;
106  }
107 
108 private:
109  virtual void anchor();
110 };
111 
112 } // end of namespace llvm
113 
114 #endif // M68K_MACHINE_FUNCTION_INFO_H
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::M68kMachineFunctionInfo::setArgumentStackSize
void setArgumentStackSize(unsigned size)
Definition: M68kMachineFunction.h:102
Reg
unsigned Reg
Definition: MachineSink.cpp:1566
llvm::M68kMachineFunctionInfo::getHasPushSequences
bool getHasPushSequences() const
Definition: M68kMachineFunction.h:95
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1168
llvm::M68kMachineFunctionInfo::getTCReturnAddrDelta
int getTCReturnAddrDelta() const
Definition: M68kMachineFunction.h:86
llvm::M68kMachineFunctionInfo::getRestoreBasePointerOffset
int getRestoreBasePointerOffset() const
Definition: M68kMachineFunction.h:75
llvm::M68kMachineFunctionInfo::getArgumentStackSize
unsigned getArgumentStackSize() const
Definition: M68kMachineFunction.h:101
llvm::M68kMachineFunctionInfo::getForwardedMustTailRegParms
SmallVectorImpl< ForwardedRegister > & getForwardedMustTailRegParms()
Definition: M68kMachineFunction.h:104
MachineValueType.h
llvm::M68kMachineFunctionInfo::setSRetReturnReg
void setSRetReturnReg(unsigned Reg)
Definition: M68kMachineFunction.h:99
llvm::M68kMachineFunctionInfo::setTCReturnAddrDelta
void setTCReturnAddrDelta(int delta)
Definition: M68kMachineFunction.h:87
llvm::M68kMachineFunctionInfo::getSRetReturnReg
unsigned getSRetReturnReg() const
Definition: M68kMachineFunction.h:98
llvm::M68kMachineFunctionInfo::getCalleeSavedFrameSize
unsigned getCalleeSavedFrameSize() const
Definition: M68kMachineFunction.h:77
llvm::M68kMachineFunctionInfo::setGlobalBaseReg
void setGlobalBaseReg(unsigned Reg)
Definition: M68kMachineFunction.h:90
Index
uint32_t Index
Definition: ELFObjHandler.cpp:84
llvm::M68kMachineFunctionInfo::getRAIndex
int getRAIndex() const
Definition: M68kMachineFunction.h:83
llvm::M68kMachineFunctionInfo::setHasPushSequences
void setHasPushSequences(bool HasPush)
Definition: M68kMachineFunction.h:96
llvm::MachineFunction
Definition: MachineFunction.h:230
llvm::size
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
Definition: STLExtras.h:1528
llvm::M68kMachineFunctionInfo::setVarArgsFrameIndex
void setVarArgsFrameIndex(int Index)
Definition: M68kMachineFunction.h:93
llvm::M68kMachineFunctionInfo::M68kMachineFunctionInfo
M68kMachineFunctionInfo(MachineFunction &MF)
Definition: M68kMachineFunction.h:71
llvm::M68kMachineFunctionInfo::getRestoreBasePointer
bool getRestoreBasePointer() const
Definition: M68kMachineFunction.h:73
llvm::M68kMachineFunctionInfo
Definition: M68kMachineFunction.h:23
llvm::M68kMachineFunctionInfo::setBytesToPopOnReturn
void setBytesToPopOnReturn(unsigned bytes)
Definition: M68kMachineFunction.h:81
llvm::M68kMachineFunctionInfo::setCalleeSavedFrameSize
void setCalleeSavedFrameSize(unsigned bytes)
Definition: M68kMachineFunction.h:78
CallingConvLower.h
llvm::M68kMachineFunctionInfo::setRAIndex
void setRAIndex(int Index)
Definition: M68kMachineFunction.h:84
llvm::M68kMachineFunctionInfo::getBytesToPopOnReturn
unsigned getBytesToPopOnReturn() const
Definition: M68kMachineFunction.h:80
llvm::M68kMachineFunctionInfo::setRestoreBasePointer
void setRestoreBasePointer(const MachineFunction *MF)
llvm::M68kMachineFunctionInfo::getGlobalBaseReg
unsigned getGlobalBaseReg() const
Definition: M68kMachineFunction.h:89
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:43
llvm::M68kMachineFunctionInfo::getVarArgsFrameIndex
int getVarArgsFrameIndex() const
Definition: M68kMachineFunction.h:92
MachineFunction.h
llvm::MachineFunctionInfo
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
Definition: MachineFunction.h:95