From 371a83895404309ce1cf84da05571354b6942082 Mon Sep 17 00:00:00 2001 From: Quinton Miller Date: Mon, 11 Dec 2023 19:23:01 +0800 Subject: [PATCH] version guard --- src/llvm/ext/llvm_ext.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/llvm/ext/llvm_ext.cc b/src/llvm/ext/llvm_ext.cc index f711afd8c0f1..921a39dbf29d 100644 --- a/src/llvm/ext/llvm_ext.cc +++ b/src/llvm/ext/llvm_ext.cc @@ -55,6 +55,7 @@ LLVMValueRef LLVMExtBuildInvoke2( Bundles, Name)); } +#if !LLVM_VERSION_GE(18, 0) static TargetMachine *unwrap(LLVMTargetMachineRef P) { return reinterpret_cast(P); } @@ -62,5 +63,6 @@ static TargetMachine *unwrap(LLVMTargetMachineRef P) { void LLVMExtSetTargetMachineGlobalISel(LLVMTargetMachineRef T, LLVMBool Enable) { unwrap(T)->setGlobalISel(Enable); } +#endif } // extern "C"