Rollup merge of #89559 - krasimirgg:llvm-14-fatal_error_handler_t, r=nagisa

RustWrapper: adapt for LLVM API change

No functional changes intended.

The LLVM commit
e463b69736
changed an argument of fatal_error_handler_t from std::string to char*.
This adapts RustWrapper accordingly.
This commit is contained in:
Guillaume Gomez 2021-10-07 16:24:51 +02:00 committed by GitHub
commit 110d289846
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;