From 2a7c06f8d4e94d7e8dfba81de55428613c798d33 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 15 Feb 2017 01:16:48 +0000 Subject: [PATCH] Don't look for GCC versions in /usr/lib/ except when is a freescale triple. On multiarch systems, this previously caused us to stat every file in /usr/lib/ (typically several thousand files). This change halves the runtime of a clang invocation on an empty file on my system. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295140 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/ToolChains.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 03db6ba2d2..8eae5ba298 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -2757,10 +2757,11 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( {"gcc-cross/" + CandidateTriple.str(), "../..", true}, // The Freescale PPC SDK has the gcc libraries in - // /usr/lib//x.y.z so have a look there as well. - // FIXME: Only do this on Freescale triples, since some systems put a *lot* - // of files in that location, not just GCC installation data. - {CandidateTriple.str(), "..", true}, + // /usr/lib//x.y.z so have a look there as well. Only do + // this on Freescale triples, though, since some systems put a *lot* of + // files in that location, not just GCC installation data. + {CandidateTriple.str(), "..", + TargetTriple.getVendor() == llvm::Triple::Freescale}, // Natively multiarch systems sometimes put the GCC triple-specific // directory within their multiarch lib directory, resulting in the -- 2.50.1