Path: blob/main/contrib/llvm-project/llvm/lib/Target/M68k/M68kMachineFunction.h
35269 views
//===-- M68kMachineFunctionInfo.h - M68k private data -----------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7///8/// \file9/// This file declares the M68k specific subclass of MachineFunctionInfo.10///11//===----------------------------------------------------------------------===//1213#ifndef LLVM_LIB_TARGET_M68K_M68KMACHINEFUNCTION_H14#define LLVM_LIB_TARGET_M68K_M68KMACHINEFUNCTION_H1516#include "llvm/CodeGen/CallingConvLower.h"17#include "llvm/CodeGen/MachineFunction.h"18#include "llvm/CodeGenTypes/MachineValueType.h"1920namespace llvm {2122class M68kMachineFunctionInfo : public MachineFunctionInfo {23/// Non-zero if the function has base pointer and makes call to24/// llvm.eh.sjlj.setjmp. When non-zero, the value is a displacement from the25/// frame pointer to a slot where the base pointer is stashed.26signed char RestoreBasePointerOffset = 0;2728/// Size of the callee-saved register portion of the stack frame in bytes.29unsigned CalleeSavedFrameSize = 0;3031/// Number of bytes function pops on return (in addition to the space used by32/// the return address). Used on windows platform for stdcall & fastcall33/// name decoration34unsigned BytesToPopOnReturn = 0;3536/// FrameIndex for return slot.37int ReturnAddrIndex = 0;3839/// The number of bytes by which return address stack slot is moved as the40/// result of tail call optimization.41int TailCallReturnAddrDelta = 0;4243/// keeps track of the virtual register initialized for use as the global44/// base register. This is used for PIC in some PIC relocation models.45unsigned GlobalBaseReg = 0;4647/// FrameIndex for start of varargs area.48int VarArgsFrameIndex = 0;4950/// Keeps track of whether this function uses sequences of pushes to pass51/// function parameters.52bool HasPushSequences = false;5354/// Some subtargets require that sret lowering includes55/// returning the value of the returned struct in a register. This field56/// holds the virtual register into which the sret argument is passed.57unsigned SRetReturnReg = 0;5859/// A list of virtual and physical registers that must be forwarded to every60/// musttail call.61SmallVector<ForwardedRegister, 1> ForwardedMustTailRegParms;6263/// The number of bytes on stack consumed by the arguments being passed on64/// the stack.65unsigned ArgumentStackSize = 0;6667public:68explicit M68kMachineFunctionInfo(const Function &F,69const TargetSubtargetInfo *STI) {}7071MachineFunctionInfo *72clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,73const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)74const override;7576bool getRestoreBasePointer() const { return RestoreBasePointerOffset != 0; }77void setRestoreBasePointer(const MachineFunction *MF);78int getRestoreBasePointerOffset() const { return RestoreBasePointerOffset; }7980unsigned getCalleeSavedFrameSize() const { return CalleeSavedFrameSize; }81void setCalleeSavedFrameSize(unsigned bytes) { CalleeSavedFrameSize = bytes; }8283unsigned getBytesToPopOnReturn() const { return BytesToPopOnReturn; }84void setBytesToPopOnReturn(unsigned bytes) { BytesToPopOnReturn = bytes; }8586int getRAIndex() const { return ReturnAddrIndex; }87void setRAIndex(int Index) { ReturnAddrIndex = Index; }8889int getTCReturnAddrDelta() const { return TailCallReturnAddrDelta; }90void setTCReturnAddrDelta(int delta) { TailCallReturnAddrDelta = delta; }9192unsigned getGlobalBaseReg() const { return GlobalBaseReg; }93void setGlobalBaseReg(unsigned Reg) { GlobalBaseReg = Reg; }9495int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }96void setVarArgsFrameIndex(int Index) { VarArgsFrameIndex = Index; }9798bool getHasPushSequences() const { return HasPushSequences; }99void setHasPushSequences(bool HasPush) { HasPushSequences = HasPush; }100101unsigned getSRetReturnReg() const { return SRetReturnReg; }102void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; }103104unsigned getArgumentStackSize() const { return ArgumentStackSize; }105void setArgumentStackSize(unsigned size) { ArgumentStackSize = size; }106107SmallVectorImpl<ForwardedRegister> &getForwardedMustTailRegParms() {108return ForwardedMustTailRegParms;109}110111private:112virtual void anchor();113};114115} // end of namespace llvm116117#endif // LLVM_LIB_TARGET_M68K_M68KMACHINEFUNCTION_H118119120