From d1f36013256bd914bace98d1785024f02d88202a Mon Sep 17 00:00:00 2001
From: Yunzhong Gao <Yunzhong_Gao@playstation.sony.com>
Date: Wed, 19 Feb 2014 19:06:58 +0000
Subject: [PATCH] Only print the selected multilib when something is actually
 found on the host.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201709 91177308-0d34-0410-b5e6-96231b3b80d8
---
 include/clang/Driver/Multilib.h | 4 ++++
 lib/Driver/ToolChains.cpp       | 8 ++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/include/clang/Driver/Multilib.h b/include/clang/Driver/Multilib.h
index ad59d8a57fb..6c3738a9cc0 100644
--- a/include/clang/Driver/Multilib.h
+++ b/include/clang/Driver/Multilib.h
@@ -82,6 +82,10 @@ public:
   /// Check whether any of the 'against' flags contradict the 'for' flags.
   bool isValid() const;
 
+  /// Check whether the default is selected
+  bool isDefault() const
+  { return GCCSuffix.empty() && OSSuffix.empty() && IncludeSuffix.empty(); }
+
   bool operator==(const Multilib &Other) const;
 };
 
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index 8d17ab10f2e..bd557b749bc 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -1263,12 +1263,16 @@ void Generic_GCC::GCCInstallationDetector::print(raw_ostream &OS) const {
        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 (Multilibs.size() != 0 || !SelectedMultilib.isDefault())
+    OS << "Selected multilib: " << SelectedMultilib << "\n";
 }
 
 bool Generic_GCC::GCCInstallationDetector::getBiarchSibling(Multilib &M) const {
-- 
GitLab