blob: 9ee7f1f775b45468f60bb91ea73223f35e37e55e [file] [log] [blame]
Rafael Espindolaec46ea32006-08-16 14:43:33 +00001//===-- ARMTargetFrameInfo.h - Define TargetFrameInfo for ARM ---*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
Rafael Espindolaec46ea32006-08-16 14:43:33 +00006// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10//
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef ARM_FRAMEINFO_H
15#define ARM_FRAMEINFO_H
16
17#include "ARM.h"
Evan Chenga8e29892007-01-19 07:51:42 +000018#include "ARMSubtarget.h"
Evan Cheng1945b7b2009-07-09 06:49:09 +000019#include "llvm/Target/TargetFrameInfo.h"
Rafael Espindolaec46ea32006-08-16 14:43:33 +000020
21namespace llvm {
Anton Korobeynikov33464912010-11-15 00:06:54 +000022 class ARMSubtarget;
Rafael Espindolaec46ea32006-08-16 14:43:33 +000023
Evan Chenga8e29892007-01-19 07:51:42 +000024class ARMFrameInfo : public TargetFrameInfo {
Anton Korobeynikov33464912010-11-15 00:06:54 +000025protected:
26 const ARMSubtarget &STI;
27
Rafael Espindolaec46ea32006-08-16 14:43:33 +000028public:
Anton Korobeynikov33464912010-11-15 00:06:54 +000029 explicit ARMFrameInfo(const ARMSubtarget &sti)
30 : TargetFrameInfo(StackGrowsDown, sti.getStackAlignment(), 0, 4), STI(sti) {
Rafael Espindolaec46ea32006-08-16 14:43:33 +000031 }
Anton Korobeynikov33464912010-11-15 00:06:54 +000032
33 /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
34 /// the function.
35 void emitPrologue(MachineFunction &MF) const;
36 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
Anton Korobeynikovd0c38172010-11-18 21:19:35 +000037
38 bool hasFP(const MachineFunction &MF) const;
39 bool hasReservedCallFrame(const MachineFunction &MF) const;
40 bool canSimplifyCallFramePseudos(const MachineFunction &MF) const;
Anton Korobeynikov82f58742010-11-20 15:59:32 +000041 int getFrameIndexReference(const MachineFunction &MF, int FI,
42 unsigned &FrameReg) const;
43 int ResolveFrameIndexReference(const MachineFunction &MF, int FI,
44 unsigned &FrameReg, int SPAdj) const;
45 int getFrameIndexOffset(const MachineFunction &MF, int FI) const;
46
Rafael Espindolaec46ea32006-08-16 14:43:33 +000047};
48
49} // End llvm namespace
50
51#endif