From b48e27f5cc31af65d8bb92d4b81cd03a60c5bcdb Mon Sep 17 00:00:00 2001 From: Carson Fleming Date: Thu, 6 Aug 2026 00:24:49 -0400 Subject: clean up yesterday's hacks + functions in type system --- scope.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'scope.h') diff --git a/scope.h b/scope.h index 4f7ac3a..c0c3d3b 100644 --- a/scope.h +++ b/scope.h @@ -5,35 +5,36 @@ #include "type.h" #include "hashmap.h" +struct type_alias { + const char* name; + struct type type; +}; + struct storage_location { enum { STO_REG, STO_LABEL, STO_STACK, STO_IMM, - /* I would like to solve functions using the type system - * and kill STO_FN and STO_UNRESOLVED in favor of STO_LABEL. */ - STO_FN, - STO_UNRESOLVED, } type; union { struct reg* reg; const char* label; sintegral_t bp_offset; integral_t value; - struct fn_decl_node* decl; }; }; -struct type_alias { - const char* name; - struct type type; +struct fn_def { + const struct fn_decl_node* decl; + bool resolved; }; struct var_def { const struct type* type; char* name; - struct storage_location loc; + struct fn_def fn; + struct storage_location storage; }; struct scope { -- cgit v1.2.3