From 1c3cce2fff8de3f81eefa82db42650a63e3a4285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20Wasserb=C3=A4ch?= Date: Tue, 2 Apr 2024 10:49:54 +0200 Subject: [PATCH] fix(FTBFS): clc: adapt to new LLVM 19 DiagnosticHandlerTy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LLVM 19 changed DiagnosticHandlerTy. Adapt to that. Reference: https://github.com/llvm/llvm-project/commit/44d037cc258dcf179d2c48c93996bb406ecd0fae Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10928 Signed-off-by: Kai Wasserbäch Reviewed-by: Karol Herbst Part-of: --- src/compiler/clc/clc_helpers.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/compiler/clc/clc_helpers.cpp b/src/compiler/clc/clc_helpers.cpp index 530196b8328..51ba9776bef 100644 --- a/src/compiler/clc/clc_helpers.cpp +++ b/src/compiler/clc/clc_helpers.cpp @@ -91,13 +91,21 @@ static void clc_dump_llvm(const llvm::Module *mod, FILE *f); 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()); }