diff options
author | Simon Atanasyan <simon@atanasyan.com> | 2016-05-22 15:28:34 +0000 |
---|---|---|
committer | Simon Atanasyan <simon@atanasyan.com> | 2016-05-22 15:28:34 +0000 |
commit | 4f3fe5b1a6c0bc555d39d4847a9573c1060e045a (patch) | |
tree | b7650d724e5cb1bf0bcda1afc4b17e5231e986f2 /clang/lib/Driver | |
parent | [driver][mips] Rename some variables to better reflect their purpose. NFC (diff) | |
download | llvm-project-4f3fe5b1a6c0bc555d39d4847a9573c1060e045a.tar.gz llvm-project-4f3fe5b1a6c0bc555d39d4847a9573c1060e045a.tar.bz2 llvm-project-4f3fe5b1a6c0bc555d39d4847a9573c1060e045a.zip |
[driver][mips] Use target triple mips-mti-linux-gnu for toolchain detection
llvm-svn: 270368
Diffstat (limited to 'clang/lib/Driver')
-rw-r--r-- | clang/lib/Driver/ToolChains.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp index 2871249e8963..a74a750b56fa 100644 --- a/clang/lib/Driver/ToolChains.cpp +++ b/clang/lib/Driver/ToolChains.cpp @@ -2055,6 +2055,17 @@ static bool findMIPSMultilibs(const Driver &D, const llvm::Triple &TargetTriple, return false; } + if (TargetTriple.getVendor() == llvm::Triple::MipsTechnologies && + TargetTriple.getOS() == llvm::Triple::Linux && + TargetTriple.getEnvironment() == llvm::Triple::GNU) { + // Select mips-mti-linux-gnu toolchain. + if (MtiMipsMultilibsV1.select(Flags, Result.SelectedMultilib)) { + Result.Multilibs = MtiMipsMultilibsV1; + return true; + } + return false; + } + if (TargetTriple.getVendor() == llvm::Triple::ImaginationTechnologies && TargetTriple.getOS() == llvm::Triple::Linux && TargetTriple.getEnvironment() == llvm::Triple::GNU) { @@ -2066,19 +2077,10 @@ static bool findMIPSMultilibs(const Driver &D, const llvm::Triple &TargetTriple, return false; } - // Sort candidates. Toolchain that best meets the directories goes first. - // Then select the first toolchains matches command line flags. - MultilibSet *candidates[] = {&DebianMipsMultilibs, &MtiMipsMultilibsV1}; - std::sort( - std::begin(candidates), std::end(candidates), - [](MultilibSet *a, MultilibSet *b) { return a->size() > b->size(); }); - for (const auto &candidate : candidates) { - if (candidate->select(Flags, Result.SelectedMultilib)) { - if (candidate == &DebianMipsMultilibs) - Result.BiarchSibling = Multilib(); - Result.Multilibs = *candidate; - return true; - } + if (DebianMipsMultilibs.select(Flags, Result.SelectedMultilib)) { + Result.BiarchSibling = Multilib(); + Result.Multilibs = DebianMipsMultilibs; + return true; } { |