blob: 2d6b45793809925f7e32b238b91dab6f53378484 [file] [log] [blame]
Tony Linthicumb4b54152011-12-12 21:14:40 +00001//=- 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 Hines37ed9c12014-12-01 14:51:49 -080010#ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONFRAMELOWERING_H
11#define LLVM_LIB_TARGET_HEXAGON_HEXAGONFRAMELOWERING_H
Tony Linthicumb4b54152011-12-12 21:14:40 +000012
13#include "Hexagon.h"
Tony Linthicumb4b54152011-12-12 21:14:40 +000014#include "llvm/Target/TargetFrameLowering.h"
15
16namespace llvm {
17
18class HexagonFrameLowering : public TargetFrameLowering {
19private:
Tony Linthicumb4b54152011-12-12 21:14:40 +000020 void determineFrameLayout(MachineFunction &MF) const;
21
22public:
Stephen Hinesc6a4f5e2014-07-21 00:45:20 -070023 explicit HexagonFrameLowering() : TargetFrameLowering(StackGrowsDown, 8, 0) {}
Tony Linthicumb4b54152011-12-12 21:14:40 +000024
25 /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
26 /// the function.
Stephen Hinesdce4a402014-05-29 02:49:00 -070027 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 Bendersky700ed802013-02-21 20:05:00 +000033
Stephen Hinesdce4a402014-05-29 02:49:00 -070034 void
35 eliminateCallFramePseudoInstr(MachineFunction &MF,
36 MachineBasicBlock &MBB,
37 MachineBasicBlock::iterator I) const override;
Eli Bendersky700ed802013-02-21 20:05:00 +000038
Stephen Hinesdce4a402014-05-29 02:49:00 -070039 bool
Tony Linthicumb4b54152011-12-12 21:14:40 +000040 restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
41 MachineBasicBlock::iterator MI,
42 const std::vector<CalleeSavedInfo> &CSI,
Stephen Hinesdce4a402014-05-29 02:49:00 -070043 const TargetRegisterInfo *TRI) const override;
44 int getFrameIndexOffset(const MachineFunction &MF, int FI) const override;
45 bool hasFP(const MachineFunction &MF) const override;
Tony Linthicumb4b54152011-12-12 21:14:40 +000046 bool hasTailCall(MachineBasicBlock &MBB) const;
47};
48
49} // End llvm namespace
50
51#endif