Home | History | Annotate | Download | only in Hexagon
      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 "llvm/Target/TargetFrameLowering.h"
     15 
     16 namespace llvm {
     17 
     18 class HexagonFrameLowering : public TargetFrameLowering {
     19 private:
     20   void determineFrameLayout(MachineFunction &MF) const;
     21 
     22 public:
     23   explicit HexagonFrameLowering() : TargetFrameLowering(StackGrowsDown, 8, 0) {}
     24 
     25   /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
     26   /// the function.
     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;
     33 
     34   void
     35   eliminateCallFramePseudoInstr(MachineFunction &MF,
     36                                 MachineBasicBlock &MBB,
     37                                 MachineBasicBlock::iterator I) const override;
     38 
     39   bool
     40   restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
     41                               MachineBasicBlock::iterator MI,
     42                               const std::vector<CalleeSavedInfo> &CSI,
     43                               const TargetRegisterInfo *TRI) const override;
     44   int getFrameIndexOffset(const MachineFunction &MF, int FI) const override;
     45   bool hasFP(const MachineFunction &MF) const override;
     46   bool hasTailCall(MachineBasicBlock &MBB) const;
     47 };
     48 
     49 } // End llvm namespace
     50 
     51 #endif
     52