1 //===-- AVRFrameLowering.h - Define frame lowering for AVR ------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_AVR_FRAME_LOWERING_H
10 #define LLVM_AVR_FRAME_LOWERING_H
12 #include "llvm/CodeGen/TargetFrameLowering.h"
16 /// Utilities for creating function call frames.
17 class AVRFrameLowering
: public TargetFrameLowering
{
19 explicit AVRFrameLowering();
22 void emitPrologue(MachineFunction
&MF
, MachineBasicBlock
&MBB
) const override
;
23 void emitEpilogue(MachineFunction
&MF
, MachineBasicBlock
&MBB
) const override
;
24 bool hasFP(const MachineFunction
&MF
) const override
;
25 bool spillCalleeSavedRegisters(MachineBasicBlock
&MBB
,
26 MachineBasicBlock::iterator MI
,
27 const std::vector
<CalleeSavedInfo
> &CSI
,
28 const TargetRegisterInfo
*TRI
) const override
;
30 restoreCalleeSavedRegisters(MachineBasicBlock
&MBB
,
31 MachineBasicBlock::iterator MI
,
32 std::vector
<CalleeSavedInfo
> &CSI
,
33 const TargetRegisterInfo
*TRI
) const override
;
34 bool hasReservedCallFrame(const MachineFunction
&MF
) const override
;
35 bool canSimplifyCallFramePseudos(const MachineFunction
&MF
) const override
;
36 void determineCalleeSaves(MachineFunction
&MF
, BitVector
&SavedRegs
,
37 RegScavenger
*RS
= nullptr) const override
;
38 MachineBasicBlock::iterator
39 eliminateCallFramePseudoInstr(MachineFunction
&MF
, MachineBasicBlock
&MBB
,
40 MachineBasicBlock::iterator MI
) const override
;
43 } // end namespace llvm
45 #endif // LLVM_AVR_FRAME_LOWERING_H