@@ -359,45 +359,6 @@ create_cur_exception(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx)
359359 return true;
360360}
361361
362- static bool
363- create_func_ptrs (AOTCompContext * comp_ctx , AOTFuncContext * func_ctx )
364- {
365- LLVMValueRef offset , func_ptrs_ptr ;
366- LLVMTypeRef void_ptr_type ;
367-
368- offset = I32_CONST (offsetof(AOTModuleInstance , func_ptrs .ptr ));
369- func_ptrs_ptr = LLVMBuildInBoundsGEP (comp_ctx -> builder ,
370- func_ctx -> aot_inst ,
371- & offset , 1 ,
372- "func_ptrs_ptr" );
373- if (!func_ptrs_ptr ) {
374- aot_set_last_error ("llvm build in bounds gep failed." );
375- return false;
376- }
377-
378- if (!(void_ptr_type = LLVMPointerType (VOID_PTR_TYPE , 0 ))
379- || !(void_ptr_type = LLVMPointerType (void_ptr_type , 0 ))) {
380- aot_set_last_error ("llvm get pointer type failed." );
381- return false;
382- }
383-
384- func_ctx -> func_ptrs = LLVMBuildBitCast (comp_ctx -> builder , func_ptrs_ptr ,
385- void_ptr_type , "func_ptrs_tmp" );
386- if (!func_ctx -> func_ptrs ) {
387- aot_set_last_error ("llvm build bit cast failed." );
388- return false;
389- }
390-
391- func_ctx -> func_ptrs = LLVMBuildLoad (comp_ctx -> builder , func_ctx -> func_ptrs ,
392- "func_ptrs" );
393- if (!func_ctx -> func_ptrs ) {
394- aot_set_last_error ("llvm build load failed." );
395- return false;
396- }
397-
398- return true;
399- }
400-
401362static bool
402363create_func_type_indexes (AOTCompContext * comp_ctx ,
403364 AOTFuncContext * func_ctx )
@@ -636,10 +597,6 @@ aot_create_func_context(AOTCompData *comp_data, AOTCompContext *comp_ctx,
636597 if (!create_cur_exception (comp_ctx , func_ctx ))
637598 goto fail ;
638599
639- /* Load function pointers */
640- if (!create_func_ptrs (comp_ctx , func_ctx ))
641- goto fail ;
642-
643600 /* Load function type indexes */
644601 if (!create_func_type_indexes (comp_ctx , func_ctx ))
645602 goto fail ;
@@ -723,15 +680,13 @@ aot_set_llvm_basic_types(AOTLLVMTypes *basic_types, LLVMContextRef context)
723680 basic_types -> int64_ptr_type = LLVMPointerType (basic_types -> int64_type , 0 );
724681 basic_types -> float32_ptr_type = LLVMPointerType (basic_types -> float32_type , 0 );
725682 basic_types -> float64_ptr_type = LLVMPointerType (basic_types -> float64_type , 0 );
726- basic_types -> void_ptr_type = LLVMPointerType (basic_types -> void_type , 0 );
727683
728684 return (basic_types -> int8_ptr_type
729685 && basic_types -> int16_ptr_type
730686 && basic_types -> int32_ptr_type
731687 && basic_types -> int64_ptr_type
732688 && basic_types -> float32_ptr_type
733689 && basic_types -> float64_ptr_type
734- && basic_types -> void_ptr_type
735690 && basic_types -> meta_data_type ) ? true : false;
736691}
737692
0 commit comments