summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-02-15 01:16:48 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-02-15 01:16:48 +0000
commitc3fc8265a36182f55b077da6649d40eb3e29081b (patch)
tree692b00e1ddb9d5c1f80964a3d3b2d9de9117e434
parentd7c5ccec9cd767367796bd512c19b2a1c3225040 (diff)
downloadbcm5719-llvm-c3fc8265a36182f55b077da6649d40eb3e29081b.tar.gz
bcm5719-llvm-c3fc8265a36182f55b077da6649d40eb3e29081b.zip
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. llvm-svn: 295140
-rw-r--r--clang/lib/Driver/ToolChains.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp
index 03db6ba2d24..8eae5ba298b 100644
--- a/clang/lib/Driver/ToolChains.cpp
+++ b/clang/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
- // <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
OpenPOWER on IntegriCloud