diff options
author | Stuart Hastings <stuart@apple.com> | 2009-07-15 17:27:11 +0000 |
---|---|---|
committer | Stuart Hastings <stuart@apple.com> | 2009-07-15 17:27:11 +0000 |
commit | 2286f8dc4cec0625f7d7a14e2570926cf8599646 (patch) | |
tree | 2443581013659cf94139995c03b6883ff4ab43db /lib/Target/CellSPU/SPUTargetMachine.cpp | |
parent | 7fe3dd5b7ea9ef7d3cfd6d26dfdd7ddf49718339 (diff) | |
download | external_llvm-2286f8dc4cec0625f7d7a14e2570926cf8599646.zip external_llvm-2286f8dc4cec0625f7d7a14e2570926cf8599646.tar.gz external_llvm-2286f8dc4cec0625f7d7a14e2570926cf8599646.tar.bz2 |
Revert 75762, 75763, 75766..75769, 75772..75775, 75778, 75780, 75782 to repair broken LLVM-GCC build.
Will revert 75770 in the llvm-gcc trunk.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75799 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/CellSPU/SPUTargetMachine.cpp')
-rw-r--r-- | lib/Target/CellSPU/SPUTargetMachine.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/lib/Target/CellSPU/SPUTargetMachine.cpp b/lib/Target/CellSPU/SPUTargetMachine.cpp index 3a659d8..5c794c9 100644 --- a/lib/Target/CellSPU/SPUTargetMachine.cpp +++ b/lib/Target/CellSPU/SPUTargetMachine.cpp @@ -23,11 +23,10 @@ using namespace llvm; -extern Target TheCellSPUTarget; namespace { // Register the targets RegisterTarget<SPUTargetMachine> - CELLSPU(TheCellSPUTarget, "cellspu", "STI CBEA Cell SPU [experimental]"); + CELLSPU("cellspu", "STI CBEA Cell SPU [experimental]"); } // No assembler printer by default @@ -48,10 +47,22 @@ SPUTargetMachine::createTargetAsmInfo() const return new SPULinuxTargetAsmInfo(*this); } -SPUTargetMachine::SPUTargetMachine(const Target &T, const Module &M, - const std::string &FS) - : LLVMTargetMachine(T), - Subtarget(*this, M, FS), +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), DataLayout(Subtarget.getTargetDataString()), InstrInfo(*this), FrameInfo(*this), |