From owner-svn-src-stable-9@FreeBSD.ORG Tue Dec 10 07:25:25 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3282296; Tue, 10 Dec 2013 07:25:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BCC461B18; Tue, 10 Dec 2013 07:25:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBA7PP5M017707; Tue, 10 Dec 2013 07:25:25 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBA7PPUV017705; Tue, 10 Dec 2013 07:25:25 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312100725.rBA7PPUV017705@svn.freebsd.org> From: Dimitry Andric Date: Tue, 10 Dec 2013 07:25:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259157 - in stable: 10/contrib/llvm/tools/clang/lib/Driver 9/contrib/llvm/tools/clang/lib/Driver X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 07:25:26 -0000 Author: dim Date: Tue Dec 10 07:25:25 2013 New Revision: 259157 URL: http://svnweb.freebsd.org/changeset/base/259157 Log: MFC r259053: Pull in r196590 from upstream clang trunk (by rdivacky): Move the body of GCCInstallationDetector ctor into an init() function and call it from its only user. The linux toolchain. This saves quite a lot of directory searching on other platforms. See http://docs.freebsd.org/cgi/mid.cgi?51E6FAF5.3080802 for the original discussion. With this fix, the search for gcc installations is completely eliminated on FreeBSD. Reported by: Kurt Lidl Modified: stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.h Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/ToolChains.h Directory Properties: stable/10/ (props changed) Modified: stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp Tue Dec 10 05:01:01 2013 (r259156) +++ stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp Tue Dec 10 07:25:25 2013 (r259157) @@ -991,7 +991,7 @@ static StringRef getGCCToolchainDir(cons return GCC_INSTALL_PREFIX; } -/// \brief Construct a GCCInstallationDetector from the driver. +/// \brief Initialize a GCCInstallationDetector from the driver. /// /// This performs all of the autodetection and sets up the various paths. /// Once constructed, a GCCInstallationDetector is essentially immutable. @@ -1000,11 +1000,9 @@ static StringRef getGCCToolchainDir(cons /// should instead pull the target out of the driver. This is currently /// necessary because the driver doesn't store the final version of the target /// triple. -Generic_GCC::GCCInstallationDetector::GCCInstallationDetector( - const Driver &D, - const llvm::Triple &TargetTriple, - const ArgList &Args) - : IsValid(false) { +void +Generic_GCC::GCCInstallationDetector::init( + const Driver &D, const llvm::Triple &TargetTriple, const ArgList &Args) { llvm::Triple MultiarchTriple = TargetTriple.isArch32Bit() ? TargetTriple.get64BitArchVariant() : TargetTriple.get32BitArchVariant(); @@ -1448,7 +1446,7 @@ void Generic_GCC::GCCInstallationDetecto Generic_GCC::Generic_GCC(const Driver &D, const llvm::Triple& Triple, const ArgList &Args) - : ToolChain(D, Triple, Args), GCCInstallation(getDriver(), Triple, Args) { + : ToolChain(D, Triple, Args), GCCInstallation() { getProgramPaths().push_back(getDriver().getInstalledDir()); if (getDriver().getInstalledDir() != getDriver().Dir) getProgramPaths().push_back(getDriver().Dir); @@ -2211,6 +2209,7 @@ static StringRef getMultilibDir(const ll Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) : Generic_ELF(D, Triple, Args) { + GCCInstallation.init(D, Triple, Args); llvm::Triple::ArchType Arch = Triple.getArch(); std::string SysRoot = computeSysRoot(Args); Modified: stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.h ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.h Tue Dec 10 05:01:01 2013 (r259156) +++ stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.h Tue Dec 10 07:25:25 2013 (r259157) @@ -78,7 +78,8 @@ protected: GCCVersion Version; public: - GCCInstallationDetector(const Driver &D, const llvm::Triple &TargetTriple, + GCCInstallationDetector() : IsValid(false) {} + void init(const Driver &D, const llvm::Triple &TargetTriple, const ArgList &Args); /// \brief Check whether we detected a valid GCC install.