diff options
| author | Carson Fleming <cflems@cflems.net> | 2026-08-06 00:24:49 -0400 |
|---|---|---|
| committer | Carson Fleming <cflems@cflems.net> | 2026-08-06 00:24:49 -0400 |
| commit | b48e27f5cc31af65d8bb92d4b81cd03a60c5bcdb (patch) | |
| tree | 0901fba9ff451968d758ed47b57ff99d1330fb8a /scope.h | |
| parent | a207a7f39514f03ddfafbe39e52a3fae57a414b4 (diff) | |
| download | ccc-b48e27f5cc31af65d8bb92d4b81cd03a60c5bcdb.tar.gz | |
clean up yesterday's hacks + functions in type system
Diffstat (limited to 'scope.h')
| -rw-r--r-- | scope.h | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -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 { |
