]> granicus.if.org Git - clang/commitdiff
Don't look for GCC versions in /usr/lib/<triple> except when <triple> is a
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 15 Feb 2017 01:16:48 +0000 (01:16 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 15 Feb 2017 01:16:48 +0000 (01:16 +0000)
freescale triple.

On multiarch systems, this previously caused us to stat every file in
/usr/lib/<triple> (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

index 03db6ba2d246e8d4a9706700bbd1994b909b9c12..8eae5ba298b9fe71308e97120de0458c059d27c4 100644 (file)
@@ -2757,10 +2757,11 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
     {"gcc-cross/" + CandidateTriple.str(), "../..", true},
 
     // The Freescale PPC SDK has the gcc libraries in
-    // <sysroot>/usr/lib/<triple>/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},
+    // <sysroot>/usr/lib/<triple>/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