From: fennecdjay Date: Sun, 24 Nov 2019 23:45:03 +0000 (+0100) Subject: :art: Finish removing memoize X-Git-Tag: nightly~2085 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=959662c6b8cb6236dffa44ee68c1a4b7a86feb46;p=gwion.git :art: Finish removing memoize --- diff --git a/include/arg.h b/include/arg.h index e3e4f1a9..86c08db6 100644 --- a/include/arg.h +++ b/include/arg.h @@ -10,7 +10,6 @@ typedef struct Arg_ { struct SoundInfo_ *si; int argc; m_bool loop; - m_bool memoize; } Arg; ANN void arg_release(Arg*); diff --git a/src/arg.c b/src/arg.c index 36fa1db3..39652278 100644 --- a/src/arg.c +++ b/src/arg.c @@ -57,7 +57,6 @@ static const char usage[] = " -o : set output channel number\n" " -d : set driver (and arguments)\n" " -l : set loop mode\n" -" -z : set memoization limit\n" " -m : load module (and arguments)\n" " -g : set Gwion compiler passes order\n"; @@ -105,10 +104,6 @@ ANN m_bool _arg_parse(const Gwion gwion, Arg* arg) { CHECK_OB((tmp = _get_arg(arg, &i))) arg->loop = (m_bool)ARG2INT(tmp) > 0 ? 1 : -1; break; - case 'z': - CHECK_OB((tmp = _get_arg(arg, &i))) - arg->memoize = (uint32_t)ARG2INT(tmp); - break; case 'i': CHECK_OB((tmp = _get_arg(arg, &i))) arg->si->in = (uint8_t)ARG2INT(tmp); diff --git a/src/emit/emit.c b/src/emit/emit.c index 14b51d4a..8b52a7c3 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -1201,10 +1201,6 @@ ANN2(1) static m_bool emit_exp(const Emitter emit, Exp exp, const m_bool ref) { } if(exp->cast_to) CHECK_BB(emit_implicit_cast(emit, exp, exp->cast_to)) - if(emit->env->func && isa(exp->type, emit->gwion->type[et_lambda]) < 0 && - isa(exp->type, emit->gwion->type[et_function]) > 0 && - !GET_FLAG(exp->type->e->d.func->value_ref->d.func_ref, pure)) - UNSET_FLAG(emit->env->func, pure); } while((exp = exp->next)); return GW_OK; } diff --git a/src/gwion.c b/src/gwion.c index 727609c9..ad6d42e1 100644 --- a/src/gwion.c +++ b/src/gwion.c @@ -75,7 +75,6 @@ ANN m_bool gwion_ini(const Gwion gwion, Arg* arg) { const m_bool ret = arg_parse(gwion, arg); if(ret) { gwion->data->plug = new_pluginfo(gwion->mp, &arg->lib); - gwion->emit->info->memoize = arg->memoize; shreduler_set_loop(gwion->vm->shreduler, arg->loop); if(gwion_audio(gwion) > 0 && gwion_engine(gwion)) { plug_run(gwion, &arg->mod); diff --git a/src/parse/check.c b/src/parse/check.c index f79ca2bc..8b4dfe64 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -409,7 +409,7 @@ ANN static void fill_tl_vector(const Env env, Nspc nspc, const Vector v) { } } -ANN static Type_List mk_type_list(const Env env, const Type type) { +ANN static Type_List mk_type_list(const Env env, const Type type, const loc_t pos) { struct Vector_ v; vector_init(&v); vector_add(&v, (vtype)insert_symbol(type->name)); @@ -417,7 +417,7 @@ ANN static Type_List mk_type_list(const Env env, const Type type) { fill_tl_vector(env, type->e->owner, &v); ID_List id = NULL; for(m_uint i = 0 ; i < vector_size(&v); ++i) - id = prepend_id_list(env->gwion->mp, (Symbol)vector_at(&v, i), id, new_loc(env->gwion->mp, __LINE__)); + id = prepend_id_list(env->gwion->mp, (Symbol)vector_at(&v, i), id, loc_cpy(env->gwion->mp, pos)); vector_release(&v); assert(id); Type_Decl* td = new_type_decl(env->gwion->mp, id); @@ -710,7 +710,7 @@ ANN static Type_List check_template_args(const Env env, Exp_Call *exp, const Tmp char path[id_list_len(arg->td->xid)]; type_path(path, arg->td->xid); if(!strcmp(s_name(list->xid), path)) { - tl[args_number] = mk_type_list(env, template_arg->type); + tl[args_number] = mk_type_list(env, template_arg->type, fdef->pos); if(args_number) tl[args_number - 1]->next = tl[args_number]; ++args_number;