[llvm-branch-commits] [cfe-tag] r84665 - /cfe/tags/Apple/clang-23.1/clang/tools/clang/lib/Driver/ToolChains.cpp
Ted Kremenek
kremenek at apple.com
Tue Oct 20 13:23:36 PDT 2009
Author: kremenek
Date: Tue Oct 20 15:23:36 2009
New Revision: 84665
URL: http://llvm.org/viewvc/llvm-project?rev=84665&view=rev
Log:
Merge in r84656.
Modified:
cfe/tags/Apple/clang-23.1/clang/tools/clang/lib/Driver/ToolChains.cpp
Modified: cfe/tags/Apple/clang-23.1/clang/tools/clang/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/tags/Apple/clang-23.1/clang/tools/clang/lib/Driver/ToolChains.cpp?rev=84665&r1=84664&r2=84665&view=diff
==============================================================================
--- cfe/tags/Apple/clang-23.1/clang/tools/clang/lib/Driver/ToolChains.cpp (original)
+++ cfe/tags/Apple/clang-23.1/clang/tools/clang/lib/Driver/ToolChains.cpp Tue Oct 20 15:23:36 2009
@@ -50,6 +50,24 @@
ToolChainDir += llvm::utostr(GCCVersion[1]);
ToolChainDir += '.';
ToolChainDir += llvm::utostr(GCCVersion[2]);
+
+ // Try the next major version if that tool chain dir is invalid.
+ if (!llvm::sys::Path(ToolChainDir).exists()) {
+ std::string Next = "i686-apple-darwin";
+ Next += llvm::utostr(DarwinVersion[0] + 1);
+ Next += "/";
+ Next += llvm::utostr(GCCVersion[0]);
+ Next += '.';
+ Next += llvm::utostr(GCCVersion[1]);
+ Next += '.';
+ Next += llvm::utostr(GCCVersion[2]);
+
+ // Use that if it exists, otherwise hope the user isn't linking.
+ //
+ // FIXME: Drop dependency on gcc's tool chain.
+ if (llvm::sys::Path(Next).exists())
+ ToolChainDir = Next;
+ }
std::string Path;
if (getArchName() == "x86_64") {
More information about the llvm-branch-commits
mailing list