Skip to content

Commit 67a82e2

Browse files
committed
RustWrapper: adapt for LLVM API change of fatal_error_handler_t
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.
1 parent 55111d6 commit 67a82e2

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)