File tree Expand file tree Collapse file tree 4 files changed +16
-4
lines changed
Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -1267,10 +1267,6 @@ void Driver::generateCompilationDiagnostics(
12671267 // Print the version of the compiler.
12681268 PrintVersion (C, llvm::errs ());
12691269
1270- Diag (clang::diag::note_drv_command_failed_diag_msg)
1271- << " PLEASE submit a bug report to " BUG_REPORT_URL " and include the "
1272- " crash backtrace, preprocessed source, and associated run script." ;
1273-
12741270 // Suppress driver output and emit preprocessor output to temp file.
12751271 Mode = CPPMode;
12761272 CCGenDiagnostics = true ;
Original file line number Diff line number Diff line change 3838#include " llvm/Support/Host.h"
3939#include " llvm/Support/InitLLVM.h"
4040#include " llvm/Support/Path.h"
41+ #include " llvm/Support/PrettyStackTrace.h"
4142#include " llvm/Support/Process.h"
4243#include " llvm/Support/Program.h"
4344#include " llvm/Support/Regex.h"
@@ -342,6 +343,9 @@ static int ExecuteCC1Tool(SmallVectorImpl<const char *> &ArgV) {
342343int main (int argc_, const char **argv_) {
343344 noteBottomOfStack ();
344345 llvm::InitLLVM X (argc_, argv_);
346+ llvm::setBugReportMsg (" PLEASE submit a bug report to " BUG_REPORT_URL
347+ " and include the crash backtrace, preprocessed "
348+ " source, and associated run script.\n " );
345349 SmallVector<const char *, 256 > argv (argv_, argv_ + argc_);
346350
347351 if (llvm::sys::Process::FixupStandardFileDescriptors ())
Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ namespace llvm {
3737 // / \see PrettyStackTraceEntry
3838 void EnablePrettyStackTraceOnSigInfoForThisThread (bool ShouldEnable = true );
3939
40+ // / Replaces the generic bug report message that is output upon
41+ // / a crash.
42+ void setBugReportMsg (const char *Msg);
43+
4044 // / PrettyStackTraceEntry - This class is used to represent a frame of the
4145 // / "pretty" stack trace that is dumped when a program crashes. You can define
4246 // / subclasses of this and declare them on the program stack: when they are
Original file line number Diff line number Diff line change @@ -142,9 +142,17 @@ using CrashHandlerStringStorage =
142142static CrashHandlerStringStorage crashHandlerStringStorage;
143143#endif
144144
145+ static const char *BugReportMsg =
146+ " PLEASE submit a bug report to " BUG_REPORT_URL
147+ " and include the crash backtrace.\n " ;
148+
149+ void llvm::setBugReportMsg (const char *Msg) { BugReportMsg = Msg; }
150+
145151// / This callback is run if a fatal signal is delivered to the process, it
146152// / prints the pretty stack trace.
147153static void CrashHandler (void *) {
154+ errs () << BugReportMsg ;
155+
148156#ifndef __APPLE__
149157 // On non-apple systems, just emit the crash stack trace to stderr.
150158 PrintCurStackTrace (errs ());
You can’t perform that action at this time.
0 commit comments