Path: blob/main/contrib/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.h
35266 views
//===-- SparcFrameLowering.h - Define frame lowering for Sparc --*- 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//9//10//===----------------------------------------------------------------------===//1112#ifndef LLVM_LIB_TARGET_SPARC_SPARCFRAMELOWERING_H13#define LLVM_LIB_TARGET_SPARC_SPARCFRAMELOWERING_H1415#include "Sparc.h"16#include "llvm/CodeGen/TargetFrameLowering.h"17#include "llvm/Support/TypeSize.h"1819namespace llvm {2021class SparcSubtarget;22class SparcFrameLowering : public TargetFrameLowering {23public:24explicit SparcFrameLowering(const SparcSubtarget &ST);2526/// emitProlog/emitEpilog - These methods insert prolog and epilog code into27/// the function.28void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;29void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;3031MachineBasicBlock::iterator32eliminateCallFramePseudoInstr(MachineFunction &MF,33MachineBasicBlock &MBB,34MachineBasicBlock::iterator I) const override;3536bool hasReservedCallFrame(const MachineFunction &MF) const override;37bool hasFP(const MachineFunction &MF) const override;38void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,39RegScavenger *RS = nullptr) const override;4041StackOffset getFrameIndexReference(const MachineFunction &MF, int FI,42Register &FrameReg) const override;4344/// targetHandlesStackFrameRounding - Returns true if the target is45/// responsible for rounding up the stack frame (probably at emitPrologue46/// time).47bool targetHandlesStackFrameRounding() const override { return true; }4849private:50// Remap input registers to output registers for leaf procedure.51void remapRegsForLeafProc(MachineFunction &MF) const;5253// Returns true if MF is a leaf procedure.54bool isLeafProc(MachineFunction &MF) const;555657// Emits code for adjusting SP in function prologue/epilogue.58void emitSPAdjustment(MachineFunction &MF,59MachineBasicBlock &MBB,60MachineBasicBlock::iterator MBBI,61int NumBytes, unsigned ADDrr, unsigned ADDri) const;6263};6465} // End llvm namespace6667#endif686970