]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/llvm/lib/Target/Hexagon/HexagonFrameLowering.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / llvm / lib / Target / Hexagon / HexagonFrameLowering.h
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
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
17 namespace llvm {
18
19 class HexagonFrameLowering : public TargetFrameLowering {
20 private:
21   const HexagonSubtarget &STI;
22   void determineFrameLayout(MachineFunction &MF) const;
23
24 public:
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;
38
39   void eliminateCallFramePseudoInstr(MachineFunction &MF,
40                                      MachineBasicBlock &MBB,
41                                      MachineBasicBlock::iterator I) const;
42
43   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