fix: clover: LLVM 18 renamed/moved CGFT_*, update compat layer
authorKai Wasserbäch <kai@dev.carbon-project.org>
Fri, 6 Oct 2023 09:32:59 +0000 (11:32 +0200)
committerMarge Bot <emma+marge@anholt.net>
Fri, 6 Oct 2023 16:05:40 +0000 (16:05 +0000)
LLVm renamed and moved the CGFT_* stuff, we need to update the clover
compat header to follow suit.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9833
Reference: https://github.com/llvm/llvm-project/commit/0a1aa6cda2758b0926a95f87d39ffefb1cb90200
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/25586>

src/gallium/frontends/clover/llvm/compat.hpp

index d2acaa8..3b04adb 100644 (file)
@@ -68,8 +68,13 @@ namespace clover {
    namespace llvm {
       namespace compat {
 
+#if LLVM_VERSION_MAJOR >= 18
+         const auto CGFT_ObjectFile = ::llvm::CodeGenFileType::ObjectFile;
+         const auto CGFT_AssemblyFile = ::llvm::CodeGenFileType::AssemblyFile;
+#else
          const auto CGFT_ObjectFile = ::llvm::CGFT_ObjectFile;
          const auto CGFT_AssemblyFile = ::llvm::CGFT_AssemblyFile;
+#endif
          typedef ::llvm::CodeGenFileType CodeGenFileType;
 
          const clang::InputKind ik_opencl = clang::Language::OpenCL;