Skip to content

Commit 110d289

Browse files
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 llvm/llvm-project@e463b69 changed an argument of fatal_error_handler_t from std::string to char*. This adapts RustWrapper accordingly.
2 parents 48548c9 + 67a82e2 commit 110d289

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ static LLVM_THREAD_LOCAL char *LastError;
5454
//
5555
// Notably it exits the process with code 101, unlike LLVM's default of 1.
5656
static void FatalErrorHandler(void *UserData,
57+
#if LLVM_VERSION_LT(14, 0)
5758
const std::string& Reason,
59+
#else
60+
const char* Reason,
61+
#endif
5862
bool GenCrashDiag) {
5963
// Do the same thing that the default error handler does.
6064
std::cerr << "LLVM ERROR: " << Reason << std::endl;

0 commit comments

Comments
 (0)