Dylan McKay | 6d8078f | 2016-05-06 10:12:31 +0000 | [diff] [blame] | 1 | //===-- AVRFrameLowering.h - Define frame lowering for AVR ------*- C++ -*-===// |
| 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 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 |
Dylan McKay | 6d8078f | 2016-05-06 10:12:31 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #ifndef LLVM_AVR_FRAME_LOWERING_H |
| 10 | #define LLVM_AVR_FRAME_LOWERING_H |
| 11 | |
David Blaikie | 1be62f0 | 2017-11-03 22:32:11 +0000 | [diff] [blame] | 12 | #include "llvm/CodeGen/TargetFrameLowering.h" |
Dylan McKay | 6d8078f | 2016-05-06 10:12:31 +0000 | [diff] [blame] | 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 | const std::vector<CalleeSavedInfo> &CSI, |
| 28 | const TargetRegisterInfo *TRI) const override; |
| 29 | bool |
| 30 | restoreCalleeSavedRegisters(MachineBasicBlock &MBB, |
| 31 | MachineBasicBlock::iterator MI, |
Krzysztof Parzyszek | bea30c6 | 2017-08-10 16:17:32 +0000 | [diff] [blame] | 32 | std::vector<CalleeSavedInfo> &CSI, |
Dylan McKay | 6d8078f | 2016-05-06 10:12:31 +0000 | [diff] [blame] | 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; |
Dylan McKay | f1f1c01 | 2016-05-18 11:11:38 +0000 | [diff] [blame] | 38 | MachineBasicBlock::iterator |
Dylan McKay | 6d8078f | 2016-05-06 10:12:31 +0000 | [diff] [blame] | 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 |