aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/Version.cpp
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2020-01-16 10:27:25 -0500
committerNico Weber <thakis@chromium.org>2020-01-16 11:02:52 -0500
commitfb9413cb84cc422426c81f6464083795e781566b (patch)
treedfe403d855d932bedad774c1c7f6157e1346f6e1 /clang/lib/Basic/Version.cpp
parent237fd94312526c7aef55f929b51696bba451dab8 (diff)
downloadllvm-fb9413cb84cc422426c81f6464083795e781566b.zip
llvm-fb9413cb84cc422426c81f6464083795e781566b.tar.gz
llvm-fb9413cb84cc422426c81f6464083795e781566b.tar.bz2
Remove some SVN-specific code.
$URL$ is an SVN keyword substitution enabled via `svn propset svn:keywords "URL" tools/clang/lib/Basic/Version.cpp`. Now that we no longer use SVN, it's no longer being replaced by anything, and we no longer offer svn exports. So remove the $URL$-specific logic. The "cfe" path prefix removal also no longer makes sense now that we're on git: Both CLANG_REPOSITORY and LLVM_REPOSITORY are usually set to https://github.com/llvm/llvm-project.git So remove that too, and remove the "llvm" prefix removal for symmetry. With the github url, "llvm" _is_ found in the string, but not in the place the function expected. Nobody noticed since the llvm repository path is only used if CLANG_REVISION and LLVM_REVISION are different, which in the git monorepo world they never should be. (I might remove the "// Support LLVM in a separate repository" block in a separate commit.) Differential Revision: https://reviews.llvm.org/D72848
Diffstat (limited to 'clang/lib/Basic/Version.cpp')
-rw-r--r--clang/lib/Basic/Version.cpp35
1 files changed, 4 insertions, 31 deletions
diff --git a/clang/lib/Basic/Version.cpp b/clang/lib/Basic/Version.cpp
index c69d13b..c4b7d34 100644
--- a/clang/lib/Basic/Version.cpp
+++ b/clang/lib/Basic/Version.cpp
@@ -28,46 +28,19 @@ std::string getClangRepositoryPath() {
return CLANG_REPOSITORY_STRING;
#else
#ifdef CLANG_REPOSITORY
- StringRef URL(CLANG_REPOSITORY);
+ return CLANG_REPOSITORY;
#else
- StringRef URL("");
+ return "";
#endif
-
- // If the CLANG_REPOSITORY is empty, try to use the SVN keyword. This helps us
- // pick up a tag in an SVN export, for example.
- StringRef SVNRepository("$URL$");
- if (URL.empty()) {
- URL = SVNRepository.slice(SVNRepository.find(':'),
- SVNRepository.find("/lib/Basic"));
- }
-
- // Strip off version from a build from an integration branch.
- URL = URL.slice(0, URL.find("/src/tools/clang"));
-
- // Trim path prefix off, assuming path came from standard cfe path.
- size_t Start = URL.find("cfe/");
- if (Start != StringRef::npos)
- URL = URL.substr(Start + 4);
-
- return URL;
#endif
}
std::string getLLVMRepositoryPath() {
#ifdef LLVM_REPOSITORY
- StringRef URL(LLVM_REPOSITORY);
+ return LLVM_REPOSITORY;
#else
- StringRef URL("");
+ return "";
#endif
-
- // Trim path prefix off, assuming path came from standard llvm path.
- // Leave "llvm/" prefix to distinguish the following llvm revision from the
- // clang revision.
- size_t Start = URL.find("llvm/");
- if (Start != StringRef::npos)
- URL = URL.substr(Start);
-
- return URL;
}
std::string getClangRevision() {