1//===-- MipsFrameLowering.h - Define frame lowering for Mips ----*- 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// 11// 12//===----------------------------------------------------------------------===// 13 14#ifndef LLVM_LIB_TARGET_MIPS_MIPSFRAMELOWERING_H 15#define LLVM_LIB_TARGET_MIPS_MIPSFRAMELOWERING_H 16 17#include "Mips.h" 18#include "llvm/Target/TargetFrameLowering.h" 19 20namespace llvm { 21 class MipsSubtarget; 22 23class MipsFrameLowering : public TargetFrameLowering { 24protected: 25 const MipsSubtarget &STI; 26 27public: 28 explicit MipsFrameLowering(const MipsSubtarget &sti, unsigned Alignment) 29 : TargetFrameLowering(StackGrowsDown, Alignment, 0, Alignment), STI(sti) {} 30 31 static const MipsFrameLowering *create(const MipsSubtarget &ST); 32 33 bool hasFP(const MachineFunction &MF) const override; 34 35 bool hasBP(const MachineFunction &MF) const; 36 37 bool isFPCloseToIncomingSP() const override { return false; } 38 39 void 40 eliminateCallFramePseudoInstr(MachineFunction &MF, 41 MachineBasicBlock &MBB, 42 MachineBasicBlock::iterator I) const override; 43 44protected: 45 uint64_t estimateStackSize(const MachineFunction &MF) const; 46}; 47 48/// Create MipsFrameLowering objects. 49const MipsFrameLowering *createMips16FrameLowering(const MipsSubtarget &ST); 50const MipsFrameLowering *createMipsSEFrameLowering(const MipsSubtarget &ST); 51 52} // End llvm namespace 53 54#endif 55