diff options
author | dim <dim@FreeBSD.org> | 2014-03-18 22:07:45 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-03-18 22:07:45 +0000 |
commit | ce0b21596585c6ddd828c54e5077ba0aecfae8fc (patch) | |
tree | 67bb26dee066c422ad2e624408df89bdc262af76 /contrib/llvm/patches/patch-r259053-gcc-installation-detector.diff | |
parent | f931c3355875cf6371ab8fbad62d0f35958db4a0 (diff) | |
download | FreeBSD-src-ce0b21596585c6ddd828c54e5077ba0aecfae8fc.zip FreeBSD-src-ce0b21596585c6ddd828c54e5077ba0aecfae8fc.tar.gz |
Add separate patch files for all the customizations we have currently
applied to our copy of llvm/clang. These can be applied in alphabetical
order to a pristine llvm/clang 3.4 release source tree, to result in the
same version used in FreeBSD.
This is intended to clearly document all the changes until now, which
mostly consist of cherry pickings from the respective upstream trunks,
plus a number of hand-written FreeBSD-specific ones. Hopefully those
can eventually be cleaned up and sent upstream too.
MFC after: 1 week
X-MFC-With: r263313
Diffstat (limited to 'contrib/llvm/patches/patch-r259053-gcc-installation-detector.diff')
-rw-r--r-- | contrib/llvm/patches/patch-r259053-gcc-installation-detector.diff | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/contrib/llvm/patches/patch-r259053-gcc-installation-detector.diff b/contrib/llvm/patches/patch-r259053-gcc-installation-detector.diff new file mode 100644 index 0000000..1d04e7e --- /dev/null +++ b/contrib/llvm/patches/patch-r259053-gcc-installation-detector.diff @@ -0,0 +1,63 @@ +This patch eliminates the unnecessary search for various gcc installation +directories during each startup of clang. + +Introduced here: http://svn.freebsd.org/changeset/base/259053 + +Index: tools/clang/lib/Driver/ToolChains.cpp +=================================================================== +--- tools/clang/lib/Driver/ToolChains.cpp ++++ tools/clang/lib/Driver/ToolChains.cpp +@@ -1014,7 +1014,7 @@ static StringRef getGCCToolchainDir(const ArgList + 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. +@@ -1023,9 +1023,9 @@ static StringRef getGCCToolchainDir(const ArgList + /// 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), D(D) { ++void ++Generic_GCC::GCCInstallationDetector::init( ++ const llvm::Triple &TargetTriple, const ArgList &Args) { + llvm::Triple BiarchVariantTriple = + TargetTriple.isArch32Bit() ? TargetTriple.get64BitArchVariant() + : TargetTriple.get32BitArchVariant(); +@@ -1565,7 +1565,7 @@ void Generic_GCC::GCCInstallationDetector::ScanLib + + 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(getDriver()) { + getProgramPaths().push_back(getDriver().getInstalledDir()); + if (getDriver().getInstalledDir() != getDriver().Dir) + getProgramPaths().push_back(getDriver().Dir); +@@ -2361,6 +2361,7 @@ static StringRef getMultilibDir(const llvm::Triple + + Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) + : Generic_ELF(D, Triple, Args) { ++ GCCInstallation.init(Triple, Args); + llvm::Triple::ArchType Arch = Triple.getArch(); + std::string SysRoot = computeSysRoot(); + +Index: tools/clang/lib/Driver/ToolChains.h +=================================================================== +--- tools/clang/lib/Driver/ToolChains.h ++++ tools/clang/lib/Driver/ToolChains.h +@@ -92,8 +92,8 @@ class LLVM_LIBRARY_VISIBILITY Generic_GCC : public + std::set<std::string> CandidateGCCInstallPaths; + + public: +- GCCInstallationDetector(const Driver &D, const llvm::Triple &TargetTriple, +- const llvm::opt::ArgList &Args); ++ GCCInstallationDetector(const Driver &D) : IsValid(false), D(D) {} ++ void init(const llvm::Triple &TargetTriple, const llvm::opt::ArgList &Args); + + /// \brief Check whether we detected a valid GCC install. + bool isValid() const { return IsValid; } |