Path: blob/main/contrib/llvm-project/llvm/lib/Target/ARC/ARCFrameLowering.h
35268 views
//===- ARCFrameLowering.h - Define frame lowering for ARC -------*- 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// This class implements the ARC specific frame lowering.9//10//===----------------------------------------------------------------------===//1112#ifndef LLVM_LIB_TARGET_ARC_ARCFRAMELOWERING_H13#define LLVM_LIB_TARGET_ARC_ARCFRAMELOWERING_H1415#include "ARC.h"16#include "llvm/CodeGen/MachineBasicBlock.h"17#include "llvm/CodeGen/MachineFrameInfo.h"18#include "llvm/CodeGen/TargetFrameLowering.h"1920namespace llvm {2122class MachineFunction;23class ARCSubtarget;24class ARCInstrInfo;2526class ARCFrameLowering : public TargetFrameLowering {27public:28ARCFrameLowering(const ARCSubtarget &st)29: TargetFrameLowering(TargetFrameLowering::StackGrowsDown, Align(4), 0),30ST(st) {}3132/// Insert Prologue into the function.33void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;3435/// Insert Epilogue into the function.36void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;3738/// Add explicit callee save registers.39void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,40RegScavenger *RS) const override;4142bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,43MachineBasicBlock::iterator MI,44ArrayRef<CalleeSavedInfo> CSI,45const TargetRegisterInfo *TRI) const override;4647bool48restoreCalleeSavedRegisters(MachineBasicBlock &MBB,49MachineBasicBlock::iterator MI,50MutableArrayRef<CalleeSavedInfo> CSI,51const TargetRegisterInfo *TRI) const override;5253void processFunctionBeforeFrameFinalized(MachineFunction &MF,54RegScavenger *RS) const override;5556bool hasFP(const MachineFunction &MF) const override;5758MachineBasicBlock::iterator59eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,60MachineBasicBlock::iterator I) const override;6162bool assignCalleeSavedSpillSlots(63llvm::MachineFunction &, const llvm::TargetRegisterInfo *,64std::vector<llvm::CalleeSavedInfo> &) const override;6566private:67void adjustStackToMatchRecords(MachineBasicBlock &MBB,68MachineBasicBlock::iterator MI,69bool allocate) const;7071const ARCSubtarget &ST;72};7374} // end namespace llvm7576#endif // LLVM_LIB_TARGET_ARC_ARCFRAMELOWERING_H777879