amd/llvm: fix build with LLVM 18
authorMarek Olšák <marek.olsak@amd.com>
Mon, 25 Sep 2023 19:57:33 +0000 (15:57 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 26 Sep 2023 05:45:17 +0000 (05:45 +0000)
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25388>

src/gallium/auxiliary/gallivm/lp_bld_misc.cpp

index 5e7a30a..e213f7e 100644 (file)
@@ -366,7 +366,11 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
    builder.setEngineKind(EngineKind::JIT)
           .setErrorStr(&Error)
           .setTargetOptions(options)
+#if LLVM_VERSION_MAJOR >= 18
+          .setOptLevel((CodeGenOptLevel)OptLevel);
+#else
           .setOptLevel((CodeGenOpt::Level)OptLevel);
+#endif
 
 #if DETECT_OS_WINDOWS
     /*