aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-10-11 23:44:19 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-10-11 23:44:19 +0000
commit7171f2aaf9797b0f2334efc37ea6f69592fb157c (patch)
treeb7ef7b622986c6696fa7379103b0c90036604fe0
parent362ed7052071245c6c1b15d59c1973f8c80b0b2a (diff)
Basic: Attempt to make version tags work from 'svn export's again.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116268 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Basic/Version.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Basic/Version.cpp b/lib/Basic/Version.cpp
index 67c6c36c92..545ef53e6d 100644
--- a/lib/Basic/Version.cpp
+++ b/lib/Basic/Version.cpp
@@ -28,6 +28,12 @@ std::string getClangRepositoryPath() {
llvm::StringRef URL("");
#endif
+ // If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us
+ // pick up a tag in an SVN export, for example.
+ static llvm::StringRef SVNRepository("$URL$");
+ if (URL.empty())
+ URL = SVNRepository.split(':').second;
+
// Strip off version from a build from an integration branch.
URL = URL.slice(0, URL.find("/src/tools/clang"));