aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MipsTargetMachine.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2012-07-31 22:50:19 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2012-07-31 22:50:19 +0000
commitcdb3ba71ce550c5a41c84c3678225a39d6f0a414 (patch)
treeb0d0c70bbaa9f09fc6ade9c6ff6fd113d231da53 /lib/Target/Mips/MipsTargetMachine.cpp
parentd7122b8d3c48eab05d425c99fee53cde07feafe4 (diff)
Add definitions of two subclasses of MipsFrameLowering, Mips16FrameLowering and
MipsSEFrameLowering. Implement MipsSEFrameLowering::hasReservedCallFrame. Call frames will not be reserved if there is a call with a large call frame or there are variable sized objects on the stack. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161090 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsTargetMachine.cpp')
-rw-r--r--lib/Target/Mips/MipsTargetMachine.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/Target/Mips/MipsTargetMachine.cpp b/lib/Target/Mips/MipsTargetMachine.cpp
index d16632453b..9480a77c74 100644
--- a/lib/Target/Mips/MipsTargetMachine.cpp
+++ b/lib/Target/Mips/MipsTargetMachine.cpp
@@ -12,9 +12,11 @@
//===----------------------------------------------------------------------===//
#include "MipsTargetMachine.h"
-#include "MipsSEInstrInfo.h"
-#include "Mips16InstrInfo.h"
#include "Mips.h"
+#include "Mips16FrameLowering.h"
+#include "Mips16InstrInfo.h"
+#include "MipsSEFrameLowering.h"
+#include "MipsSEInstrInfo.h"
#include "llvm/PassManager.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Support/TargetRegistry.h"
@@ -39,6 +41,18 @@ static const MipsInstrInfo *genInstrInfo(MipsTargetMachine &TM) {
return II;
}
+static const MipsFrameLowering *genFrameLowering(MipsTargetMachine &TM,
+ const MipsSubtarget &ST) {
+ const MipsFrameLowering *FL;
+
+ if (TM.getSubtargetImpl()->inMips16Mode())
+ FL = new Mips16FrameLowering(ST);
+ else
+ FL = new MipsSEFrameLowering(ST);
+
+ return FL;
+}
+
// DataLayout --> Big-endian, 32-bit pointer/ABI/alignment
// The stack is always 8 byte aligned
// On function prologue, the stack is created by decrementing
@@ -62,7 +76,7 @@ MipsTargetMachine(const Target &T, StringRef TT,
"E-p:64:64:64-i8:8:32-i16:16:32-i64:64:64-f128:128:128-n32" :
"E-p:32:32:32-i8:8:32-i16:16:32-i64:64:64-n32")),
InstrInfo(genInstrInfo(*this)),
- FrameLowering(Subtarget),
+ FrameLowering(genFrameLowering(*this, Subtarget)),
TLInfo(*this), TSInfo(*this), JITInfo() {
}