1 //=- MBlazeFrameLowering.h - Define frame lowering for MicroBlaze -*- 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 MBLAZE_FRAMEINFO_H 15 #define MBLAZE_FRAMEINFO_H 16 17 #include "MBlaze.h" 18 #include "llvm/Target/TargetFrameLowering.h" 19 20 namespace llvm { 21 class MBlazeSubtarget; 22 23 class MBlazeFrameLowering : public TargetFrameLowering { 24 protected: 25 const MBlazeSubtarget &STI; 26 27 public: 28 explicit MBlazeFrameLowering(const MBlazeSubtarget &sti) 29 : TargetFrameLowering(TargetFrameLowering::StackGrowsUp, 4, 0), STI(sti) { 30 } 31 32 /// targetHandlesStackFrameRounding - Returns true if the target is 33 /// responsible for rounding up the stack frame (probably at emitPrologue 34 /// time). 35 bool targetHandlesStackFrameRounding() const { return true; } 36 37 /// emitProlog/emitEpilog - These methods insert prolog and epilog code into 38 /// the function. 39 void emitPrologue(MachineFunction &MF) const; 40 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const; 41 42 bool hasFP(const MachineFunction &MF) const; 43 44 int getFrameIndexOffset(const MachineFunction &MF, int FI) const; 45 46 virtual void processFunctionBeforeCalleeSavedScan(MachineFunction &MF, 47 RegScavenger *RS) const; 48 }; 49 50 } // End llvm namespace 51 52 #endif 53