(context, builder, dict_type, dict_val, it)
This function should produce LLVM code for calling native
    hashmap_getiter and fill iterator data accordingly
This function should produce LLVM code for calling native
    hashmap_getiter and fill iterator data accordingly
This function should produce LLVM code for calling native hashmap_getiter and fill iterator data accordingly
def call_native_getiter(context, builder, dict_type, dict_val, it):
    """ This function should produce LLVM code for calling native
    hashmap_getiter and fill iterator data accordingly """

    ty_key, ty_val = dict_type.key_type, dict_type.value_type
    key_type_postfix, value_type_postfix = _get_types_postfixes(ty_key, ty_val)

    nrt_table = context.nrt.get_nrt_api(builder)
    llvoidptr = context.get_value_type(types.voidptr)
    fnty = lir.FunctionType(llvoidptr,
                            [it.meminfo.type.as_pointer(),
                             llvoidptr,
                             llvoidptr])
    func_name = f"hashmap_getiter_{key_type_postfix}_to_{value_type_postfix}"
    fn_hashmap_getiter = cgutils.get_or_insert_function(builder.module,
        fnty, name=func_name)

    cdict = cgutils.create_struct_proxy(dict_type)(context, builder, value=dict_val)
    it.state = builder.call(fn_hashmap_getiter,
                            [it._get_ptr_by_name('meminfo'),
                             nrt_table,
                             cdict.data_ptr])

    # store the reference to parent and incref
    it.parent = dict_val
    if context.enable_nrt:
        context.nrt.incref(builder, dict_type, dict_val)
def call_native_getiter ( context , builder , dict_type , dict_val , it ) : ty_key , ty_val = dict_type . key_type , dict_type . value_type key_type_postfix , value_type_postfix = _get_types_postfixes ( ty_key , ty_val ) nrt_table = context . nrt . get_nrt_api ( builder ) llvoidptr = context . get_value_type ( types . voidptr ) fnty = lir . FunctionType ( llvoidptr , [ it . meminfo . type . as_pointer ( ) , llvoidptr , llvoidptr ] ) func_name = f"hashmap_getiter_{key_type_postfix}_to_{value_type_postfix}" fn_hashmap_getiter = cgutils . get_or_insert_function ( builder . module , fnty , name = func_name ) cdict = cgutils . create_struct_proxy ( dict_type ) ( context , builder , value = dict_val ) it . state = builder . call ( fn_hashmap_getiter , [ it . _get_ptr_by_name ( 'meminfo' ) , nrt_table , cdict . data_ptr ] ) # store the reference to parent and incref it . parent = dict_val if context . enable_nrt : context . nrt . incref ( builder , dict_type , dict_val )