File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
compiler/rustc_llvm/llvm-wrapper Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -66,12 +66,22 @@ static LLVM_THREAD_LOCAL char *LastError;
6666static void FatalErrorHandler (void *UserData,
6767 const char * Reason,
6868 bool GenCrashDiag) {
69- // Do the same thing that the default error handler does.
70- std::cerr << " LLVM ERROR: " << Reason << std::endl;
69+ // Once upon a time we emitted "LLVM ERROR:" specifically to mimic LLVM. Then,
70+ // we developed crater and other tools which only expose logs, not error codes.
71+ // Use a more greppable prefix that will still match the "LLVM ERROR:" prefix.
72+ std::cerr << " rustc-LLVM ERROR: " << Reason << std::endl;
7173
7274 // Since this error handler exits the process, we have to run any cleanup that
7375 // LLVM would run after handling the error. This might change with an LLVM
7476 // upgrade.
77+ //
78+ // In practice, this will do nothing, because the only cleanup LLVM does is
79+ // to remove all files that were registered with it via a frontend calling
80+ // one of the `createOutputFile` family of functions in LLVM and passing true
81+ // to RemoveFileOnSignal, something that rustc does not do. However, it would
82+ // be... inadvisable to suddenly stop running these handlers, if LLVM gets
83+ // "interesting" ideas in the future about what cleanup should be done.
84+ // We might even find it useful for generating less artifacts.
7585 sys::RunInterruptHandlers ();
7686
7787 exit (101 );
Original file line number Diff line number Diff line change 11'common' global must have a zero initializer!
22ptr @TEST
3- LLVM ERROR: Broken module found, compilation aborted!
3+ rustc- LLVM ERROR: Broken module found, compilation aborted!
You can’t perform that action at this time.
0 commit comments