1 //=- MBlazeFrameLowering.h - Define frame lowering for MicroBlaze -*- 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 MBLAZE_FRAMEINFO_H
15 #define MBLAZE_FRAMEINFO_H
18 #include "llvm/Target/TargetFrameLowering.h"
21 class MBlazeSubtarget;
23 class MBlazeFrameLowering : public TargetFrameLowering {
25 const MBlazeSubtarget &STI;
28 explicit MBlazeFrameLowering(const MBlazeSubtarget &sti)
29 : TargetFrameLowering(TargetFrameLowering::StackGrowsUp, 4, 0), STI(sti) {
32 /// targetHandlesStackFrameRounding - Returns true if the target is
33 /// responsible for rounding up the stack frame (probably at emitPrologue
35 bool targetHandlesStackFrameRounding() const { return true; }
37 /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
39 void emitPrologue(MachineFunction &MF) const;
40 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
42 void eliminateCallFramePseudoInstr(MachineFunction &MF,
43 MachineBasicBlock &MBB,
44 MachineBasicBlock::iterator I) const;
46 bool hasFP(const MachineFunction &MF) const;
48 int getFrameIndexOffset(const MachineFunction &MF, int FI) const;
50 virtual void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
51 RegScavenger *RS) const;
54 } // End llvm namespace