[PATCH] D58559: emit '(assertions enabled)' in the version string for a build of clang with assertions enabled

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 22 16:05:37 PST 2019


arphaman created this revision.
arphaman added a reviewer: dexonsmith.
Herald added a subscriber: jkorous.
Herald added a project: clang.

This patch adds an additional '(assertions enabled)' in the version string for a build of clang with assertions enabled.

This is a useful way to differentiate between clang binaries that have assertions enabled and the ones that don't if they are based on the same version.


Repository:
  rC Clang

https://reviews.llvm.org/D58559

Files:
  lib/Basic/Version.cpp


Index: lib/Basic/Version.cpp
===================================================================
--- lib/Basic/Version.cpp
+++ lib/Basic/Version.cpp
@@ -111,6 +111,11 @@
       OS << LLVMRepo << ' ';
     OS << LLVMRev << ')';
   }
+
+  // Differentiate between the version with and without assertions.
+#ifndef NDEBUG
+  OS << " (assertions enabled)";
+#endif
   return OS.str();
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58559.188004.patch
Type: text/x-patch
Size: 386 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190223/3b7f355e/attachment.bin>


More information about the cfe-commits mailing list