Dylan McKay | 6d8078f | 2016-05-06 10:12:31 +0000 | [diff] [blame] | 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 | |
Dylan McKay | 6d8078f | 2016-05-06 10:12:31 +0000 | [diff] [blame] | 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; |
Dylan McKay | f1f1c01 | 2016-05-18 11:11:38 +0000 | [diff] [blame] | 39 | MachineBasicBlock::iterator |
Dylan McKay | 6d8078f | 2016-05-06 10:12:31 +0000 | [diff] [blame] | 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 |