• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===-- AVRFrameLowering.h - Define frame lowering for AVR ------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_AVR_FRAME_LOWERING_H
11 #define LLVM_AVR_FRAME_LOWERING_H
12 
13 #include "llvm/Target/TargetFrameLowering.h"
14 
15 namespace llvm {
16 
17 /// Utilities for creating function call frames.
18 class AVRFrameLowering : public TargetFrameLowering {
19 public:
20   explicit AVRFrameLowering();
21 
22 public:
23   void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
24   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
25   bool hasFP(const MachineFunction &MF) const override;
26   bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
27                                  MachineBasicBlock::iterator MI,
28                                  const std::vector<CalleeSavedInfo> &CSI,
29                                  const TargetRegisterInfo *TRI) const override;
30   bool
31   restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
32                               MachineBasicBlock::iterator MI,
33                               const std::vector<CalleeSavedInfo> &CSI,
34                               const TargetRegisterInfo *TRI) const override;
35   bool hasReservedCallFrame(const MachineFunction &MF) const override;
36   bool canSimplifyCallFramePseudos(const MachineFunction &MF) const override;
37   void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
38                             RegScavenger *RS = nullptr) const override;
39   MachineBasicBlock::iterator
40   eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
41                                 MachineBasicBlock::iterator MI) const override;
42 };
43 
44 } // end namespace llvm
45 
46 #endif // LLVM_AVR_FRAME_LOWERING_H
47