aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/PowerPC/PPCFrameInfo.h
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2010-11-15 00:06:54 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2010-11-15 00:06:54 +0000
commit33464912237efaa0ed7060829e66b59055bdd48b (patch)
tree3b5a58918b40d4368be141a6350de4e4c8607032 /lib/Target/PowerPC/PPCFrameInfo.h
parent78b4fee8fd040d802e027da7bef3f707b12d8df5 (diff)
downloadexternal_llvm-33464912237efaa0ed7060829e66b59055bdd48b.tar.gz
external_llvm-33464912237efaa0ed7060829e66b59055bdd48b.tar.bz2
external_llvm-33464912237efaa0ed7060829e66b59055bdd48b.zip
First step of huge frame-related refactoring: move emit{Prologue,Epilogue} out of TargetRegisterInfo to TargetFrameInfo, which is definitely much better suitable place
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119097 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCFrameInfo.h')
-rw-r--r--lib/Target/PowerPC/PPCFrameInfo.h27
1 files changed, 20 insertions, 7 deletions
diff --git a/lib/Target/PowerPC/PPCFrameInfo.h b/lib/Target/PowerPC/PPCFrameInfo.h
index 2551d6fc2e..c04d1f51db 100644
--- a/lib/Target/PowerPC/PPCFrameInfo.h
+++ b/lib/Target/PowerPC/PPCFrameInfo.h
@@ -20,15 +20,28 @@
#include "llvm/ADT/STLExtras.h"
namespace llvm {
+ class PPCSubtarget;
class PPCFrameInfo: public TargetFrameInfo {
- const TargetMachine &TM;
+ const PPCSubtarget &Subtarget;
public:
- PPCFrameInfo(const TargetMachine &tm, bool LP64)
- : TargetFrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0), TM(tm) {
+ PPCFrameInfo(const PPCSubtarget &sti)
+ : TargetFrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0), Subtarget(sti) {
}
+ void determineFrameLayout(MachineFunction &MF) const;
+
+ /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
+ /// the function.
+ void emitPrologue(MachineFunction &MF) const;
+ void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
+
+ /// targetHandlesStackFrameRounding - Returns true if the target is
+ /// responsible for rounding up the stack frame (probably at emitPrologue
+ /// time).
+ bool targetHandlesStackFrameRounding() const { return true; }
+
/// getReturnSaveOffset - Return the previous frame offset to save the
/// return address.
static unsigned getReturnSaveOffset(bool isPPC64, bool isDarwinABI) {
@@ -91,9 +104,9 @@ public:
// With the SVR4 ABI, callee-saved registers have fixed offsets on the stack.
const SpillSlot *
getCalleeSavedSpillSlots(unsigned &NumEntries) const {
- if (TM.getSubtarget<PPCSubtarget>().isDarwinABI()) {
+ if (Subtarget.isDarwinABI()) {
NumEntries = 1;
- if (TM.getSubtarget<PPCSubtarget>().isPPC64()) {
+ if (Subtarget.isPPC64()) {
static const SpillSlot darwin64Offsets = {PPC::X31, -8};
return &darwin64Offsets;
} else {
@@ -103,7 +116,7 @@ public:
}
// Early exit if not using the SVR4 ABI.
- if (!TM.getSubtarget<PPCSubtarget>().isSVR4ABI()) {
+ if (!Subtarget.isSVR4ABI()) {
NumEntries = 0;
return 0;
}
@@ -283,7 +296,7 @@ public:
{PPC::V20, -192}
};
- if (TM.getSubtarget<PPCSubtarget>().isPPC64()) {
+ if (Subtarget.isPPC64()) {
NumEntries = array_lengthof(Offsets64);
return Offsets64;