diff -Naur a/src/compiler/clc/clc_helpers.cpp b/src/compiler/clc/clc_helpers.cpp --- a/src/compiler/clc/clc_helpers.cpp 2024-10-14 15:16:10.908581118 +0600 +++ b/src/compiler/clc/clc_helpers.cpp 2024-10-14 15:17:22.924120115 +0600 @@ -85,13 +85,21 @@ using ::clang::driver::Driver; static void +#if LLVM_VERSION_MAJOR >= 19 +llvm_log_handler(const ::llvm::DiagnosticInfo *di, void *data) { +#else llvm_log_handler(const ::llvm::DiagnosticInfo &di, void *data) { +#endif const clc_logger *logger = static_cast(data); std::string log; raw_string_ostream os { log }; ::llvm::DiagnosticPrinterRawOStream printer { os }; +#if LLVM_VERSION_MAJOR >= 19 + di->print(printer); +#else di.print(printer); +#endif clc_error(logger, "%s", log.c_str()); } diff -Naur a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp --- a/src/gallium/frontends/clover/llvm/invocation.cpp 2024-10-14 15:20:16.317010149 +0600 +++ b/src/gallium/frontends/clover/llvm/invocation.cpp 2024-10-14 15:21:13.420644604 +0600 @@ -128,11 +128,20 @@ } void +#if LLVM_VERSION_MAJOR >= 19 + diagnostic_handler(const ::llvm::DiagnosticInfo *di, void *data) { + if (di->getSeverity() == ::llvm::DS_Error) { +#else diagnostic_handler(const ::llvm::DiagnosticInfo &di, void *data) { if (di.getSeverity() == ::llvm::DS_Error) { +#endif raw_string_ostream os { *reinterpret_cast(data) }; ::llvm::DiagnosticPrinterRawOStream printer { os }; +#if LLVM_VERSION_MAJOR >= 19 + di->print(printer); +#else di.print(printer); +#endif throw build_error(); } } diff -Naur a/src/amd/llvm/ac_llvm_helper.cpp b/src/amd/llvm/ac_llvm_helper.cpp --- a/src/amd/llvm/ac_llvm_helper.cpp +++ b/src/amd/llvm/ac_llvm_helper.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -307,8 +307,9 @@ unwrap(passmgr)->add(createSROAPass()); #endif /* TODO: restore IPSCCP */ - if (LLVM_VERSION_MAJOR >= 16) + #if LLVM_VERSION_MAJOR >= 16 && LLVM_VERSION_MAJOR < 18 unwrap(passmgr)->add(createLoopSinkPass()); + #endif /* TODO: restore IPSCCP */ unwrap(passmgr)->add(createLICMPass()); unwrap(passmgr)->add(createCFGSimplificationPass());