diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-08-02 22:11:08 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-08-02 22:11:08 +0000 |
| commit | 31b44e8f6c273574f149b28937bcc562968aee4b (patch) | |
| tree | 70880c32a0fc348e62dbe47e1b230dc0faf79c82 /llvm/lib/Target/Mips | |
| parent | 7dc3b726851866179f147262363cc14ead70abd3 (diff) | |
| download | bcm5719-llvm-31b44e8f6c273574f149b28937bcc562968aee4b.tar.gz bcm5719-llvm-31b44e8f6c273574f149b28937bcc562968aee4b.zip | |
Normalize Subtarget constructors to take a target triple string instead of
Module*.
Also, dropped uses of TargetMachine where unnecessary. The only target which
still takes a TargetMachine& is Mips, I would appreciate it if someone would
normalize this to match other targets.
llvm-svn: 77918
Diffstat (limited to 'llvm/lib/Target/Mips')
| -rw-r--r-- | llvm/lib/Target/Mips/MipsSubtarget.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/MipsSubtarget.h | 5 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/MipsTargetMachine.cpp | 2 |
3 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/Target/Mips/MipsSubtarget.cpp b/llvm/lib/Target/Mips/MipsSubtarget.cpp index 87c2208e9d4..c56bc9d290d 100644 --- a/llvm/lib/Target/Mips/MipsSubtarget.cpp +++ b/llvm/lib/Target/Mips/MipsSubtarget.cpp @@ -14,7 +14,6 @@ #include "MipsSubtarget.h" #include "Mips.h" #include "MipsGenSubtarget.inc" -#include "llvm/Module.h" #include "llvm/Support/CommandLine.h" using namespace llvm; @@ -25,7 +24,7 @@ static cl::opt<bool> AbsoluteCall("enable-mips-absolute-call", cl::Hidden, cl::desc("Enable absolute call within abicall")); -MipsSubtarget::MipsSubtarget(const TargetMachine &TM, const Module &M, +MipsSubtarget::MipsSubtarget(const TargetMachine &TM, const std::string &TT, const std::string &FS, bool little) : MipsArchVersion(Mips1), MipsABI(O32), IsLittle(little), IsSingleFloat(false), IsFP64bit(false), IsGP64bit(false), HasVFPU(false), HasABICall(true), @@ -37,7 +36,6 @@ MipsSubtarget::MipsSubtarget(const TargetMachine &TM, const Module &M, // Parse features string. ParseSubtargetFeatures(FS, CPU); - const std::string& TT = M.getTargetTriple(); // Is the target system Linux ? if (TT.find("linux") == std::string::npos) diff --git a/llvm/lib/Target/Mips/MipsSubtarget.h b/llvm/lib/Target/Mips/MipsSubtarget.h index 2244e497dd7..2485fef887e 100644 --- a/llvm/lib/Target/Mips/MipsSubtarget.h +++ b/llvm/lib/Target/Mips/MipsSubtarget.h @@ -20,7 +20,6 @@ #include <string> namespace llvm { -class Module; class MipsSubtarget : public TargetSubtarget { @@ -99,8 +98,8 @@ public: unsigned getTargetABI() const { return MipsABI; } /// This constructor initializes the data members to match that - /// of the specified module. - MipsSubtarget(const TargetMachine &TM, const Module &M, + /// of the specified triple. + MipsSubtarget(const TargetMachine &TM, const std::string &TT, const std::string &FS, bool little); /// ParseSubtargetFeatures - Parses features string setting specified diff --git a/llvm/lib/Target/Mips/MipsTargetMachine.cpp b/llvm/lib/Target/Mips/MipsTargetMachine.cpp index b5e2da74ba7..db18b097c40 100644 --- a/llvm/lib/Target/Mips/MipsTargetMachine.cpp +++ b/llvm/lib/Target/Mips/MipsTargetMachine.cpp @@ -42,7 +42,7 @@ MipsTargetMachine:: MipsTargetMachine(const Target &T, const Module &M, const std::string &FS, bool isLittle=false): LLVMTargetMachine(T), - Subtarget(*this, M, FS, isLittle), + Subtarget(*this, M.getTargetTriple(), FS, isLittle), DataLayout(isLittle ? std::string("e-p:32:32:32-i8:8:32-i16:16:32") : std::string("E-p:32:32:32-i8:8:32-i16:16:32")), InstrInfo(*this), |

