Commit ae39829 1 parent 3c02972 commit ae39829 Copy full SHA for ae39829
File tree 1 file changed +12
-2
lines changed
compiler/rustc_llvm/llvm-wrapper
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -66,12 +66,22 @@ static LLVM_THREAD_LOCAL char *LastError;
66
66
static void FatalErrorHandler (void *UserData,
67
67
const char * Reason,
68
68
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;
71
73
72
74
// Since this error handler exits the process, we have to run any cleanup that
73
75
// LLVM would run after handling the error. This might change with an LLVM
74
76
// 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.
75
85
sys::RunInterruptHandlers ();
76
86
77
87
exit (101 );
You can’t perform that action at this time.
0 commit comments