================
@@ -2734,6 +2734,40 @@ 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)
+    "+ubsan",
+#endif
+#if __has_feature(memory_sanitizer)
+    "+msan",
+#endif
+#if __has_feature(dataflow_sanitizer)
+    "+dfsan",
+#endif
+};
+
+// Utility function for printing the build config.
+void cl::printBuildConfig(raw_ostream &OS) {
+#if LLVM_VERSION_PRINTER_SHOW_BUILD_CONFIG
+  OS << "Build config: ";
+  llvm::interleaveComma(cl::CompilerBuildConfig, OS,
+                        [&OS](const StringRef &Option) { OS << Option; });
----------------
jroelofs wrote:

```suggestion
  llvm::interleaveComma(cl::CompilerBuildConfig, OS);
```

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