r295140 - Don't look for GCC versions in /usr/lib/<triple> except when <triple> is a
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 14 17:16:48 PST 2017
Author: rsmith
Date: Tue Feb 14 19:16:48 2017
New Revision: 295140
URL: http://llvm.org/viewvc/llvm-project?rev=295140&view=rev
Log:
Don't look for GCC versions in /usr/lib/<triple> except when <triple> is a
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.
Modified:
cfe/trunk/lib/Driver/ToolChains.cpp
Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=295140&r1=295139&r2=295140&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Tue Feb 14 19:16:48 2017
@@ -2757,10 +2757,11 @@ void Generic_GCC::GCCInstallationDetecto
{"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
More information about the cfe-commits
mailing list