clc: fix compile compatability with LLVM-22
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

See d090311aa7

Cc: mesa-stable
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39374>
This commit is contained in:
Karol Herbst 2026-01-15 15:26:44 +01:00 committed by Marge Bot
parent 24d20df3d6
commit dc03f94e07

View file

@ -66,6 +66,10 @@
#include <llvm/Support/VirtualFileSystem.h>
#endif
#if LLVM_VERSION_MAJOR >= 22
#include <clang/Options/OptionUtils.h>
#endif
/* We have to include our own headers after LLVM/clang as they seem to use
* `UNUSED` within enum definitions:
* https://github.com/llvm/llvm-project/blob/ea443eeb2ab8ed49ffb783c2025fed6629a36f10/clang/include/clang/Basic/OffloadArch.h#L19
@ -919,7 +923,9 @@ clc_compile_to_llvm_module(LLVMContext &llvm_ctx,
// GetResourcePath is a way to retrieve the actual libclang resource dir based on a given binary
// or library.
auto tmp_res_path =
#if LLVM_VERSION_MAJOR >= 20
#if LLVM_VERSION_MAJOR >= 22
clang::GetResourcesPath(std::string(clang_path));
#elif LLVM_VERSION_MAJOR >= 20
Driver::GetResourcesPath(std::string(clang_path));
#else
Driver::GetResourcesPath(std::string(clang_path), CLANG_RESOURCE_DIR);