1 //=- HexagonFrameLowering.h - Define frame lowering for Hexagon --*- C++ -*--=//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef HEXAGON_FRAMEINFO_H
11 #define HEXAGON_FRAMEINFO_H
14 #include "HexagonSubtarget.h"
15 #include "llvm/Target/TargetFrameLowering.h"
19 class HexagonFrameLowering : public TargetFrameLowering {
21 const HexagonSubtarget &STI;
22 void determineFrameLayout(MachineFunction &MF) const;
25 explicit HexagonFrameLowering(const HexagonSubtarget &sti)
26 : TargetFrameLowering(StackGrowsDown, 8, 0), STI(sti) {
29 /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
31 void emitPrologue(MachineFunction &MF) const override;
32 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
33 bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
34 MachineBasicBlock::iterator MI,
35 const std::vector<CalleeSavedInfo> &CSI,
36 const TargetRegisterInfo *TRI) const override;
39 eliminateCallFramePseudoInstr(MachineFunction &MF,
40 MachineBasicBlock &MBB,
41 MachineBasicBlock::iterator I) const override;
44 restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
45 MachineBasicBlock::iterator MI,
46 const std::vector<CalleeSavedInfo> &CSI,
47 const TargetRegisterInfo *TRI) const override;
48 int getFrameIndexOffset(const MachineFunction &MF, int FI) const override;
49 bool hasFP(const MachineFunction &MF) const override;
50 bool hasTailCall(MachineBasicBlock &MBB) const;
53 } // End llvm namespace