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 spillCalleeSavedRegisters(MachineBasicBlock
&MBB
,
25 MachineBasicBlock::iterator MI
,
26 ArrayRef
<CalleeSavedInfo
> CSI
,
27 const TargetRegisterInfo
*TRI
) const override
;
29 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::iterator
38 eliminateCallFramePseudoInstr(MachineFunction
&MF
, MachineBasicBlock
&MBB
,
39 MachineBasicBlock::iterator MI
) const override
;
42 bool hasFPImpl(const MachineFunction
&MF
) const override
;
45 } // end namespace llvm
47 #endif // LLVM_AVR_FRAME_LOWERING_H