diff options
| author | Carson Fleming <cflems@cflems.net> | 2026-07-17 04:37:37 -0400 |
|---|---|---|
| committer | Carson Fleming <cflems@cflems.net> | 2026-07-17 04:53:31 -0400 |
| commit | 99af8891f6672493939bf3b43084082884e28d04 (patch) | |
| tree | b1f94d8b78b96e0258bef9133ffa9c8faeb2e2b7 /codegen.c | |
| parent | 82cf7004e351c9003af3019b2f7434ed8eeabf3e (diff) | |
| download | ccc-99af8891f6672493939bf3b43084082884e28d04.tar.gz | |
fix scope thing
Diffstat (limited to 'codegen.c')
| -rw-r--r-- | codegen.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -100,6 +100,8 @@ static void emit_storage_loc( case STO_IMM: fprintf(outfile, "%llu", loc->value); break; + case STO_UNRESOLVED: + CGEN_PANIC("can't emit unresolved storage location"); } } @@ -120,6 +122,8 @@ static bool locs_equal( return strcmp(a->label, b->label) == 0; case STO_FN: return a->decl == b->decl; + case STO_UNRESOLVED: + return false; } CGEN_PANIC("unhandled storage type case"); } @@ -176,6 +180,8 @@ static void emit_mov( case STO_IMM: CGEN_PANIC( "can't move value into immediate value %lld", dst->loc.value); + case STO_UNRESOLVED: + CGEN_PANIC("can't move value into unresolved storage"); } fprintf(outfile, "\n"); } @@ -580,6 +586,7 @@ static void emit_fn_decl(FILE* outfile, const struct fn_decl_node* node) { while (arg_decl != NULL) { struct lval_def arg_dst = make_stack_lval(outfile, &arg_decl->decl->type); + /* TODO: type checker should define vars, we just set their loc */ scope_define_var( scope, (struct var_def) { |
