blob: a7658438232a4686dbedd4d8c6a50b58edab6ea0 [file] [log] [blame]
Dylan McKay6d8078f2016-05-06 10:12:31 +00001//===-- AVRFrameLowering.h - Define frame lowering for AVR ------*- C++ -*-===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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
Dylan McKay6d8078f2016-05-06 10:12:31 +00006//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_AVR_FRAME_LOWERING_H
10#define LLVM_AVR_FRAME_LOWERING_H
11
David Blaikie1be62f02017-11-03 22:32:11 +000012#include "llvm/CodeGen/TargetFrameLowering.h"
Dylan McKay6d8078f2016-05-06 10:12:31 +000013
14namespace llvm {
15
16/// Utilities for creating function call frames.
17class AVRFrameLowering : public TargetFrameLowering {
18public:
19 explicit AVRFrameLowering();
20
21public:
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 const std::vector<CalleeSavedInfo> &CSI,
28 const TargetRegisterInfo *TRI) const override;
29 bool
30 restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
31 MachineBasicBlock::iterator MI,
Krzysztof Parzyszekbea30c62017-08-10 16:17:32 +000032 std::vector<CalleeSavedInfo> &CSI,
Dylan McKay6d8078f2016-05-06 10:12:31 +000033 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;
Dylan McKayf1f1c012016-05-18 11:11:38 +000038 MachineBasicBlock::iterator
Dylan McKay6d8078f2016-05-06 10:12:31 +000039 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