@@ -2603,6 +2603,22 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
2603
2603
return_type = tuple_api->get_tuple_type (type_code, llvm_el_types);
2604
2604
break ;
2605
2605
}
2606
+ case (ASR::ttypeType::List) : {
2607
+ bool is_array_type = false , is_malloc_array_type = false ;
2608
+ bool is_list = true ;
2609
+ ASR::dimension_t *m_dims = nullptr ;
2610
+ ASR::storage_typeType m_storage = ASR::storage_typeType::Default;
2611
+ int n_dims = 0 , a_kind = -1 ;
2612
+ ASR::List_t* asr_list = ASR::down_cast<ASR::List_t>(return_var_type0);
2613
+ llvm::Type* el_llvm_type = get_type_from_ttype_t (asr_list->m_type , m_storage,
2614
+ is_array_type,
2615
+ is_malloc_array_type,
2616
+ is_list, m_dims, n_dims,
2617
+ a_kind);
2618
+ std::string el_type_code = ASRUtils::get_type_code (asr_list->m_type );
2619
+ return_type = list_api->get_list_type (el_llvm_type, el_type_code, a_kind);
2620
+ break ;
2621
+ }
2606
2622
default :
2607
2623
LFORTRAN_ASSERT (false );
2608
2624
throw CodeGenError (" Type not implemented" );
@@ -2967,11 +2983,15 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
2967
2983
this ->visit_expr (*x.m_value );
2968
2984
llvm::Value* value_list = tmp;
2969
2985
ptr_loads = ptr_loads_copy;
2970
- ASR::List_t* value_asr_list = ASR::down_cast<ASR::List_t>(
2971
- ASRUtils::expr_type (x.m_value ));
2972
- std::string value_type_code = ASRUtils::get_type_code (value_asr_list->m_type );
2973
- list_api->list_deepcopy (value_list, target_list,
2974
- value_asr_list, *module );
2986
+ if (ASR::is_a<ASR::FunctionCall_t>(*x.m_value )) {
2987
+ builder->CreateStore (value_list, target_list);
2988
+ } else {
2989
+ ASR::List_t* value_asr_list = ASR::down_cast<ASR::List_t>(
2990
+ ASRUtils::expr_type (x.m_value ));
2991
+ std::string value_type_code = ASRUtils::get_type_code (value_asr_list->m_type );
2992
+ list_api->list_deepcopy (value_list, target_list,
2993
+ value_asr_list, *module );
2994
+ }
2975
2995
return ;
2976
2996
} else if ( is_target_tuple && is_value_tuple ) {
2977
2997
uint64_t ptr_loads_copy = ptr_loads;
0 commit comments