diff options
| author | gingerBill <bill@gingerbill.org> | 2019-12-27 15:49:52 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-12-27 15:49:52 +0000 |
| commit | f99f351e01dc8140a36c1a9b5568f5081cfa1e70 (patch) | |
| tree | cd981905bb5924532624f375bfb478ea639d1d16 /src/ir.cpp | |
| parent | 880c7f01a8ee71f9001ad7d9558753cf8d512845 (diff) | |
Add constant literal expressions
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 97ab4649f..05d946691 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -6978,6 +6978,13 @@ irValue *ir_build_expr_internal(irProcedure *proc, Ast *expr) { return ir_addr_load(proc, ir_build_addr(proc, expr)); } + if (tv.mode == Addressing_Constant) { + GB_ASSERT(tv.value.kind == ExactValue_Invalid); + // NOTE(bill): Zero value constant + return ir_add_module_constant(proc->module, tv.type, tv.value); + } + + switch (expr->kind) { case_ast_node(bl, BasicLit, expr); TokenPos pos = bl->token.pos; |