48 lines · c
1//===-- AVRFrameLowering.h - Define frame lowering for AVR ------*- 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-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLVM_AVR_FRAME_LOWERING_H10#define LLVM_AVR_FRAME_LOWERING_H11 12#include "llvm/CodeGen/TargetFrameLowering.h"13 14namespace llvm {15 16/// Utilities for creating function call frames.17class AVRFrameLowering : public TargetFrameLowering {18public:19 explicit AVRFrameLowering();20 21public:22 void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;23 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;24 bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,25 MachineBasicBlock::iterator MI,26 ArrayRef<CalleeSavedInfo> CSI,27 const TargetRegisterInfo *TRI) const override;28 bool29 restoreCalleeSavedRegisters(MachineBasicBlock &MBB,30 MachineBasicBlock::iterator MI,31 MutableArrayRef<CalleeSavedInfo> CSI,32 const TargetRegisterInfo *TRI) const override;33 bool hasReservedCallFrame(const MachineFunction &MF) const override;34 bool canSimplifyCallFramePseudos(const MachineFunction &MF) const override;35 void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,36 RegScavenger *RS = nullptr) const override;37 MachineBasicBlock::iterator38 eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,39 MachineBasicBlock::iterator MI) const override;40 41protected:42 bool hasFPImpl(const MachineFunction &MF) const override;43};44 45} // end namespace llvm46 47#endif // LLVM_AVR_FRAME_LOWERING_H48