blob: 4b91cfd4c3f1e22b7c350b9322925505b76c2e57 [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
13#include "AVRConfig.h"
14
15#include "llvm/Target/TargetFrameLowering.h"
16
17namespace llvm {
18
19/// Utilities for creating function call frames.
20class AVRFrameLowering : public TargetFrameLowering {
21public:
22 explicit AVRFrameLowering();
23
24public:
25 void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
26 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
27 bool hasFP(const MachineFunction &MF) const override;
28 bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
29 MachineBasicBlock::iterator MI,
30 const std::vector<CalleeSavedInfo> &CSI,
31 const TargetRegisterInfo *TRI) const override;
32 bool
33 restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
34 MachineBasicBlock::iterator MI,
35 const std::vector<CalleeSavedInfo> &CSI,
36 const TargetRegisterInfo *TRI) const override;
37 bool hasReservedCallFrame(const MachineFunction &MF) const override;
38 bool canSimplifyCallFramePseudos(const MachineFunction &MF) const override;
39 void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
40 RegScavenger *RS = nullptr) const override;
41 void
42 eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
43 MachineBasicBlock::iterator MI) const override;
44};
45
46} // end namespace llvm
47
48#endif // LLVM_AVR_FRAME_LOWERING_H