diff options
| author | gingerBill <ginger.bill.22@gmail.com> | 2016-08-15 21:22:44 +0100 |
|---|---|---|
| committer | gingerBill <ginger.bill.22@gmail.com> | 2016-08-16 10:56:44 +0100 |
| commit | 0dd17fe84308bba09c6d2ba15f8b8504bbcf5c89 (patch) | |
| tree | 720ab8306146f4febc14c72ae7601fb90bc487dc /src/codegen/codegen.cpp | |
| parent | dcbb2fcfbdbd3b35ddc44a4c542b7c6375e47214 (diff) | |
Win32 Window Test
Diffstat (limited to 'src/codegen/codegen.cpp')
| -rw-r--r-- | src/codegen/codegen.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/codegen/codegen.cpp b/src/codegen/codegen.cpp index 43957ba76..4b9d943c4 100644 --- a/src/codegen/codegen.cpp +++ b/src/codegen/codegen.cpp @@ -71,14 +71,15 @@ void ssa_gen_code(ssaGen *s) { } break; case Entity_Variable: { - ssaValue *value = ssa_build_expr(&dummy_proc, decl->init_expr); - if (value->kind == ssaValue_Instr) { - ssaInstr *i = &value->instr; - if (i->kind == ssaInstr_Load) { - value = i->load.address; - } - } - ssaValue *g = ssa_make_value_global(a, e, value); + // ssaValue *value = ssa_build_expr(&dummy_proc, decl->init_expr); + // if (value->kind == ssaValue_Instr) { + // ssaInstr *i = &value->instr; + // if (i->kind == ssaInstr_Load) { + // value = i->load.address; + // } + // } + // TODO(bill): global runtime initialization + ssaValue *g = ssa_make_value_global(a, e, NULL); map_set(&m->values, hash_pointer(e), g); map_set(&m->members, hash_string(name), g); } break; @@ -91,6 +92,8 @@ void ssa_gen_code(ssaGen *s) { name = pd->foreign_name; } ssaValue *p = ssa_make_value_procedure(a, m, e->type, decl->type_expr, body, name); + p->proc.tags = pd->tags; + map_set(&m->values, hash_pointer(e), p); map_set(&m->members, hash_string(name), p); } break; |