summaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MipsTargetMachine.cpp
diff options
context:
space:
mode:
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() {
}