Skip to content

Commit

Permalink
Rollup merge of #89559 - krasimirgg:llvm-14-fatal_error_handler_t, r=…
Browse files Browse the repository at this point in the history
…nagisa

RustWrapper: adapt for LLVM API change

No functional changes intended.

The LLVM commit
llvm/llvm-project@e463b69
changed an argument of fatal_error_handler_t from std::string to char*.
This adapts RustWrapper accordingly.
  • Loading branch information
GuillaumeGomez authored Oct 7, 2021
2 parents 48548c9 + 67a82e2 commit 110d289
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ static LLVM_THREAD_LOCAL char *LastError;
//
// Notably it exits the process with code 101, unlike LLVM's default of 1.
static void FatalErrorHandler(void *UserData,
#if LLVM_VERSION_LT(14, 0)
const std::string& Reason,
#else
const char* Reason,
#endif
bool GenCrashDiag) {
// Do the same thing that the default error handler does.
std::cerr << "LLVM ERROR: " << Reason << std::endl;
Expand Down

0 comments on commit 110d289

Please sign in to comment.