2011-01-10 12:39:04 +00:00
|
|
|
//=- MBlazeFrameLowering.h - Define frame lowering for MicroBlaze -*- C++ -*-=//
|
2010-11-15 00:06:54 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2010-12-09 03:42:04 +00:00
|
|
|
#ifndef MBLAZE_FRAMEINFO_H
|
|
|
|
#define MBLAZE_FRAMEINFO_H
|
2010-11-15 00:06:54 +00:00
|
|
|
|
|
|
|
#include "MBlaze.h"
|
2011-01-10 12:39:04 +00:00
|
|
|
#include "llvm/Target/TargetFrameLowering.h"
|
2010-11-15 00:06:54 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
2012-03-17 18:46:09 +00:00
|
|
|
class MBlazeSubtarget;
|
2010-11-15 00:06:54 +00:00
|
|
|
|
2011-01-10 12:39:04 +00:00
|
|
|
class MBlazeFrameLowering : public TargetFrameLowering {
|
2010-11-15 00:06:54 +00:00
|
|
|
protected:
|
|
|
|
const MBlazeSubtarget &STI;
|
|
|
|
|
|
|
|
public:
|
2011-01-10 12:39:04 +00:00
|
|
|
explicit MBlazeFrameLowering(const MBlazeSubtarget &sti)
|
|
|
|
: TargetFrameLowering(TargetFrameLowering::StackGrowsUp, 4, 0), STI(sti) {
|
2010-11-15 00:06:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// targetHandlesStackFrameRounding - Returns true if the target is
|
|
|
|
/// responsible for rounding up the stack frame (probably at emitPrologue
|
|
|
|
/// time).
|
|
|
|
bool targetHandlesStackFrameRounding() const { return true; }
|
|
|
|
|
|
|
|
/// emitProlog/emitEpilog - These methods insert prolog and epilog code into
|
|
|
|
/// the function.
|
|
|
|
void emitPrologue(MachineFunction &MF) const;
|
|
|
|
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
|
2010-11-18 21:19:35 +00:00
|
|
|
|
|
|
|
bool hasFP(const MachineFunction &MF) const;
|
2010-12-09 03:42:04 +00:00
|
|
|
|
2011-01-05 17:34:20 +00:00
|
|
|
int getFrameIndexOffset(const MachineFunction &MF, int FI) const;
|
|
|
|
|
2010-12-09 03:42:04 +00:00
|
|
|
virtual void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
|
|
|
RegScavenger *RS) const;
|
2010-11-15 00:06:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End llvm namespace
|
|
|
|
|
|
|
|
#endif
|