From 87bdba6d6a1684373c94df0363a3b620de6dab6c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 9 Jul 2007 17:25:29 +0000 Subject: The various "getModuleMatchQuality" implementations should return zero if they see a target triple they don't understand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38463 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Sparc/SparcTargetMachine.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/Target/Sparc') diff --git a/lib/Target/Sparc/SparcTargetMachine.cpp b/lib/Target/Sparc/SparcTargetMachine.cpp index ac43736..b67c300 100644 --- a/lib/Target/Sparc/SparcTargetMachine.cpp +++ b/lib/Target/Sparc/SparcTargetMachine.cpp @@ -39,6 +39,9 @@ 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) -- cgit v1.1