1234285Sdim//=- HexagonFrameLowering.h - Define frame lowering for Hexagon --*- C++ -*--=// 2234285Sdim// 3234285Sdim// The LLVM Compiler Infrastructure 4234285Sdim// 5234285Sdim// This file is distributed under the University of Illinois Open Source 6234285Sdim// License. See LICENSE.TXT for details. 7234285Sdim// 8234285Sdim//===----------------------------------------------------------------------===// 9234285Sdim 10234285Sdim#ifndef HEXAGON_FRAMEINFO_H 11234285Sdim#define HEXAGON_FRAMEINFO_H 12234285Sdim 13234285Sdim#include "Hexagon.h" 14234285Sdim#include "HexagonSubtarget.h" 15234285Sdim#include "llvm/Target/TargetFrameLowering.h" 16234285Sdim 17234285Sdimnamespace llvm { 18234285Sdim 19234285Sdimclass HexagonFrameLowering : public TargetFrameLowering { 20234285Sdimprivate: 21234285Sdim const HexagonSubtarget &STI; 22234285Sdim void determineFrameLayout(MachineFunction &MF) const; 23234285Sdim 24234285Sdimpublic: 25234285Sdim explicit HexagonFrameLowering(const HexagonSubtarget &sti) 26234285Sdim : TargetFrameLowering(StackGrowsDown, 8, 0), STI(sti) { 27234285Sdim } 28234285Sdim 29234285Sdim /// emitProlog/emitEpilog - These methods insert prolog and epilog code into 30234285Sdim /// the function. 31234285Sdim void emitPrologue(MachineFunction &MF) const; 32234285Sdim void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const; 33234285Sdim virtual bool 34234285Sdim spillCalleeSavedRegisters(MachineBasicBlock &MBB, 35234285Sdim MachineBasicBlock::iterator MI, 36234285Sdim const std::vector<CalleeSavedInfo> &CSI, 37234285Sdim const TargetRegisterInfo *TRI) const; 38249423Sdim 39249423Sdim void eliminateCallFramePseudoInstr(MachineFunction &MF, 40249423Sdim MachineBasicBlock &MBB, 41249423Sdim MachineBasicBlock::iterator I) const; 42249423Sdim 43234285Sdim virtual bool 44234285Sdim restoreCalleeSavedRegisters(MachineBasicBlock &MBB, 45234285Sdim MachineBasicBlock::iterator MI, 46234285Sdim const std::vector<CalleeSavedInfo> &CSI, 47234285Sdim const TargetRegisterInfo *TRI) const; 48234285Sdim int getFrameIndexOffset(const MachineFunction &MF, int FI) const; 49234285Sdim bool hasFP(const MachineFunction &MF) const; 50234285Sdim bool hasTailCall(MachineBasicBlock &MBB) const; 51234285Sdim}; 52234285Sdim 53234285Sdim} // End llvm namespace 54234285Sdim 55234285Sdim#endif 56