| Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 1 | //=- HexagonFrameLowering.h - Define frame lowering for Hexagon --*- 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 | |
| Stephen Hines | 37ed9c1 | 2014-12-01 14:51:49 -0800 | [diff] [blame^] | 10 | #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONFRAMELOWERING_H |
| 11 | #define LLVM_LIB_TARGET_HEXAGON_HEXAGONFRAMELOWERING_H |
| Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 12 | |
| 13 | #include "Hexagon.h" |
| Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 14 | #include "llvm/Target/TargetFrameLowering.h" |
| 15 | |
| 16 | namespace llvm { |
| 17 | |
| 18 | class HexagonFrameLowering : public TargetFrameLowering { |
| 19 | private: |
| Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 20 | void determineFrameLayout(MachineFunction &MF) const; |
| 21 | |
| 22 | public: |
| Stephen Hines | c6a4f5e | 2014-07-21 00:45:20 -0700 | [diff] [blame] | 23 | explicit HexagonFrameLowering() : TargetFrameLowering(StackGrowsDown, 8, 0) {} |
| Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 24 | |
| 25 | /// emitProlog/emitEpilog - These methods insert prolog and epilog code into |
| 26 | /// the function. |
| Stephen Hines | dce4a40 | 2014-05-29 02:49:00 -0700 | [diff] [blame] | 27 | void emitPrologue(MachineFunction &MF) const override; |
| 28 | void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override; |
| 29 | bool spillCalleeSavedRegisters(MachineBasicBlock &MBB, |
| 30 | MachineBasicBlock::iterator MI, |
| 31 | const std::vector<CalleeSavedInfo> &CSI, |
| 32 | const TargetRegisterInfo *TRI) const override; |
| Eli Bendersky | 700ed80 | 2013-02-21 20:05:00 +0000 | [diff] [blame] | 33 | |
| Stephen Hines | dce4a40 | 2014-05-29 02:49:00 -0700 | [diff] [blame] | 34 | void |
| 35 | eliminateCallFramePseudoInstr(MachineFunction &MF, |
| 36 | MachineBasicBlock &MBB, |
| 37 | MachineBasicBlock::iterator I) const override; |
| Eli Bendersky | 700ed80 | 2013-02-21 20:05:00 +0000 | [diff] [blame] | 38 | |
| Stephen Hines | dce4a40 | 2014-05-29 02:49:00 -0700 | [diff] [blame] | 39 | bool |
| Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 40 | restoreCalleeSavedRegisters(MachineBasicBlock &MBB, |
| 41 | MachineBasicBlock::iterator MI, |
| 42 | const std::vector<CalleeSavedInfo> &CSI, |
| Stephen Hines | dce4a40 | 2014-05-29 02:49:00 -0700 | [diff] [blame] | 43 | const TargetRegisterInfo *TRI) const override; |
| 44 | int getFrameIndexOffset(const MachineFunction &MF, int FI) const override; |
| 45 | bool hasFP(const MachineFunction &MF) const override; |
| Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 46 | bool hasTailCall(MachineBasicBlock &MBB) const; |
| 47 | }; |
| 48 | |
| 49 | } // End llvm namespace |
| 50 | |
| 51 | #endif |