fix(FTBFS): clover: adapt to new LLVM 19 DiagnosticHandlerTy

LLVM 19 changed DiagnosticHandlerTy. Adapt to that.

Reference: 44d037cc25
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28520>
This commit is contained in:
Kai Wasserbäch 2024-04-02 11:10:18 +02:00 committed by Marge Bot
parent 1c3cce2fff
commit 50783351bc
1 changed files with 9 additions and 0 deletions

View File

@ -128,11 +128,20 @@ namespace {
}
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<std::string *>(data) };
::llvm::DiagnosticPrinterRawOStream printer { os };
#if LLVM_VERSION_MAJOR >= 19
di->print(printer);
#else
di.print(printer);
#endif
throw build_error();
}
}