blob: a62c76aaf6760acf90917404bcfdd4c09d04c8e8 [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
10#ifndef HEXAGON_FRAMEINFO_H
11#define HEXAGON_FRAMEINFO_H
12
13#include "Hexagon.h"
14#include "HexagonSubtarget.h"
15#include "llvm/Target/TargetFrameLowering.h"
16
17namespace llvm {
18
19class HexagonFrameLowering : public TargetFrameLowering {
20private:
21 const HexagonSubtarget &STI;
22 void determineFrameLayout(MachineFunction &MF) const;
23
24public:
25 explicit HexagonFrameLowering(const HexagonSubtarget &sti)
26 : TargetFrameLowering(StackGrowsDown, 8, 0), STI(sti) {
27 }
28
29 /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
30 /// the function.
31 void emitPrologue(MachineFunction &MF) const;
32 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
33 virtual bool
34 spillCalleeSavedRegisters(MachineBasicBlock &MBB,
35 MachineBasicBlock::iterator MI,
36 const std::vector<CalleeSavedInfo> &CSI,
37 const TargetRegisterInfo *TRI) const;
Eli Bendersky700ed802013-02-21 20:05:00 +000038
39 void eliminateCallFramePseudoInstr(MachineFunction &MF,
40 MachineBasicBlock &MBB,
41 MachineBasicBlock::iterator I) const;
42
Tony Linthicumb4b54152011-12-12 21:14:40 +000043 virtual bool
44 restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
45 MachineBasicBlock::iterator MI,
46 const std::vector<CalleeSavedInfo> &CSI,
47 const TargetRegisterInfo *TRI) const;
48 int getFrameIndexOffset(const MachineFunction &MF, int FI) const;
49 bool hasFP(const MachineFunction &MF) const;
50 bool hasTailCall(MachineBasicBlock &MBB) const;
51};
52
53} // End llvm namespace
54
55#endif