From 9790174207497a82c746325dab57b9633a96c531 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Wed, 19 Jun 2024 13:23:00 -0700 Subject: [PATCH] Fix LLVM 18 build. --- src/tllvmutil.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/tllvmutil.cpp b/src/tllvmutil.cpp index d7c9e599..a41d709d 100644 --- a/src/tllvmutil.cpp +++ b/src/tllvmutil.cpp @@ -330,7 +330,19 @@ bool llvmutil_emitobjfile(Module *Mod, TargetMachine *TM, bool outputobjectfile, Mod->setDataLayout(TM->createDataLayout()); #endif - CodeGenFileType ft = outputobjectfile ? CGFT_ObjectFile : CGFT_AssemblyFile; + CodeGenFileType ft = outputobjectfile ? +#if LLVM_VERSION < 180 + CGFT_ObjectFile +#else + CodeGenFileType::ObjectFile +#endif + : +#if LLVM_VERSION < 180 + CGFT_AssemblyFile +#else + CodeGenFileType::AssemblyFile +#endif + ; emitobjfile_t &destf = dest;