summaryrefslogtreecommitdiff
path: root/lib/Target
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-15 12:26:05 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-15 12:26:05 +0000
commit6c05796294a7a0693d96c0c87194b9d5ddf55a94 (patch)
tree6e3df28150e17cf51770f295102f4533ecd75868 /lib/Target
parentbaaf1178e94d8e70736c2c0266433633392d4507 (diff)
downloadllvm-6c05796294a7a0693d96c0c87194b9d5ddf55a94.tar.gz
llvm-6c05796294a7a0693d96c0c87194b9d5ddf55a94.tar.bz2
llvm-6c05796294a7a0693d96c0c87194b9d5ddf55a94.tar.xz
Kill off old (TargetMachine level, not Target level) match quality functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75780 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/ARM/ARMTargetMachine.cpp55
-rw-r--r--lib/Target/ARM/ARMTargetMachine.h3
-rw-r--r--lib/Target/Alpha/AlphaTargetMachine.cpp27
-rw-r--r--lib/Target/Alpha/AlphaTargetMachine.h3
-rw-r--r--lib/Target/CBackend/CTargetMachine.h4
-rw-r--r--lib/Target/CellSPU/SPUTargetMachine.cpp14
-rw-r--r--lib/Target/CellSPU/SPUTargetMachine.h6
-rw-r--r--lib/Target/CppBackend/CPPTargetMachine.h3
-rw-r--r--lib/Target/IA64/IA64TargetMachine.cpp26
-rw-r--r--lib/Target/IA64/IA64TargetMachine.h2
-rw-r--r--lib/Target/MSP430/MSP430TargetMachine.cpp11
-rw-r--r--lib/Target/MSP430/MSP430TargetMachine.h1
-rw-r--r--lib/Target/Mips/MipsTargetMachine.cpp35
-rw-r--r--lib/Target/Mips/MipsTargetMachine.h2
-rw-r--r--lib/Target/PowerPC/PPCTargetMachine.cpp51
-rw-r--r--lib/Target/PowerPC/PPCTargetMachine.h6
-rw-r--r--lib/Target/Sparc/SparcTargetMachine.cpp26
-rw-r--r--lib/Target/Sparc/SparcTargetMachine.h1
-rw-r--r--lib/Target/X86/X86TargetMachine.cpp58
-rw-r--r--lib/Target/X86/X86TargetMachine.h3
-rw-r--r--lib/Target/XCore/XCoreTargetMachine.cpp9
-rw-r--r--lib/Target/XCore/XCoreTargetMachine.h1
22 files changed, 0 insertions, 347 deletions
diff --git a/lib/Target/ARM/ARMTargetMachine.cpp b/lib/Target/ARM/ARMTargetMachine.cpp
index 32e8c85698..78b2f8aa53 100644
--- a/lib/Target/ARM/ARMTargetMachine.cpp
+++ b/lib/Target/ARM/ARMTargetMachine.cpp
@@ -48,35 +48,6 @@ extern "C" void LLVMInitializeARMTarget() { }
// No assembler printer by default
ARMBaseTargetMachine::AsmPrinterCtorFn ARMBaseTargetMachine::AsmPrinterCtor = 0;
-/// ThumbTargetMachine - Create an Thumb architecture model.
-///
-unsigned ThumbTargetMachine::getJITMatchQuality() {
-#if defined(__thumb__)
- return 10;
-#endif
- return 0;
-}
-
-unsigned ThumbTargetMachine::getModuleMatchQuality(const Module &M) {
- std::string TT = M.getTargetTriple();
- // Match thumb-foo-bar, as well as things like thumbv5blah-*
- if (TT.size() >= 6 &&
- (TT.substr(0, 6) == "thumb-" || TT.substr(0, 6) == "thumbv"))
- return 20;
-
- // If the target triple is something non-thumb, we don't match.
- if (!TT.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 getJITMatchQuality()/2;
-}
-
/// TargetMachine ctor - Create an ARM architecture model.
///
ARMBaseTargetMachine::ARMBaseTargetMachine(const Target &T,
@@ -116,32 +87,6 @@ ThumbTargetMachine::ThumbTargetMachine(const Target &T, const Module &M,
InstrInfo = new Thumb1InstrInfo(Subtarget);
}
-unsigned ARMTargetMachine::getJITMatchQuality() {
-#if defined(__arm__)
- return 10;
-#endif
- return 0;
-}
-
-unsigned ARMTargetMachine::getModuleMatchQuality(const Module &M) {
- std::string TT = M.getTargetTriple();
- // Match arm-foo-bar, as well as things like armv5blah-*
- if (TT.size() >= 4 &&
- (TT.substr(0, 4) == "arm-" || TT.substr(0, 4) == "armv"))
- return 20;
- // If the target triple is something non-arm, we don't match.
- if (!TT.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 getJITMatchQuality()/2;
-}
-
const TargetAsmInfo *ARMBaseTargetMachine::createTargetAsmInfo() const {
switch (Subtarget.TargetType) {
diff --git a/lib/Target/ARM/ARMTargetMachine.h b/lib/Target/ARM/ARMTargetMachine.h
index be469e1946..3fe259ad08 100644
--- a/lib/Target/ARM/ARMTargetMachine.h
+++ b/lib/Target/ARM/ARMTargetMachine.h
@@ -61,9 +61,6 @@ public:
AsmPrinterCtor = F;
}
- static unsigned getModuleMatchQuality(const Module &M);
- static unsigned getJITMatchQuality();
-
virtual const TargetAsmInfo *createTargetAsmInfo() const;
// Pass Pipeline Configuration
diff --git a/lib/Target/Alpha/AlphaTargetMachine.cpp b/lib/Target/Alpha/AlphaTargetMachine.cpp
index 9725b53274..a7a8162c12 100644
--- a/lib/Target/Alpha/AlphaTargetMachine.cpp
+++ b/lib/Target/Alpha/AlphaTargetMachine.cpp
@@ -36,33 +36,6 @@ const TargetAsmInfo *AlphaTargetMachine::createTargetAsmInfo() const {
return new AlphaTargetAsmInfo(*this);
}
-unsigned AlphaTargetMachine::getModuleMatchQuality(const Module &M) {
- // We strongly match "alpha*".
- std::string TT = M.getTargetTriple();
- if (TT.size() >= 5 && TT[0] == 'a' && TT[1] == 'l' && TT[2] == 'p' &&
- TT[3] == 'h' && TT[4] == 'a')
- return 20;
- // If the target triple is something non-alpha, we don't match.
- if (!TT.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 getJITMatchQuality()/2;
-}
-
-unsigned AlphaTargetMachine::getJITMatchQuality() {
-#ifdef __alpha
- return 10;
-#else
- return 0;
-#endif
-}
-
AlphaTargetMachine::AlphaTargetMachine(const Target &T, const Module &M,
const std::string &FS)
: LLVMTargetMachine(T),
diff --git a/lib/Target/Alpha/AlphaTargetMachine.h b/lib/Target/Alpha/AlphaTargetMachine.h
index e5e69b2931..6125ce57fc 100644
--- a/lib/Target/Alpha/AlphaTargetMachine.h
+++ b/lib/Target/Alpha/AlphaTargetMachine.h
@@ -61,9 +61,6 @@ public:
return &JITInfo;
}
- static unsigned getJITMatchQuality();
- static unsigned getModuleMatchQuality(const Module &M);
-
// Pass Pipeline Configuration
virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
diff --git a/lib/Target/CBackend/CTargetMachine.h b/lib/Target/CBackend/CTargetMachine.h
index 3aa456c035..b1d9e0775e 100644
--- a/lib/Target/CBackend/CTargetMachine.h
+++ b/lib/Target/CBackend/CTargetMachine.h
@@ -30,10 +30,6 @@ struct CTargetMachine : public TargetMachine {
formatted_raw_ostream &Out,
CodeGenFileType FileType,
CodeGenOpt::Level OptLevel);
-
- // This class always works, but must be requested explicitly on
- // llc command line.
- static unsigned getModuleMatchQuality(const Module &M) { return 0; }
virtual const TargetData *getTargetData() const { return &DataLayout; }
};
diff --git a/lib/Target/CellSPU/SPUTargetMachine.cpp b/lib/Target/CellSPU/SPUTargetMachine.cpp
index 8c74385a7e..3a659d8e4d 100644
--- a/lib/Target/CellSPU/SPUTargetMachine.cpp
+++ b/lib/Target/CellSPU/SPUTargetMachine.cpp
@@ -48,20 +48,6 @@ 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 Target &T, const Module &M,
const std::string &FS)
: LLVMTargetMachine(T),
diff --git a/lib/Target/CellSPU/SPUTargetMachine.h b/lib/Target/CellSPU/SPUTargetMachine.h
index 1b328973c4..18f525d1c8 100644
--- a/lib/Target/CellSPU/SPUTargetMachine.h
+++ b/lib/Target/CellSPU/SPUTargetMachine.h
@@ -66,12 +66,6 @@ public:
virtual TargetJITInfo *getJITInfo() {
return NULL;
}
-
- //! Module match function
- /*!
- Module matching function called by TargetMachineRegistry().
- */
- static unsigned getModuleMatchQuality(const Module &M);
virtual SPUTargetLowering *getTargetLowering() const {
return const_cast<SPUTargetLowering*>(&TLInfo);
diff --git a/lib/Target/CppBackend/CPPTargetMachine.h b/lib/Target/CppBackend/CPPTargetMachine.h
index 558a9a1aee..4d6d5fe35d 100644
--- a/lib/Target/CppBackend/CPPTargetMachine.h
+++ b/lib/Target/CppBackend/CPPTargetMachine.h
@@ -33,9 +33,6 @@ struct CPPTargetMachine : public TargetMachine {
CodeGenFileType FileType,
CodeGenOpt::Level OptLevel);
- // This class always works, but shouldn't be the default in most cases.
- static unsigned getModuleMatchQuality(const Module &M) { return 1; }
-
virtual const TargetData *getTargetData() const { return &DataLayout; }
};
diff --git a/lib/Target/IA64/IA64TargetMachine.cpp b/lib/Target/IA64/IA64TargetMachine.cpp
index f369f53a3f..5355075f8b 100644
--- a/lib/Target/IA64/IA64TargetMachine.cpp
+++ b/lib/Target/IA64/IA64TargetMachine.cpp
@@ -34,32 +34,6 @@ const TargetAsmInfo *IA64TargetMachine::createTargetAsmInfo() const {
return new IA64TargetAsmInfo(*this);
}
-unsigned IA64TargetMachine::getModuleMatchQuality(const Module &M) {
- // we match [iI][aA]*64
- bool seenIA64=false;
- std::string TT = M.getTargetTriple();
-
- if (TT.size() >= 4) {
- if( (TT[0]=='i' || TT[0]=='I') &&
- (TT[1]=='a' || TT[1]=='A') ) {
- for(unsigned int i=2; i<(TT.size()-1); i++)
- if(TT[i]=='6' && TT[i+1]=='4')
- seenIA64=true;
- }
-
- if (seenIA64)
- return 20; // strong match
- }
- // If the target triple is something non-ia64, we don't match.
- if (!TT.empty()) return 0;
-
-#if defined(__ia64__) || defined(__IA64__)
- return 5;
-#else
- return 0;
-#endif
-}
-
/// IA64TargetMachine ctor - Create an LP64 architecture model
///
IA64TargetMachine::IA64TargetMachine(const Target &T, const Module &M,
diff --git a/lib/Target/IA64/IA64TargetMachine.h b/lib/Target/IA64/IA64TargetMachine.h
index 4da2a94291..e82bf59c96 100644
--- a/lib/Target/IA64/IA64TargetMachine.h
+++ b/lib/Target/IA64/IA64TargetMachine.h
@@ -55,8 +55,6 @@ public:
}
virtual const TargetData *getTargetData() const { return &DataLayout; }
- static unsigned getModuleMatchQuality(const Module &M);
-
// Pass Pipeline Configuration
virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
diff --git a/lib/Target/MSP430/MSP430TargetMachine.cpp b/lib/Target/MSP430/MSP430TargetMachine.cpp
index 2c8bfc7470..bf259e2add 100644
--- a/lib/Target/MSP430/MSP430TargetMachine.cpp
+++ b/lib/Target/MSP430/MSP430TargetMachine.cpp
@@ -69,14 +69,3 @@ bool MSP430TargetMachine::addAssemblyEmitter(PassManagerBase &PM,
return false;
}
-unsigned MSP430TargetMachine::getModuleMatchQuality(const Module &M) {
- std::string TT = M.getTargetTriple();
-
- // We strongly match msp430
- if (TT.size() >= 6 && TT[0] == 'm' && TT[1] == 's' && TT[2] == 'p' &&
- TT[3] == '4' && TT[4] == '3' && TT[5] == '0')
- return 20;
-
- return 0;
-}
-
diff --git a/lib/Target/MSP430/MSP430TargetMachine.h b/lib/Target/MSP430/MSP430TargetMachine.h
index fa5ef66b5c..dfe827b0c6 100644
--- a/lib/Target/MSP430/MSP430TargetMachine.h
+++ b/lib/Target/MSP430/MSP430TargetMachine.h
@@ -60,7 +60,6 @@ public:
virtual bool addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel, bool Verbose,
formatted_raw_ostream &Out);
- static unsigned getModuleMatchQuality(const Module &M);
}; // MSP430TargetMachine.
} // end namespace llvm
diff --git a/lib/Target/Mips/MipsTargetMachine.cpp b/lib/Target/Mips/MipsTargetMachine.cpp
index ed445f15d4..3c2693bf16 100644
--- a/lib/Target/Mips/MipsTargetMachine.cpp
+++ b/lib/Target/Mips/MipsTargetMachine.cpp
@@ -79,41 +79,6 @@ MipselTargetMachine::
MipselTargetMachine(const Target &T, const Module &M, const std::string &FS) :
MipsTargetMachine(T, M, FS, true) {}
-// return 0 and must specify -march to gen MIPS code.
-unsigned MipsTargetMachine::
-getModuleMatchQuality(const Module &M)
-{
- // We strongly match "mips*-*".
- std::string TT = M.getTargetTriple();
- if (TT.size() >= 5 && std::string(TT.begin(), TT.begin()+5) == "mips-")
- return 20;
-
- if (TT.size() >= 13 && std::string(TT.begin(),
- TT.begin()+13) == "mipsallegrex-")
- return 20;
-
- return 0;
-}
-
-// return 0 and must specify -march to gen MIPSEL code.
-unsigned MipselTargetMachine::
-getModuleMatchQuality(const Module &M)
-{
- // We strongly match "mips*el-*".
- std::string TT = M.getTargetTriple();
- if (TT.size() >= 7 && std::string(TT.begin(), TT.begin()+7) == "mipsel-")
- return 20;
-
- if (TT.size() >= 15 && std::string(TT.begin(),
- TT.begin()+15) == "mipsallegrexel-")
- return 20;
-
- if (TT.size() == 3 && std::string(TT.begin(), TT.begin()+3) == "psp")
- return 20;
-
- return 0;
-}
-
// Install an instruction selector pass using
// the ISelDag to gen Mips code.
bool MipsTargetMachine::
diff --git a/lib/Target/Mips/MipsTargetMachine.h b/lib/Target/Mips/MipsTargetMachine.h
index 079d1fa88c..6e2562a312 100644
--- a/lib/Target/Mips/MipsTargetMachine.h
+++ b/lib/Target/Mips/MipsTargetMachine.h
@@ -67,8 +67,6 @@ namespace llvm {
return const_cast<MipsTargetLowering*>(&TLInfo);
}
- static unsigned getModuleMatchQuality(const Module &M);
-
// Pass Pipeline Configuration
virtual bool addInstSelector(PassManagerBase &PM,
CodeGenOpt::Level OptLevel);
diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
index 914d6728c6..140734a187 100644
--- a/lib/Target/PowerPC/PPCTargetMachine.cpp
+++ b/lib/Target/PowerPC/PPCTargetMachine.cpp
@@ -51,57 +51,6 @@ const TargetAsmInfo *PPCTargetMachine::createTargetAsmInfo() const {
return new PPCLinuxTargetAsmInfo(*this);
}
-unsigned PPC32TargetMachine::getJITMatchQuality() {
-#if defined(__POWERPC__) || defined (__ppc__) || defined(_POWER) || defined(__PPC__)
- if (sizeof(void*) == 4)
- return 10;
-#endif
- return 0;
-}
-unsigned PPC64TargetMachine::getJITMatchQuality() {
-#if defined(__POWERPC__) || defined (__ppc__) || defined(_POWER) || defined(__PPC__)
- if (sizeof(void*) == 8)
- return 10;
-#endif
- return 0;
-}
-
-unsigned PPC32TargetMachine::getModuleMatchQuality(const Module &M) {
- // We strongly match "powerpc-*".
- std::string TT = M.getTargetTriple();
- if (TT.size() >= 8 && std::string(TT.begin(), TT.begin()+8) == "powerpc-")
- return 20;
-
- // If the target triple is something non-powerpc, we don't match.
- if (!TT.empty()) return 0;
-
- if (M.getEndianness() == Module::BigEndian &&
- 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 getJITMatchQuality()/2;
-}
-
-unsigned PPC64TargetMachine::getModuleMatchQuality(const Module &M) {
- // We strongly match "powerpc64-*".
- std::string TT = M.getTargetTriple();
- if (TT.size() >= 10 && std::string(TT.begin(), TT.begin()+10) == "powerpc64-")
- return 20;
-
- 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 getJITMatchQuality()/2;
-}
-
-
PPCTargetMachine::PPCTargetMachine(const Target&T, const Module &M,
const std::string &FS, bool is64Bit)
: LLVMTargetMachine(T),
diff --git a/lib/Target/PowerPC/PPCTargetMachine.h b/lib/Target/PowerPC/PPCTargetMachine.h
index c489751283..794123ad16 100644
--- a/lib/Target/PowerPC/PPCTargetMachine.h
+++ b/lib/Target/PowerPC/PPCTargetMachine.h
@@ -105,9 +105,6 @@ public:
class PPC32TargetMachine : public PPCTargetMachine {
public:
PPC32TargetMachine(const Target &T, const Module &M, const std::string &FS);
-
- static unsigned getJITMatchQuality();
- static unsigned getModuleMatchQuality(const Module &M);
};
/// PPC64TargetMachine - PowerPC 64-bit target machine.
@@ -115,9 +112,6 @@ public:
class PPC64TargetMachine : public PPCTargetMachine {
public:
PPC64TargetMachine(const Target &T, const Module &M, const std::string &FS);
-
- static unsigned getJITMatchQuality();
- static unsigned getModuleMatchQuality(const Module &M);
};
} // end namespace llvm
diff --git a/lib/Target/Sparc/SparcTargetMachine.cpp b/lib/Target/Sparc/SparcTargetMachine.cpp
index d877a15c07..2550363113 100644
--- a/lib/Target/Sparc/SparcTargetMachine.cpp
+++ b/lib/Target/Sparc/SparcTargetMachine.cpp
@@ -44,32 +44,6 @@ SparcTargetMachine::SparcTargetMachine(const Target &T, const Module &M,
FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0) {
}
-unsigned SparcTargetMachine::getModuleMatchQuality(const Module &M) {
- std::string TT = M.getTargetTriple();
- if (TT.size() >= 6 && std::string(TT.begin(), TT.begin()+6) == "sparc-")
- return 20;
-
- // If the target triple is something non-sparc, we don't match.
- if (!TT.empty()) return 0;
-
- 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
-}
-
bool SparcTargetMachine::addInstSelector(PassManagerBase &PM,
CodeGenOpt::Level OptLevel) {
PM.add(createSparcISelDag(*this));
diff --git a/lib/Target/Sparc/SparcTargetMachine.h b/lib/Target/Sparc/SparcTargetMachine.h
index 20dc2bd297..ca34b96365 100644
--- a/lib/Target/Sparc/SparcTargetMachine.h
+++ b/lib/Target/Sparc/SparcTargetMachine.h
@@ -55,7 +55,6 @@ public:
return const_cast<SparcTargetLowering*>(&TLInfo);
}
virtual const TargetData *getTargetData() const { return &DataLayout; }
- static unsigned getModuleMatchQuality(const Module &M);
// Pass Pipeline Configuration
virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp
index 9b0d23aa8f..9ea10db744 100644
--- a/lib/Target/X86/X86TargetMachine.cpp
+++ b/lib/Target/X86/X86TargetMachine.cpp
@@ -66,64 +66,6 @@ const TargetAsmInfo *X86TargetMachine::createTargetAsmInfo() const {
}
}
-unsigned X86_32TargetMachine::getJITMatchQuality() {
-#if defined(i386) || defined(__i386__) || defined(__x86__) || defined(_M_IX86)
- return 10;
-#endif
- return 0;
-}
-
-unsigned X86_64TargetMachine::getJITMatchQuality() {
-#if defined(__x86_64__) || defined(_M_AMD64)
- return 10;
-#endif
- return 0;
-}
-
-unsigned X86_32TargetMachine::getModuleMatchQuality(const Module &M) {
- // We strongly match "i[3-9]86-*".
- std::string TT = M.getTargetTriple();
- if (TT.size() >= 5 && TT[0] == 'i' && TT[2] == '8' && TT[3] == '6' &&
- TT[4] == '-' && TT[1] - '3' < 6)
- return 20;
- // If the target triple is something non-X86, we don't match.
- if (!TT.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 getJITMatchQuality()/2;
-}
-
-unsigned X86_64TargetMachine::getModuleMatchQuality(const Module &M) {
- // We strongly match "x86_64-*".
- std::string TT = M.getTargetTriple();
- if (TT.size() >= 7 && TT[0] == 'x' && TT[1] == '8' && TT[2] == '6' &&
- TT[3] == '_' && TT[4] == '6' && TT[5] == '4' && TT[6] == '-')
- return 20;
-
- // We strongly match "amd64-*".
- if (TT.size() >= 6 && TT[0] == 'a' && TT[1] == 'm' && TT[2] == 'd' &&
- TT[3] == '6' && TT[4] == '4' && TT[5] == '-')
- return 20;
-
- // If the target triple is something non-X86-64, we don't match.
- if (!TT.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 getJITMatchQuality()/2;
-}
-
X86_32TargetMachine::X86_32TargetMachine(const Target &T, const Module &M,
const std::string &FS)
: X86TargetMachine(T, M, FS, false) {
diff --git a/lib/Target/X86/X86TargetMachine.h b/lib/Target/X86/X86TargetMachine.h
index 13d6abde92..da6811bd23 100644
--- a/lib/Target/X86/X86TargetMachine.h
+++ b/lib/Target/X86/X86TargetMachine.h
@@ -67,9 +67,6 @@ public:
return Subtarget.isTargetELF() ? &ELFWriterInfo : 0;
}
- static unsigned getModuleMatchQuality(const Module &M);
- static unsigned getJITMatchQuality();
-
static void registerAsmPrinter(AsmPrinterCtorFn F) {
AsmPrinterCtor = F;
}
diff --git a/lib/Target/XCore/XCoreTargetMachine.cpp b/lib/Target/XCore/XCoreTargetMachine.cpp
index 46b0ec4e70..7fc869495a 100644
--- a/lib/Target/XCore/XCoreTargetMachine.cpp
+++ b/lib/Target/XCore/XCoreTargetMachine.cpp
@@ -52,15 +52,6 @@ XCoreTargetMachine::XCoreTargetMachine(const Target &T, const Module &M,
TLInfo(*this) {
}
-unsigned XCoreTargetMachine::getModuleMatchQuality(const Module &M) {
- std::string TT = M.getTargetTriple();
- if (TT.size() >= 6 && std::string(TT.begin(), TT.begin()+6) == "xcore-")
- return 20;
-
- // Otherwise we don't match.
- return 0;
-}
-
bool XCoreTargetMachine::addInstSelector(PassManagerBase &PM,
CodeGenOpt::Level OptLevel) {
PM.add(createXCoreISelDag(*this));
diff --git a/lib/Target/XCore/XCoreTargetMachine.h b/lib/Target/XCore/XCoreTargetMachine.h
index 179fb36e49..e88c81b9bb 100644
--- a/lib/Target/XCore/XCoreTargetMachine.h
+++ b/lib/Target/XCore/XCoreTargetMachine.h
@@ -49,7 +49,6 @@ public:
return &InstrInfo.getRegisterInfo();
}
virtual const TargetData *getTargetData() const { return &DataLayout; }
- static unsigned getModuleMatchQuality(const Module &M);
// Pass Pipeline Configuration
virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);