[PATCH] D83386: clang: Don't show a trailing space with --version when not built from the repo
Sylvestre Ledru via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 8 05:02:34 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGbbea4d5e6b82: clang: Don't show a trailing space with --version when not built from the repo (authored by sylvestre.ledru).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83386/new/
https://reviews.llvm.org/D83386
Files:
clang/lib/Basic/Version.cpp
Index: clang/lib/Basic/Version.cpp
===================================================================
--- clang/lib/Basic/Version.cpp
+++ clang/lib/Basic/Version.cpp
@@ -97,8 +97,12 @@
#ifdef CLANG_VENDOR
OS << CLANG_VENDOR;
#endif
- OS << ToolName << " version " CLANG_VERSION_STRING " "
- << getClangFullRepositoryVersion();
+ OS << ToolName << " version " CLANG_VERSION_STRING;
+
+ std::string repo = getClangFullRepositoryVersion();
+ if (!repo.empty()) {
+ OS << " " << repo;
+ }
return OS.str();
}
@@ -111,7 +115,13 @@
#ifdef CLANG_VENDOR
OS << CLANG_VENDOR;
#endif
- OS << "Clang " CLANG_VERSION_STRING " " << getClangFullRepositoryVersion();
+ OS << "Clang " CLANG_VERSION_STRING;
+
+ std::string repo = getClangFullRepositoryVersion();
+ if (!repo.empty()) {
+ OS << " " << repo;
+ }
+
return OS.str();
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83386.276382.patch
Type: text/x-patch
Size: 857 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200708/7ec3a5bd/attachment.bin>
More information about the cfe-commits
mailing list