mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-07-15 08:48:33 +00:00
Fix compilation errors for LLVM 14, refine code
This commit is contained in:
parent
e706de510c
commit
aa999cb615
|
@ -881,7 +881,7 @@ aot_compile_op_call(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#if LLVM_VERSION_MAJOR >= 15
|
#if LLVM_VERSION_MAJOR >= 14
|
||||||
LLVMTypeRef llvm_func_type;
|
LLVMTypeRef llvm_func_type;
|
||||||
#endif
|
#endif
|
||||||
bool recursive_call =
|
bool recursive_call =
|
||||||
|
@ -950,7 +950,7 @@ aot_compile_op_call(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
|
||||||
&& !check_stack_boundary(comp_ctx, func_ctx, callee_cell_num))
|
&& !check_stack_boundary(comp_ctx, func_ctx, callee_cell_num))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
#if LLVM_VERSION_MAJOR >= 15
|
#if LLVM_VERSION_MAJOR >= 14
|
||||||
llvm_func_type = func_ctxes[func_idx - import_func_count]->func_type;
|
llvm_func_type = func_ctxes[func_idx - import_func_count]->func_type;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -2557,7 +2557,7 @@ __call_llvm_intrinsic(const AOTCompContext *comp_ctx,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_VERSION_MAJOR >= 15
|
#if LLVM_VERSION_MAJOR >= 14
|
||||||
func_type =
|
func_type =
|
||||||
LLVMFunctionType(ret_type, param_types, (uint32)param_count, false);
|
LLVMFunctionType(ret_type, param_types, (uint32)param_count, false);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LLVM_VERSION_MAJOR < 15
|
#if LLVM_VERSION_MAJOR < 14
|
||||||
#define LLVMBuildLoad2(builder, type, value, name) \
|
#define LLVMBuildLoad2(builder, type, value, name) \
|
||||||
LLVMBuildLoad(builder, value, name)
|
LLVMBuildLoad(builder, value, name)
|
||||||
|
|
||||||
|
|
|
@ -492,7 +492,11 @@ aot_apply_llvm_new_pass_manager(AOTCompContext *comp_ctx)
|
||||||
|
|
||||||
if (!disable_llvm_lto) {
|
if (!disable_llvm_lto) {
|
||||||
/* Apply LTO for AOT mode */
|
/* Apply LTO for AOT mode */
|
||||||
|
#if LLVM_VERSION_MAJOR < 14
|
||||||
MPM.addPass(PB.buildLTODefaultPipeline(OL, NULL));
|
MPM.addPass(PB.buildLTODefaultPipeline(OL, NULL));
|
||||||
|
#else
|
||||||
|
MPM.addPass(PB.buildLTOPreLinkDefaultPipeline(OL));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
MPM.addPass(PB.buildPerModuleDefaultPipeline(OL));
|
MPM.addPass(PB.buildPerModuleDefaultPipeline(OL));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user