diff options
| author | gingerBill <bill@gingerbill.org> | 2021-09-13 00:58:39 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-09-13 00:58:39 +0100 |
| commit | fb8fa5217d4a5081dacc0a74a786cd2efc964fdb (patch) | |
| tree | 49724edef53493c6630aa8b2ae91ea3ad57621a4 /src/llvm_backend_expr.cpp | |
| parent | 6585601765c24523e43ca3a158abc61d373168db (diff) | |
Begin minimize `Type` size by replacing `Array` with `Slice` etc
Diffstat (limited to 'src/llvm_backend_expr.cpp')
| -rw-r--r-- | src/llvm_backend_expr.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/llvm_backend_expr.cpp b/src/llvm_backend_expr.cpp index a4b4564c0..efd0eaf40 100644 --- a/src/llvm_backend_expr.cpp +++ b/src/llvm_backend_expr.cpp @@ -2872,13 +2872,13 @@ lbAddr lb_build_addr(lbProcedure *p, Ast *expr) { auto index_tv = type_and_value_of_expr(ie->index); lbValue index = {}; - if (compare_exact_values(Token_NotEq, t->EnumeratedArray.min_value, exact_value_i64(0))) { + if (compare_exact_values(Token_NotEq, *t->EnumeratedArray.min_value, exact_value_i64(0))) { if (index_tv.mode == Addressing_Constant) { - ExactValue idx = exact_value_sub(index_tv.value, t->EnumeratedArray.min_value); + ExactValue idx = exact_value_sub(index_tv.value, *t->EnumeratedArray.min_value); index = lb_const_value(p->module, index_type, idx); } else { index = lb_emit_conv(p, lb_build_expr(p, ie->index), t_int); - index = lb_emit_arith(p, Token_Sub, index, lb_const_value(p->module, index_type, t->EnumeratedArray.min_value), index_type); + index = lb_emit_arith(p, Token_Sub, index, lb_const_value(p->module, index_type, *t->EnumeratedArray.min_value), index_type); } } else { index = lb_emit_conv(p, lb_build_expr(p, ie->index), t_int); @@ -3472,7 +3472,7 @@ lbAddr lb_build_addr(lbProcedure *p, Ast *expr) { } - i32 index_offset = cast(i32)exact_value_to_i64(bt->EnumeratedArray.min_value); + i32 index_offset = cast(i32)exact_value_to_i64(*bt->EnumeratedArray.min_value); for_array(i, temp_data) { i32 index = temp_data[i].elem_index - index_offset; |