From 5522303540513a045d0f157d97aca7582a1dac77 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Sat, 3 Sep 2022 11:16:20 +0200 Subject: [PATCH] :art: clean is_static_call --- include/emit.h | 8 ++++---- src/emit/emit.c | 2 +- src/lib/object_op.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/emit.h b/include/emit.h index 1b4ad3a6..819506f8 100644 --- a/include/emit.h +++ b/include/emit.h @@ -95,12 +95,12 @@ ANN static inline Instr emit_compound_addref(const Emitter emit, const Type t, : emit_struct_addref(emit, t, size, emit_var); } -ANN static inline bool is_static_call(const Emitter emit, const Exp e) { +ANN static inline bool is_static_call(const Exp e) { if (e->exp_type != ae_exp_dot) return true; const Exp_Dot *member = &e->d.exp_dot; - return GET_FLAG(member->base->type, final) || - !vflag(exp_self(member)->type->info->value, vflag_member) || - is_class(emit->gwion, member->base->type) || + return GET_FLAG(e->type, final) || + GET_FLAG(member->base->type, final) || +// GET_FLAG(e->type->info->func, static) || member->base->exp_type == ae_exp_cast; } diff --git a/src/emit/emit.c b/src/emit/emit.c index 320b515d..51f30a64 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -1300,7 +1300,7 @@ ANN static m_bool _emit_exp_call(const Emitter emit, const Exp_Call *exp_call) { CHECK_BB(emit_func_args(emit, exp_call)); if (is_func(emit->gwion, t)) // is_callable needs type CHECK_BB(emit_exp_call1(emit, t->info->func, - is_static_call(emit, exp_call->func))); + is_static_call(exp_call->func))); else { struct Op_Import opi = {.op = insert_symbol("@ctor"), .rhs = t, diff --git a/src/lib/object_op.c b/src/lib/object_op.c index 3f61a2db..542abd6f 100644 --- a/src/lib/object_op.c +++ b/src/lib/object_op.c @@ -147,7 +147,7 @@ ANN static void emit_member_func(const Emitter emit, const Exp_Dot *member) { instr->m_val = (m_uint)f; return; } - } else if (is_static_call(emit, exp_self(member))) { + } else if (is_static_call(exp_self(member))) { if (member->is_call && f == emit->env->func) return; const Instr func_i = emit_add_instr(emit, f->code ? RegPushImm : SetFunc); func_i->m_val = (m_uint)f->code ?: (m_uint)f; -- 2.43.0