Skip to content

Commit 9422db5

Browse files
committed
[clang] Allow custom bug report messages
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`.
1 parent ff33c3b commit 9422db5

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

clang/include/clang/Config/config.h.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,7 @@
8585
/* Whether CIR is built into Clang */
8686
#cmakedefine01 CLANG_ENABLE_CIR
8787

88+
/* Define if there is a custom bug report message */
89+
#cmakedefine CLANG_CUSTOM_BUG_REPORT_MSG "${CLANG_CUSTOM_BUG_REPORT_MSG}"
90+
8891
#endif

clang/tools/driver/driver.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,13 @@ static int ExecuteCC1Tool(SmallVectorImpl<const char *> &ArgV,
235235

236236
int clang_main(int Argc, char **Argv, const llvm::ToolContext &ToolContext) {
237237
noteBottomOfStack();
238+
#ifdef CLANG_CUSTOM_BUG_REPORT_MSG
239+
llvm::setBugReportMsg(CLANG_CUSTOM_BUG_REPORT_MSG);
240+
#else
238241
llvm::setBugReportMsg("PLEASE submit a bug report to " BUG_REPORT_URL
239242
" and include the crash backtrace, preprocessed "
240243
"source, and associated run script.\n");
244+
#endif
241245
SmallVector<const char *, 256> Args(Argv, Argv + Argc);
242246

243247
if (llvm::sys::Process::FixupStandardFileDescriptors())

0 commit comments

Comments
 (0)