aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/Mips/MipsTargetMachine.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2014-07-02 21:29:23 +0000
committerEric Christopher <echristo@gmail.com>2014-07-02 21:29:23 +0000
commit5f9fd210b34141f5eddea0aadbe792bff89c0ed7 (patch)
treeab6cf5b0d4c1dfeb292f006863901c20b38ce4d4 /llvm/lib/Target/Mips/MipsTargetMachine.cpp
parent11dd5cf9f19d58b2e13e84959ea9ef086a040f35 (diff)
downloadllvm-5f9fd210b34141f5eddea0aadbe792bff89c0ed7.zip
llvm-5f9fd210b34141f5eddea0aadbe792bff89c0ed7.tar.gz
llvm-5f9fd210b34141f5eddea0aadbe792bff89c0ed7.tar.bz2
Move the data layout and selection dag info from the mips target machine
down to the subtarget. llvm-svn: 212224
Diffstat (limited to 'llvm/lib/Target/Mips/MipsTargetMachine.cpp')
-rw-r--r--llvm/lib/Target/Mips/MipsTargetMachine.cpp34
1 files changed, 2 insertions, 32 deletions
diff --git a/llvm/lib/Target/Mips/MipsTargetMachine.cpp b/llvm/lib/Target/Mips/MipsTargetMachine.cpp
index e6b077e..c38639e 100644
--- a/llvm/lib/Target/Mips/MipsTargetMachine.cpp
+++ b/llvm/lib/Target/Mips/MipsTargetMachine.cpp
@@ -45,36 +45,6 @@ extern "C" void LLVMInitializeMipsTarget() {
RegisterTargetMachine<MipselTargetMachine> B(TheMips64elTarget);
}
-static std::string computeDataLayout(const MipsSubtarget &ST) {
- std::string Ret = "";
-
- // There are both little and big endian mips.
- if (ST.isLittle())
- Ret += "e";
- else
- Ret += "E";
-
- Ret += "-m:m";
-
- // Pointers are 32 bit on some ABIs.
- if (!ST.isABI_N64())
- Ret += "-p:32:32";
-
- // 8 and 16 bit integers only need no have natural alignment, but try to
- // align them to 32 bits. 64 bit integers have natural alignment.
- Ret += "-i8:8:32-i16:16:32-i64:64";
-
- // 32 bit registers are always available and the stack is at least 64 bit
- // aligned. On N64 64 bit registers are also available and the stack is
- // 128 bit aligned.
- if (ST.isABI_N64() || ST.isABI_N32())
- Ret += "-n32:64-S128";
- else
- Ret += "-n32-S64";
-
- return Ret;
-}
-
// On function prologue, the stack is created by decrementing
// its pointer. Once decremented, all references are done with positive
// offset from the stack/frame pointer, using StackGrowsUp enables
@@ -87,9 +57,9 @@ MipsTargetMachine::MipsTargetMachine(const Target &T, StringRef TT,
CodeGenOpt::Level OL, bool isLittle)
: LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL),
Subtarget(TT, CPU, FS, isLittle, RM, this),
- DL(computeDataLayout(Subtarget)), InstrInfo(MipsInstrInfo::create(*this)),
+ InstrInfo(MipsInstrInfo::create(*this)),
FrameLowering(MipsFrameLowering::create(*this, Subtarget)),
- TLInfo(MipsTargetLowering::create(*this)), TSInfo(DL) {
+ TLInfo(MipsTargetLowering::create(*this)) {
initAsmInfo();
}