================
@@ -2002,6 +2002,44 @@ void Driver::PrintVersion(const Compilation &C, 
raw_ostream &OS) const {
   // Print out the install directory.
   OS << "InstalledDir: " << Dir << '\n';
 
+  // Print out build configuration options that impact the compiler's runtime
+  // behavior. Intended for identifying the source of issues when reproducing
+  // changes.
+  std::vector<std::string> BuildOptions = {
+#if !__OPTIMIZE__
+      "+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)
+      "+ubsan",
+#endif
+#if __has_feature(memory_sanitizer)
+      "+msan",
+#endif
+#if __has_feature(dataflow_sanitizer)
+      "+dfsan",
+#endif
+  };
+  if (!BuildOptions.empty()) {
----------------
porglezomp wrote:

Added this as `LLVM_VERSION_PRINTER_SHOW_BUILD_CONFIG` which defaults on, is 
there anything I should do to update the release scripts here or is that for 
someone else to do?

https://github.com/llvm/llvm-project/pull/87585
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to