[clang] [llvm] [driver] Make --version show if assertions, etc. are enabled (PR #87585)

Cassie Jones via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 4 16:34:40 PDT 2024


================
@@ -2734,6 +2734,39 @@ void cl::PrintHelpMessage(bool Hidden, bool Categorized) {
     CommonOptions->CategorizedHiddenPrinter.printHelp();
 }
 
+ArrayRef<StringRef> cl::CompilerBuildConfig = {
+#if LLVM_IS_DEBUG_BUILD
+    "+unoptimized",
+#endif
+#ifndef NDEBUG
+    "+assertions",
+#endif
+#ifdef EXPENSIVE_CHECKS
+    "+expensive-checks",
+#endif
+#if __has_feature(address_sanitizer)
+    "+asan",
+#endif
+#if __has_feature(undefined_behavior_sanitizer)
----------------
porglezomp wrote:

Good catch on TSan.
I followed the documented list of `__has_feature` that I could see, I don't see `hwaddress_sanitizer` in the list here: https://clang.llvm.org/docs/LanguageExtensions.html#extensions-for-dynamic-analysis

https://github.com/llvm/llvm-project/pull/87585


More information about the cfe-commits mailing list