1 //===-- MipsFrameLowering.h - Define frame lowering for Mips ----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_MIPS_MIPSFRAMELOWERING_H
15 #define LLVM_LIB_TARGET_MIPS_MIPSFRAMELOWERING_H
18 #include "llvm/CodeGen/TargetFrameLowering.h"
23 class MipsFrameLowering : public TargetFrameLowering {
25 const MipsSubtarget &STI;
28 explicit MipsFrameLowering(const MipsSubtarget &sti, unsigned Alignment)
29 : TargetFrameLowering(StackGrowsDown, Alignment, 0, Alignment), STI(sti) {}
31 static const MipsFrameLowering *create(const MipsSubtarget &ST);
33 bool hasFP(const MachineFunction &MF) const override;
35 bool hasBP(const MachineFunction &MF) const;
37 bool isFPCloseToIncomingSP() const override { return false; }
39 bool enableShrinkWrapping(const MachineFunction &MF) const override {
43 MachineBasicBlock::iterator
44 eliminateCallFramePseudoInstr(MachineFunction &MF,
45 MachineBasicBlock &MBB,
46 MachineBasicBlock::iterator I) const override;
49 uint64_t estimateStackSize(const MachineFunction &MF) const;
52 /// Create MipsFrameLowering objects.
53 const MipsFrameLowering *createMips16FrameLowering(const MipsSubtarget &ST);
54 const MipsFrameLowering *createMipsSEFrameLowering(const MipsSubtarget &ST);
56 } // End llvm namespace