aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/CellSPU/SPUTargetMachine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/CellSPU/SPUTargetMachine.cpp')
-rw-r--r--lib/Target/CellSPU/SPUTargetMachine.cpp23
1 files changed, 6 insertions, 17 deletions
diff --git a/lib/Target/CellSPU/SPUTargetMachine.cpp b/lib/Target/CellSPU/SPUTargetMachine.cpp
index 5c794c9ffa..3a659d8e4d 100644
--- a/lib/Target/CellSPU/SPUTargetMachine.cpp
+++ b/lib/Target/CellSPU/SPUTargetMachine.cpp
@@ -23,10 +23,11 @@
using namespace llvm;
+extern Target TheCellSPUTarget;
namespace {
// Register the targets
RegisterTarget<SPUTargetMachine>
- CELLSPU("cellspu", "STI CBEA Cell SPU [experimental]");
+ CELLSPU(TheCellSPUTarget, "cellspu", "STI CBEA Cell SPU [experimental]");
}
// No assembler printer by default
@@ -47,22 +48,10 @@ SPUTargetMachine::createTargetAsmInfo() const
return new SPULinuxTargetAsmInfo(*this);
}
-unsigned
-SPUTargetMachine::getModuleMatchQuality(const Module &M)
-{
- // We strongly match "spu-*" or "cellspu-*".
- std::string TT = M.getTargetTriple();
- if ((TT.size() == 3 && std::string(TT.begin(), TT.begin()+3) == "spu")
- || (TT.size() == 7 && std::string(TT.begin(), TT.begin()+7) == "cellspu")
- || (TT.size() >= 4 && std::string(TT.begin(), TT.begin()+4) == "spu-")
- || (TT.size() >= 8 && std::string(TT.begin(), TT.begin()+8) == "cellspu-"))
- return 20;
-
- return 0; // No match at all...
-}
-
-SPUTargetMachine::SPUTargetMachine(const Module &M, const std::string &FS)
- : Subtarget(*this, M, FS),
+SPUTargetMachine::SPUTargetMachine(const Target &T, const Module &M,
+ const std::string &FS)
+ : LLVMTargetMachine(T),
+ Subtarget(*this, M, FS),
DataLayout(Subtarget.getTargetDataString()),
InstrInfo(*this),
FrameInfo(*this),