The various "getModuleMatchQuality" implementations should return
zero if they see a target triple they don't understand.
llvm-svn: 38463
diff --git a/llvm/lib/Target/Mips/MipsTargetMachine.cpp b/llvm/lib/Target/Mips/MipsTargetMachine.cpp
index de30284..a85833e 100644
--- a/llvm/lib/Target/Mips/MipsTargetMachine.cpp
+++ b/llvm/lib/Target/Mips/MipsTargetMachine.cpp
@@ -40,13 +40,14 @@
// return 0 and must specify -march to gen MIPS code.
unsigned MipsTargetMachine::
-getModuleMatchQuality(const Module &M)
-{
+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 the target triple is something non-mips, we don't match.
+ if (!TT.empty()) return 0;
+
return 0;
}