xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AVR/AVRFrameLowering.h (revision ec0ea6efa1ad229d75c394c1a9b9cac33af2b1d3)
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-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_AVR_FRAME_LOWERING_H
10 #define LLVM_AVR_FRAME_LOWERING_H
11 
12 #include "llvm/CodeGen/TargetFrameLowering.h"
13 
14 namespace llvm {
15 
16 /// Utilities for creating function call frames.
17 class AVRFrameLowering : public TargetFrameLowering {
18 public:
19   explicit AVRFrameLowering();
20 
21 public:
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                                  ArrayRef<CalleeSavedInfo> CSI,
28                                  const TargetRegisterInfo *TRI) const override;
29   bool
30   restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
31                               MachineBasicBlock::iterator MI,
32                               MutableArrayRef<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;
41 };
42 
43 } // end namespace llvm
44 
45 #endif // LLVM_AVR_FRAME_LOWERING_H
46