[PATCH] D69925: remove redundant LLVM version from version string when setting CLANG_VENDOR

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 6 15:42:44 PST 2019


nickdesaulniers created this revision.
nickdesaulniers added reviewers: jyknight, eli.friedman, rsmith.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
nickdesaulniers marked an inline comment as done.
nickdesaulniers added inline comments.
nickdesaulniers marked an inline comment as done.


================
Comment at: clang/lib/Basic/Version.cpp:132
-#ifdef CLANG_VENDOR
-  OS << " (based on " << BACKEND_PACKAGE_STRING << ")";
-#endif
----------------
Looks like this is the sole use of `BACKEND_PACKAGE_STRING`, might as well remove that, too.


================
Comment at: clang/lib/Basic/Version.cpp:132
-#ifdef CLANG_VENDOR
-  OS << " (based on " << BACKEND_PACKAGE_STRING << ")";
-#endif
----------------
nickdesaulniers wrote:
> Looks like this is the sole use of `BACKEND_PACKAGE_STRING`, might as well remove that, too.
er, nvm, was running grep in my build dir.


When downstream LLVM distributions (like AOSP) set the CLANG_VENDOR
cmake variable, the version string printed by the clang driver looks
like:

$ clang --version
[CLANG_VENDOR] clang version X.X.X ([CLANG_REPOSITORY_STRING] sha) (based on LLVM X.X.X)

Rather than the more standard:
$ clang --version
clang version X.X.X ([CLANG_REPOSITORY_STRING] sha)

Based on feedback the the version string is a little long, the trailing
"(based on LLVM X.X.X)" is redundant and makes less sense after moving
LLVM to the monorepo. And it is only added should vendors set the cmake
variable CLANG_VENDOR. Let's remove it.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69925

Files:
  clang/lib/Basic/Version.cpp


Index: clang/lib/Basic/Version.cpp
===================================================================
--- clang/lib/Basic/Version.cpp
+++ clang/lib/Basic/Version.cpp
@@ -127,11 +127,6 @@
   OS << ToolName << " version " CLANG_VERSION_STRING " "
      << getClangFullRepositoryVersion();
 
-  // If vendor supplied, include the base LLVM version as well.
-#ifdef CLANG_VENDOR
-  OS << " (based on " << BACKEND_PACKAGE_STRING << ")";
-#endif
-
   return OS.str();
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69925.228162.patch
Type: text/x-patch
Size: 468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191106/51748346/attachment.bin>


More information about the cfe-commits mailing list