blob: 8c8bfeb9969adae701d226fdbe8c221a33fb77fb [file] [log] [blame]
Anton Korobeynikov33464912010-11-15 00:06:54 +00001//=-- MBlazeFrameInfo.h - Define TargetFrameInfo 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
Wesley Peck8397be02010-12-09 03:42:04 +000014#ifndef MBLAZE_FRAMEINFO_H
15#define MBLAZE_FRAMEINFO_H
Anton Korobeynikov33464912010-11-15 00:06:54 +000016
17#include "MBlaze.h"
18#include "MBlazeSubtarget.h"
19#include "llvm/Target/TargetFrameInfo.h"
20
21namespace llvm {
22 class MBlazeSubtarget;
23
24class MBlazeFrameInfo : public TargetFrameInfo {
25protected:
26 const MBlazeSubtarget &STI;
27
28public:
29 explicit MBlazeFrameInfo(const MBlazeSubtarget &sti)
Wesley Peck8397be02010-12-09 03:42:04 +000030 : TargetFrameInfo(TargetFrameInfo::StackGrowsUp, 4, 0), STI(sti) {
Anton Korobeynikov33464912010-11-15 00:06:54 +000031 }
32
Anton Korobeynikov33464912010-11-15 00:06:54 +000033 /// targetHandlesStackFrameRounding - Returns true if the target is
34 /// responsible for rounding up the stack frame (probably at emitPrologue
35 /// time).
36 bool targetHandlesStackFrameRounding() const { return true; }
37
38 /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
39 /// the function.
40 void emitPrologue(MachineFunction &MF) const;
41 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
Anton Korobeynikovd0c38172010-11-18 21:19:35 +000042
43 bool hasFP(const MachineFunction &MF) const;
Wesley Peck8397be02010-12-09 03:42:04 +000044
Wesley Peck3d2148f2011-01-05 17:34:20 +000045 int getFrameIndexOffset(const MachineFunction &MF, int FI) const;
46
Wesley Peck8397be02010-12-09 03:42:04 +000047 virtual void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
48 RegScavenger *RS) const;
Anton Korobeynikov33464912010-11-15 00:06:54 +000049};
50
51} // End llvm namespace
52
53#endif