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 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; 38 virtual bool 39 restoreCalleeSavedRegisters(MachineBasicBlock &MBB, 40 MachineBasicBlock::iterator MI, 41 const std::vector<CalleeSavedInfo> &CSI, 42 const TargetRegisterInfo *TRI) const; 43 int getFrameIndexOffset(const MachineFunction &MF, int FI) const; 44 bool hasFP(const MachineFunction &MF) const; 45 bool hasTailCall(MachineBasicBlock &MBB) const; 46}; 47 48} // End llvm namespace 49 50#endif 51