llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Alan Zhao (alanzhao1)

<details>
<summary>Changes</summary>

Clang vendors may need to set a custom message for bug reports if the default 
is not sufficient (e.g. if they need the user to provide more information than 
what the default message asks for). This can be configured using the new macro 
`CLANG_CUSTOM_BUG_REPORT_MSG`.

---
Full diff: https://github.com/llvm/llvm-project/pull/157536.diff


2 Files Affected:

- (modified) clang/include/clang/Config/config.h.cmake (+3) 
- (modified) clang/tools/driver/driver.cpp (+4) 


``````````diff
diff --git a/clang/include/clang/Config/config.h.cmake 
b/clang/include/clang/Config/config.h.cmake
index 00c352b458c34..4194c00c756c4 100644
--- a/clang/include/clang/Config/config.h.cmake
+++ b/clang/include/clang/Config/config.h.cmake
@@ -85,4 +85,7 @@
 /* Whether CIR is built into Clang */
 #cmakedefine01 CLANG_ENABLE_CIR
 
+/* Define if there is a custom bug report message */
+#cmakedefine CLANG_CUSTOM_BUG_REPORT_MSG "${CLANG_CUSTOM_BUG_REPORT_MSG}"
+
 #endif
diff --git a/clang/tools/driver/driver.cpp b/clang/tools/driver/driver.cpp
index e5c3c4ed5f804..c604d2927c869 100644
--- a/clang/tools/driver/driver.cpp
+++ b/clang/tools/driver/driver.cpp
@@ -235,9 +235,13 @@ static int ExecuteCC1Tool(SmallVectorImpl<const char *> 
&ArgV,
 
 int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContext) {
   noteBottomOfStack();
+  #ifdef CLANG_CUSTOM_BUG_REPORT_MSG
+  llvm::setBugReportMsg(CLANG_CUSTOM_BUG_REPORT_MSG);
+  #else
   llvm::setBugReportMsg("PLEASE submit a bug report to " BUG_REPORT_URL
                         " and include the crash backtrace, preprocessed "
                         "source, and associated run script.\n");
+  #endif
   SmallVector<const char *, 256> Args(Argv, Argv + Argc);
 
   if (llvm::sys::Process::FixupStandardFileDescriptors())

``````````

</details>


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

Reply via email to