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();
 }
 


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();
 }
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D58559: em... Alex Lorenz via Phabricator via cfe-commits

Reply via email to