r201205 - Add Multilib selection machinery

Gao, Yunzhong yunzhong_gao at playstation.sony.com
Tue Feb 18 13:36:36 PST 2014


Hi Jonathan,

I wonder whether it makes more sense to only print the selected multilib when something is actually found on the host.
I propose the following patch.

Index: include/clang/Driver/Multilib.h
===================================================================
--- include/clang/Driver/Multilib.h	(revision 201600)
+++ include/clang/Driver/Multilib.h	(working copy)
@@ -82,6 +82,8 @@
   /// Check whether any of the 'against' flags contradict the 'for' flags.
   bool isValid() const;
 
+  bool empty() const { return GCCSuffix.empty() && Flags.size() == 0; }
+
   bool operator==(const Multilib &Other) const;
 };
 
Index: lib/Driver/ToolChains.cpp
===================================================================
--- lib/Driver/ToolChains.cpp	(revision 201600)
+++ lib/Driver/ToolChains.cpp	(working copy)
@@ -1263,12 +1263,16 @@
        I != E; ++I)
     OS << "Found candidate GCC installation: " << *I << "\n";
 
-  OS << "Selected GCC installation: " << GCCInstallPath << "\n";
+  if (!GCCInstallPath.empty())
+    OS << "Selected GCC installation: " << GCCInstallPath << "\n";
+
   for (MultilibSet::const_iterator I = Multilibs.begin(), E = Multilibs.end();
        I != E; ++I) {
     OS << "Candidate multiilb: " << *I << "\n";
   }
-  OS << "Selected multilib: " << SelectedMultilib << "\n";
+
+  if (!SelectedMultilib.empty())
+    OS << "Selected multilib: " << SelectedMultilib << "\n";
 }
 
 bool Generic_GCC::GCCInstallationDetector::getBiarchSibling(Multilib &M) const {





More information about the cfe-commits mailing list