diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-26 02:22:58 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-26 02:22:58 +0000 |
commit | bfa8b2c02c927c58f8a0a4b1ff8c04d7eb747069 (patch) | |
tree | 2a8122cc81a121aaf66245f276761d12dd92bca0 /lib/Target | |
parent | 48224ee5385b03a49ecf34a7c9e3ab73fe32cdb3 (diff) | |
download | external_llvm-bfa8b2c02c927c58f8a0a4b1ff8c04d7eb747069.zip external_llvm-bfa8b2c02c927c58f8a0a4b1ff8c04d7eb747069.tar.gz external_llvm-bfa8b2c02c927c58f8a0a4b1ff8c04d7eb747069.tar.bz2 |
Kill Target specific ModuleMatchQuality stuff.
- This was overkill and inconsistently implemented.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77114 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp | 38 | ||||
-rw-r--r-- | lib/Target/Alpha/TargetInfo/AlphaTargetInfo.cpp | 19 | ||||
-rw-r--r-- | lib/Target/CBackend/TargetInfo/CBackendTargetInfo.cpp | 9 | ||||
-rw-r--r-- | lib/Target/CellSPU/TargetInfo/CellSPUTargetInfo.cpp | 14 | ||||
-rw-r--r-- | lib/Target/CppBackend/TargetInfo/CppBackendTargetInfo.cpp | 8 | ||||
-rw-r--r-- | lib/Target/MSIL/TargetInfo/MSILTargetInfo.cpp | 8 | ||||
-rw-r--r-- | lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp | 14 | ||||
-rw-r--r-- | lib/Target/Mips/TargetInfo/MipsTargetInfo.cpp | 28 | ||||
-rw-r--r-- | lib/Target/PIC16/TargetInfo/PIC16TargetInfo.cpp | 14 | ||||
-rw-r--r-- | lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp | 38 | ||||
-rw-r--r-- | lib/Target/Sparc/TargetInfo/SparcTargetInfo.cpp | 31 | ||||
-rw-r--r-- | lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.cpp | 12 | ||||
-rw-r--r-- | lib/Target/X86/TargetInfo/X86TargetInfo.cpp | 38 | ||||
-rw-r--r-- | lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp | 12 |
14 files changed, 12 insertions, 271 deletions
diff --git a/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp b/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp index a9f99e0..a975a1c 100644 --- a/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp +++ b/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp @@ -23,24 +23,6 @@ static unsigned ARM_TripleMatchQuality(const std::string &TT) { return 0; } -static unsigned ARM_ModuleMatchQuality(const Module &M) { - // Check for a triple match. - if (unsigned Q = ARM_TripleMatchQuality(M.getTargetTriple())) - return Q; - - // Otherwise if the target triple is non-empty, we don't match. - if (!M.getTargetTriple().empty()) return 0; - - if (M.getEndianness() == Module::LittleEndian && - M.getPointerSize() == Module::Pointer32) - return 10; // Weak match - else if (M.getEndianness() != Module::AnyEndianness || - M.getPointerSize() != Module::AnyPointerSize) - return 0; // Match for some other target - - return 0; -} - Target llvm::TheThumbTarget; static unsigned Thumb_TripleMatchQuality(const std::string &TT) { @@ -52,34 +34,14 @@ static unsigned Thumb_TripleMatchQuality(const std::string &TT) { return 0; } -static unsigned Thumb_ModuleMatchQuality(const Module &M) { - // Check for a triple match. - if (unsigned Q = Thumb_TripleMatchQuality(M.getTargetTriple())) - return Q; - - // Otherwise if the target triple is non-empty, we don't match. - if (!M.getTargetTriple().empty()) return 0; - - if (M.getEndianness() == Module::LittleEndian && - M.getPointerSize() == Module::Pointer32) - return 10; // Weak match - else if (M.getEndianness() != Module::AnyEndianness || - M.getPointerSize() != Module::AnyPointerSize) - return 0; // Match for some other target - - return 0; -} - extern "C" void LLVMInitializeARMTargetInfo() { TargetRegistry::RegisterTarget(TheARMTarget, "arm", "ARM", &ARM_TripleMatchQuality, - &ARM_ModuleMatchQuality, /*HasJIT=*/true); TargetRegistry::RegisterTarget(TheThumbTarget, "thumb", "Thumb", &Thumb_TripleMatchQuality, - &Thumb_ModuleMatchQuality, /*HasJIT=*/true); } diff --git a/lib/Target/Alpha/TargetInfo/AlphaTargetInfo.cpp b/lib/Target/Alpha/TargetInfo/AlphaTargetInfo.cpp index f148506..1e4db94 100644 --- a/lib/Target/Alpha/TargetInfo/AlphaTargetInfo.cpp +++ b/lib/Target/Alpha/TargetInfo/AlphaTargetInfo.cpp @@ -23,28 +23,9 @@ static unsigned Alpha_TripleMatchQuality(const std::string &TT) { return 0; } -static unsigned Alpha_ModuleMatchQuality(const Module &M) { - // Check for a triple match. - if (unsigned Q = Alpha_TripleMatchQuality(M.getTargetTriple())) - return Q; - - // Otherwise if the target triple is non-empty, we don't match. - if (!M.getTargetTriple().empty()) return 0; - - if (M.getEndianness() == Module::LittleEndian && - M.getPointerSize() == Module::Pointer64) - return 10; // Weak match - else if (M.getEndianness() != Module::AnyEndianness || - M.getPointerSize() != Module::AnyPointerSize) - return 0; // Match for some other target - - return 0; -} - extern "C" void LLVMInitializeAlphaTargetInfo() { TargetRegistry::RegisterTarget(TheAlphaTarget, "alpha", "Alpha [experimental]", &Alpha_TripleMatchQuality, - &Alpha_ModuleMatchQuality, /*HasJIT=*/true); } diff --git a/lib/Target/CBackend/TargetInfo/CBackendTargetInfo.cpp b/lib/Target/CBackend/TargetInfo/CBackendTargetInfo.cpp index 588833b..c30c84d 100644 --- a/lib/Target/CBackend/TargetInfo/CBackendTargetInfo.cpp +++ b/lib/Target/CBackend/TargetInfo/CBackendTargetInfo.cpp @@ -20,15 +20,8 @@ static unsigned CBackend_TripleMatchQuality(const std::string &TT) { return 0; } -static unsigned CBackend_ModuleMatchQuality(const Module &M) { - // This class always works, but must be requested explicitly on - // llc command line. - return 0; -} - extern "C" void LLVMInitializeCBackendTargetInfo() { TargetRegistry::RegisterTarget(TheCBackendTarget, "c", "C backend", - &CBackend_TripleMatchQuality, - &CBackend_ModuleMatchQuality); + &CBackend_TripleMatchQuality); } diff --git a/lib/Target/CellSPU/TargetInfo/CellSPUTargetInfo.cpp b/lib/Target/CellSPU/TargetInfo/CellSPUTargetInfo.cpp index 04171ec..ea3b8f9 100644 --- a/lib/Target/CellSPU/TargetInfo/CellSPUTargetInfo.cpp +++ b/lib/Target/CellSPU/TargetInfo/CellSPUTargetInfo.cpp @@ -25,20 +25,8 @@ static unsigned CellSPU_TripleMatchQuality(const std::string &TT) { return 0; } -static unsigned CellSPU_ModuleMatchQuality(const Module &M) { - // Check for a triple match. - if (unsigned Q = CellSPU_TripleMatchQuality(M.getTargetTriple())) - return Q; - - // Otherwise if the target triple is non-empty, we don't match. - if (!M.getTargetTriple().empty()) return 0; - - return 0; -} - extern "C" void LLVMInitializeCellSPUTargetInfo() { TargetRegistry::RegisterTarget(TheCellSPUTarget, "cellspu", "STI CBEA Cell SPU [experimental]", - &CellSPU_TripleMatchQuality, - &CellSPU_ModuleMatchQuality); + &CellSPU_TripleMatchQuality); } diff --git a/lib/Target/CppBackend/TargetInfo/CppBackendTargetInfo.cpp b/lib/Target/CppBackend/TargetInfo/CppBackendTargetInfo.cpp index d5b64f5..d0aeb12 100644 --- a/lib/Target/CppBackend/TargetInfo/CppBackendTargetInfo.cpp +++ b/lib/Target/CppBackend/TargetInfo/CppBackendTargetInfo.cpp @@ -19,14 +19,8 @@ static unsigned CppBackend_TripleMatchQuality(const std::string &TT) { return 1; } -static unsigned CppBackend_ModuleMatchQuality(const Module &M) { - // This class always works, but shouldn't be the default in most cases. - return 1; -} - extern "C" void LLVMInitializeCppBackendTargetInfo() { TargetRegistry::RegisterTarget(TheCppBackendTarget, "cpp", "C++ backend", - &CppBackend_TripleMatchQuality, - &CppBackend_ModuleMatchQuality); + &CppBackend_TripleMatchQuality); } diff --git a/lib/Target/MSIL/TargetInfo/MSILTargetInfo.cpp b/lib/Target/MSIL/TargetInfo/MSILTargetInfo.cpp index 07de726..dfd4281 100644 --- a/lib/Target/MSIL/TargetInfo/MSILTargetInfo.cpp +++ b/lib/Target/MSIL/TargetInfo/MSILTargetInfo.cpp @@ -19,14 +19,8 @@ static unsigned MSIL_TripleMatchQuality(const std::string &TT) { return 1; } -static unsigned MSIL_ModuleMatchQuality(const Module &M) { - // This class always works, but shouldn't be the default in most cases. - return 1; -} - extern "C" void LLVMInitializeMSILTargetInfo() { TargetRegistry::RegisterTarget(TheMSILTarget, "msil", "MSIL backend", - &MSIL_TripleMatchQuality, - &MSIL_ModuleMatchQuality); + &MSIL_TripleMatchQuality); } diff --git a/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp b/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp index eb3b865..e2a7123 100644 --- a/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp +++ b/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp @@ -23,20 +23,8 @@ static unsigned MSP430_TripleMatchQuality(const std::string &TT) { return 0; } -static unsigned MSP430_ModuleMatchQuality(const Module &M) { - // Check for a triple match. - if (unsigned Q = MSP430_TripleMatchQuality(M.getTargetTriple())) - return Q; - - // Otherwise if the target triple is non-empty, we don't match. - if (!M.getTargetTriple().empty()) return 0; - - return 0; -} - extern "C" void LLVMInitializeMSP430TargetInfo() { TargetRegistry::RegisterTarget(TheMSP430Target, "msp430", "MSP430 [experimental]", - &MSP430_TripleMatchQuality, - &MSP430_ModuleMatchQuality); + &MSP430_TripleMatchQuality); } diff --git a/lib/Target/Mips/TargetInfo/MipsTargetInfo.cpp b/lib/Target/Mips/TargetInfo/MipsTargetInfo.cpp index 35cbf8b..4f07545 100644 --- a/lib/Target/Mips/TargetInfo/MipsTargetInfo.cpp +++ b/lib/Target/Mips/TargetInfo/MipsTargetInfo.cpp @@ -26,17 +26,6 @@ static unsigned Mips_TripleMatchQuality(const std::string &TT) { return 0; } -static unsigned Mips_ModuleMatchQuality(const Module &M) { - // Check for a triple match. - if (unsigned Q = Mips_TripleMatchQuality(M.getTargetTriple())) - return Q; - - // Otherwise if the target triple is non-empty, we don't match. - if (!M.getTargetTriple().empty()) return 0; - - return 0; -} - Target llvm::TheMipselTarget; static unsigned Mipsel_TripleMatchQuality(const std::string &TT) { @@ -54,25 +43,12 @@ static unsigned Mipsel_TripleMatchQuality(const std::string &TT) { return 0; } -static unsigned Mipsel_ModuleMatchQuality(const Module &M) { - // Check for a triple match. - if (unsigned Q = Mipsel_TripleMatchQuality(M.getTargetTriple())) - return Q; - - // Otherwise if the target triple is non-empty, we don't match. - if (!M.getTargetTriple().empty()) return 0; - - return 0; -} - extern "C" void LLVMInitializeMipsTargetInfo() { TargetRegistry::RegisterTarget(TheMipsTarget, "mips", "Mips", - &Mips_TripleMatchQuality, - &Mips_ModuleMatchQuality); + &Mips_TripleMatchQuality); TargetRegistry::RegisterTarget(TheMipselTarget, "mipsel", "Mipsel", - &Mipsel_TripleMatchQuality, - &Mipsel_ModuleMatchQuality); + &Mipsel_TripleMatchQuality); } diff --git a/lib/Target/PIC16/TargetInfo/PIC16TargetInfo.cpp b/lib/Target/PIC16/TargetInfo/PIC16TargetInfo.cpp index 2a88fe5..87341b2 100644 --- a/lib/Target/PIC16/TargetInfo/PIC16TargetInfo.cpp +++ b/lib/Target/PIC16/TargetInfo/PIC16TargetInfo.cpp @@ -18,28 +18,18 @@ static unsigned PIC16_TripleMatchQuality(const std::string &TT) { return 0; } -static unsigned PIC16_ModuleMatchQuality(const Module &M) { - return 0; -} - Target llvm::TheCooperTarget; static unsigned Cooper_TripleMatchQuality(const std::string &TT) { return 0; } -static unsigned Cooper_ModuleMatchQuality(const Module &M) { - return 0; -} - extern "C" void LLVMInitializePIC16TargetInfo() { TargetRegistry::RegisterTarget(ThePIC16Target, "pic16", "PIC16 14-bit [experimental]", - &PIC16_TripleMatchQuality, - &PIC16_ModuleMatchQuality); + &PIC16_TripleMatchQuality); TargetRegistry::RegisterTarget(TheCooperTarget, "cooper", "PIC16 Cooper [experimental]", - &Cooper_TripleMatchQuality, - &Cooper_ModuleMatchQuality); + &Cooper_TripleMatchQuality); } diff --git a/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp b/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp index 3d25dad..7fc73c1 100644 --- a/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp +++ b/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp @@ -22,24 +22,6 @@ static unsigned PPC32_TripleMatchQuality(const std::string &TT) { return 0; } -static unsigned PPC32_ModuleMatchQuality(const Module &M) { - // Check for a triple match. - if (unsigned Q = PPC32_TripleMatchQuality(M.getTargetTriple())) - return Q; - - // Otherwise if the target triple is non-empty, we don't match. - if (!M.getTargetTriple().empty()) return 0; - - if (M.getEndianness() == Module::BigEndian && - M.getPointerSize() == Module::Pointer64) - return 10; // Weak match - else if (M.getEndianness() != Module::AnyEndianness || - M.getPointerSize() != Module::AnyPointerSize) - return 0; // Match for some other target - - return 0; -} - Target llvm::ThePPC64Target; static unsigned PPC64_TripleMatchQuality(const std::string &TT) { @@ -50,34 +32,14 @@ static unsigned PPC64_TripleMatchQuality(const std::string &TT) { return 0; } -static unsigned PPC64_ModuleMatchQuality(const Module &M) { - // Check for a triple match. - if (unsigned Q = PPC64_TripleMatchQuality(M.getTargetTriple())) - return Q; - - // Otherwise if the target triple is non-empty, we don't match. - if (!M.getTargetTriple().empty()) return 0; - - if (M.getEndianness() == Module::BigEndian && - M.getPointerSize() == Module::Pointer64) - return 10; // Weak match - else if (M.getEndianness() != Module::AnyEndianness || - M.getPointerSize() != Module::AnyPointerSize) - return 0; // Match for some other target - - return 0; -} - extern "C" void LLVMInitializePowerPCTargetInfo() { TargetRegistry::RegisterTarget(ThePPC32Target, "ppc32", "PowerPC 32", &PPC32_TripleMatchQuality, - &PPC32_ModuleMatchQuality, /*HasJIT=*/true); TargetRegistry::RegisterTarget(ThePPC64Target, "ppc64", "PowerPC 64", &PPC64_TripleMatchQuality, - &PPC64_ModuleMatchQuality, /*HasJIT=*/true); } diff --git a/lib/Target/Sparc/TargetInfo/SparcTargetInfo.cpp b/lib/Target/Sparc/TargetInfo/SparcTargetInfo.cpp index a2f1e5d..451a864 100644 --- a/lib/Target/Sparc/TargetInfo/SparcTargetInfo.cpp +++ b/lib/Target/Sparc/TargetInfo/SparcTargetInfo.cpp @@ -21,37 +21,8 @@ static unsigned Sparc_TripleMatchQuality(const std::string &TT) { return 0; } -static unsigned Sparc_ModuleMatchQuality(const Module &M) { - // Check for a triple match. - if (unsigned Q = Sparc_TripleMatchQuality(M.getTargetTriple())) - return Q; - - // Otherwise if the target triple is non-empty, we don't match. - if (!M.getTargetTriple().empty()) return 0; - - // FIXME: This is bad, the target matching algorithm shouldn't depend on the - // host. - if (M.getEndianness() == Module::BigEndian && - M.getPointerSize() == Module::Pointer32) -#ifdef __sparc__ - return 20; // BE/32 ==> Prefer sparc on sparc -#else - return 5; // BE/32 ==> Prefer ppc elsewhere -#endif - else if (M.getEndianness() != Module::AnyEndianness || - M.getPointerSize() != Module::AnyPointerSize) - return 0; // Match for some other target - -#if defined(__sparc__) - return 10; -#else - return 0; -#endif -} - extern "C" void LLVMInitializeSparcTargetInfo() { TargetRegistry::RegisterTarget(TheSparcTarget, "sparc", "Sparc", - &Sparc_TripleMatchQuality, - &Sparc_ModuleMatchQuality); + &Sparc_TripleMatchQuality); } diff --git a/lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.cpp b/lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.cpp index 49c8e19..e063a91 100644 --- a/lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.cpp +++ b/lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.cpp @@ -23,18 +23,8 @@ static unsigned SystemZ_TripleMatchQuality(const std::string &TT) { return 0; } -static unsigned SystemZ_ModuleMatchQuality(const Module &M) { - // Check for a triple match. - if (unsigned Q = SystemZ_TripleMatchQuality(M.getTargetTriple())) - return Q; - - // Otherwise we don't match. - return 0; -} - extern "C" void LLVMInitializeSystemZTargetInfo() { TargetRegistry::RegisterTarget(TheSystemZTarget, "systemz", "SystemZ", - &SystemZ_TripleMatchQuality, - &SystemZ_ModuleMatchQuality); + &SystemZ_TripleMatchQuality); } diff --git a/lib/Target/X86/TargetInfo/X86TargetInfo.cpp b/lib/Target/X86/TargetInfo/X86TargetInfo.cpp index 6201002..d371bce 100644 --- a/lib/Target/X86/TargetInfo/X86TargetInfo.cpp +++ b/lib/Target/X86/TargetInfo/X86TargetInfo.cpp @@ -23,24 +23,6 @@ static unsigned X86_32_TripleMatchQuality(const std::string &TT) { return 0; } -static unsigned X86_32_ModuleMatchQuality(const Module &M) { - // Check for a triple match. - if (unsigned Q = X86_32_TripleMatchQuality(M.getTargetTriple())) - return Q; - - // If the target triple is something non-X86, we don't match. - if (!M.getTargetTriple().empty()) return 0; - - if (M.getEndianness() == Module::LittleEndian && - M.getPointerSize() == Module::Pointer32) - return 10; // Weak match - else if (M.getEndianness() != Module::AnyEndianness || - M.getPointerSize() != Module::AnyPointerSize) - return 0; // Match for some other target - - return 0; -} - Target llvm::TheX86_64Target; static unsigned X86_64_TripleMatchQuality(const std::string &TT) { @@ -52,34 +34,14 @@ static unsigned X86_64_TripleMatchQuality(const std::string &TT) { return 0; } -static unsigned X86_64_ModuleMatchQuality(const Module &M) { - // Check for a triple match. - if (unsigned Q = X86_64_TripleMatchQuality(M.getTargetTriple())) - return Q; - - // If the target triple is something non-X86-64, we don't match. - if (!M.getTargetTriple().empty()) return 0; - - if (M.getEndianness() == Module::LittleEndian && - M.getPointerSize() == Module::Pointer64) - return 10; // Weak match - else if (M.getEndianness() != Module::AnyEndianness || - M.getPointerSize() != Module::AnyPointerSize) - return 0; // Match for some other target - - return 0; -} - extern "C" void LLVMInitializeX86TargetInfo() { TargetRegistry::RegisterTarget(TheX86_32Target, "x86", "32-bit X86: Pentium-Pro and above", &X86_32_TripleMatchQuality, - &X86_32_ModuleMatchQuality, /*HasJIT=*/true); TargetRegistry::RegisterTarget(TheX86_64Target, "x86-64", "64-bit X86: EM64T and AMD64", &X86_64_TripleMatchQuality, - &X86_64_ModuleMatchQuality, /*HasJIT=*/true); } diff --git a/lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp b/lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp index 48ad484..17acb32 100644 --- a/lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp +++ b/lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp @@ -21,18 +21,8 @@ static unsigned XCore_TripleMatchQuality(const std::string &TT) { return 0; } -static unsigned XCore_ModuleMatchQuality(const Module &M) { - // Check for a triple match. - if (unsigned Q = XCore_TripleMatchQuality(M.getTargetTriple())) - return Q; - - // Otherwise we don't match. - return 0; -} - extern "C" void LLVMInitializeXCoreTargetInfo() { TargetRegistry::RegisterTarget(TheXCoreTarget, "xcore", "XCore", - &XCore_TripleMatchQuality, - &XCore_ModuleMatchQuality); + &XCore_TripleMatchQuality); } |