blob: 850a43abebfadd05521caacd31f716ac9108d7db [file] [log] [blame]
Dylan McKay6d8078f2016-05-06 10:12:31 +00001//===-- 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
Dylan McKay6d8078f2016-05-06 10:12:31 +000013#include "llvm/Target/TargetFrameLowering.h"
14
15namespace llvm {
16
17/// Utilities for creating function call frames.
18class AVRFrameLowering : public TargetFrameLowering {
19public:
20 explicit AVRFrameLowering();
21
22public:
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;
Dylan McKayf1f1c012016-05-18 11:11:38 +000039 MachineBasicBlock::iterator
Dylan McKay6d8078f2016-05-06 10:12:31 +000040 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