[clang] 8e2f5f9 - [Driver] Simplify mips multilib path and fix comments. NFC

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 28 00:30:44 PDT 2021


Author: Fangrui Song
Date: 2021-03-28T00:30:38-07:00
New Revision: 8e2f5f95b5432a6bce14c86a7f2de67fbb5f9dfc

URL: https://github.com/llvm/llvm-project/commit/8e2f5f95b5432a6bce14c86a7f2de67fbb5f9dfc
DIFF: https://github.com/llvm/llvm-project/commit/8e2f5f95b5432a6bce14c86a7f2de67fbb5f9dfc.diff

LOG: [Driver] Simplify mips multilib path and fix comments. NFC

Added: 
    

Modified: 
    clang/lib/Driver/ToolChains/Gnu.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
index 15be200655dc..7136df94c528 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2766,15 +2766,6 @@ bool Generic_GCC::IsIntegratedAssemblerDefault() const {
   }
 }
 
-static void addMultilibsFilePaths(const Driver &D, const MultilibSet &Multilibs,
-                                  const Multilib &Multilib,
-                                  StringRef InstallPath,
-                                  ToolChain::path_list &Paths) {
-  if (const auto &PathsCallback = Multilibs.filePathsCallback())
-    for (const auto &Path : PathsCallback(Multilib))
-      addPathIfExists(D, InstallPath + Path, Paths);
-}
-
 void Generic_GCC::PushPPaths(ToolChain::path_list &PPaths) {
   // Cross-compiling binutils and GCC installations (vanilla and openSUSE at
   // least) put various tools in a triple-prefixed directory off of the parent
@@ -2801,12 +2792,13 @@ void Generic_GCC::AddMultilibPaths(const Driver &D,
     const std::string &LibPath =
         std::string(GCCInstallation.getParentLibPath());
 
-    // Add toolchain / multilib specific file paths.
-    addMultilibsFilePaths(D, Multilibs, SelectedMultilib,
-                          GCCInstallation.getInstallPath(), Paths);
-
     // Sourcery CodeBench MIPS toolchain holds some libraries under
     // a biarch-like suffix of the GCC installation.
+    if (const auto &PathsCallback = Multilibs.filePathsCallback())
+      for (const auto &Path : PathsCallback(SelectedMultilib))
+        addPathIfExists(D, GCCInstallation.getInstallPath() + Path, Paths);
+
+    // Add lib/gcc/$triple/$version, with an optional /multilib suffix.
     addPathIfExists(
         D, GCCInstallation.getInstallPath() + SelectedMultilib.gccSuffix(),
         Paths);


        


More information about the cfe-commits mailing list