소스 검색

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
Daniel Dunbar 15 년 전
부모
커밋
7171f2aaf9
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      lib/Basic/Version.cpp

+ 6 - 0
lib/Basic/Version.cpp

@@ -28,6 +28,12 @@ std::string getClangRepositoryPath() {
   llvm::StringRef URL("");
   llvm::StringRef URL("");
 #endif
 #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.
   // Strip off version from a build from an integration branch.
   URL = URL.slice(0, URL.find("/src/tools/clang"));
   URL = URL.slice(0, URL.find("/src/tools/clang"));