[cfe-commits] r114172 - /cfe/trunk/lib/Driver/ToolChains.cpp

Daniel Dunbar daniel at zuster.org
Fri Sep 17 01:22:12 PDT 2010


Author: ddunbar
Date: Fri Sep 17 03:22:12 2010
New Revision: 114172

URL: http://llvm.org/viewvc/llvm-project?rev=114172&view=rev
Log:
Driver/DarwinClang: Add GCC libexec paths so we can find the cc1 binaries if we
ever use fallback.
 - Not necessary for clang as a compiler, but useful for testing purposes.

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=114172&r1=114171&r2=114172&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Fri Sep 17 03:22:12 2010
@@ -373,10 +373,30 @@
 DarwinClang::DarwinClang(const HostInfo &Host, const llvm::Triple& Triple)
   : Darwin(Host, Triple)
 {
+  getProgramPaths().push_back(getDriver().getInstalledDir());
+  if (getDriver().getInstalledDir() != getDriver().Dir)
+    getProgramPaths().push_back(getDriver().Dir);
+
   // We expect 'as', 'ld', etc. to be adjacent to our install dir.
   getProgramPaths().push_back(getDriver().getInstalledDir());
   if (getDriver().getInstalledDir() != getDriver().Dir)
     getProgramPaths().push_back(getDriver().Dir);
+
+  // For fallback, we need to know how to find the GCC cc1 executables, so we
+  // also add the GCC libexec paths. This is legiy code that can be removed once
+  // fallback is no longer useful.
+  std::string ToolChainDir = "i686-apple-darwin";
+  ToolChainDir += llvm::utostr(DarwinVersion[0]);
+  ToolChainDir += "/4.2.1";
+
+  std::string Path = getDriver().Dir;
+  Path += "/../libexec/gcc/";
+  Path += ToolChainDir;
+  getProgramPaths().push_back(Path);
+
+  Path = "/usr/libexec/gcc/";
+  Path += ToolChainDir;
+  getProgramPaths().push_back(Path);
 }
 
 void DarwinClang::AddLinkSearchPathArgs(const ArgList &Args,





More information about the cfe-commits mailing list