diff options
author | Chris Lattner <sabre@nondot.org> | 2007-07-09 17:25:29 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-07-09 17:25:29 +0000 |
commit | 87bdba6d6a1684373c94df0363a3b620de6dab6c (patch) | |
tree | cd7dc95b8104d684c9beb8a7e9e34111aa5baf0d /lib/Target/Mips/MipsTargetMachine.cpp | |
parent | 0f9d599dc96c61345a3e07642baaa5cffb061600 (diff) |
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
Diffstat (limited to 'lib/Target/Mips/MipsTargetMachine.cpp')
-rw-r--r-- | lib/Target/Mips/MipsTargetMachine.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Target/Mips/MipsTargetMachine.cpp b/lib/Target/Mips/MipsTargetMachine.cpp index de30284e01..a85833ebc0 100644 --- a/lib/Target/Mips/MipsTargetMachine.cpp +++ b/lib/Target/Mips/MipsTargetMachine.cpp @@ -40,13 +40,14 @@ MipsTargetMachine(const Module &M, const std::string &FS): // 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; } |