Module: Mesa
Branch: main
Commit: 6060b656f88f0fc71d3750cb29c2f3aaf2c1bd4c
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6060b656f88f0fc71d3750cb29c2f3aaf2c1bd4c

Author: Marek Olšák <[email protected]>
Date:   Mon Sep 25 15:46:59 2023 -0400

gallivm: fix build with LLVM 18

Reviewed-by: Dave Airlie <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25388>

---

 src/amd/llvm/ac_llvm_helper.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/amd/llvm/ac_llvm_helper.cpp b/src/amd/llvm/ac_llvm_helper.cpp
index b3241c8861d..40a4399e705 100644
--- a/src/amd/llvm/ac_llvm_helper.cpp
+++ b/src/amd/llvm/ac_llvm_helper.cpp
@@ -250,7 +250,11 @@ struct ac_compiler_passes 
*ac_create_llvm_passes(LLVMTargetMachineRef tm)
    TargetMachine *TM = reinterpret_cast<TargetMachine *>(tm);
 
    if (TM->addPassesToEmitFile(p->passmgr, p->ostream, nullptr,
+#if LLVM_VERSION_MAJOR >= 18
+                               CodeGenFileType::ObjectFile)) {
+#else
                                CGFT_ObjectFile)) {
+#endif
       fprintf(stderr, "amd: TargetMachine can't emit a file of this type!\n");
       delete p;
       return NULL;

Reply via email to