From 7e65f9a2441a61b50c4e39e7a8e010f80fb5f9bc Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 30 Jan 2024 21:50:33 +0900 Subject: [PATCH] aot: Fix LLVMSetTailCallKind check (#3099) --- core/iwasm/compilation/aot_llvm.c | 6 ------ core/iwasm/compilation/aot_llvm_extra2.cpp | 2 +- core/iwasm/compilation/aot_llvm_extra2.h | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/core/iwasm/compilation/aot_llvm.c b/core/iwasm/compilation/aot_llvm.c index 6f5cddcd9..028faf6e4 100644 --- a/core/iwasm/compilation/aot_llvm.c +++ b/core/iwasm/compilation/aot_llvm.c @@ -533,18 +533,12 @@ aot_add_precheck_function(AOTCompContext *comp_ctx, LLVMModuleRef module, } wasm_runtime_free(params); params = NULL; - -#if LLVM_VERSION_MAJOR < 17 if (aot_target_precheck_can_use_musttail(comp_ctx)) { LLVMSetTailCallKind(retval, LLVMTailCallKindMustTail); } else { LLVMSetTailCallKind(retval, LLVMTailCallKindTail); } -#else - LLVMSetTailCall(retval, true); -#endif - if (ret_type == VOID_TYPE) { if (!LLVMBuildRetVoid(b)) { goto fail; diff --git a/core/iwasm/compilation/aot_llvm_extra2.cpp b/core/iwasm/compilation/aot_llvm_extra2.cpp index 42d9c4bee..ccbccd1e0 100644 --- a/core/iwasm/compilation/aot_llvm_extra2.cpp +++ b/core/iwasm/compilation/aot_llvm_extra2.cpp @@ -163,7 +163,7 @@ LLVMCreateTargetMachineWithOpts(LLVMTargetRef ctarget, const char *triple, } /* https://reviews.llvm.org/D153107 */ -#if LLVM_VERSION_MAJOR < 17 +#if LLVM_VERSION_MAJOR < 18 using namespace llvm; LLVMTailCallKind diff --git a/core/iwasm/compilation/aot_llvm_extra2.h b/core/iwasm/compilation/aot_llvm_extra2.h index f3f897994..be89faae0 100644 --- a/core/iwasm/compilation/aot_llvm_extra2.h +++ b/core/iwasm/compilation/aot_llvm_extra2.h @@ -17,7 +17,7 @@ LLVMCreateTargetMachineWithOpts(LLVMTargetRef ctarget, const char *triple, const char *StackUsageOutput); /* https://reviews.llvm.org/D153107 */ -#if LLVM_VERSION_MAJOR < 17 +#if LLVM_VERSION_MAJOR < 18 typedef enum { LLVMTailCallKindNone = 0, LLVMTailCallKindTail = 1,