aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_stmt.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-09-13 00:58:39 +0100
committergingerBill <bill@gingerbill.org>2021-09-13 00:58:39 +0100
commitfb8fa5217d4a5081dacc0a74a786cd2efc964fdb (patch)
tree49724edef53493c6630aa8b2ae91ea3ad57621a4 /src/llvm_backend_stmt.cpp
parent6585601765c24523e43ca3a158abc61d373168db (diff)
Begin minimize `Type` size by replacing `Array` with `Slice` etc
Diffstat (limited to 'src/llvm_backend_stmt.cpp')
-rw-r--r--src/llvm_backend_stmt.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/llvm_backend_stmt.cpp b/src/llvm_backend_stmt.cpp
index 148790ac6..ac922b642 100644
--- a/src/llvm_backend_stmt.cpp
+++ b/src/llvm_backend_stmt.cpp
@@ -332,8 +332,8 @@ void lb_build_range_indexed(lbProcedure *p, lbValue expr, Type *val_type, lbValu
val = lb_emit_load(p, lb_emit_array_ep(p, expr, idx));
// NOTE(bill): Override the idx value for the enumeration
Type *index_type = expr_type->EnumeratedArray.index;
- if (compare_exact_values(Token_NotEq, expr_type->EnumeratedArray.min_value, exact_value_u64(0))) {
- idx = lb_emit_arith(p, Token_Add, idx, lb_const_value(m, index_type, expr_type->EnumeratedArray.min_value), index_type);
+ if (compare_exact_values(Token_NotEq, *expr_type->EnumeratedArray.min_value, exact_value_u64(0))) {
+ idx = lb_emit_arith(p, Token_Add, idx, lb_const_value(m, index_type, *expr_type->EnumeratedArray.min_value), index_type);
}
}
break;
@@ -984,7 +984,7 @@ void lb_build_unroll_range_stmt(lbProcedure *p, AstUnrollRangeStmt *rs, Scope *s
lb_addr_store(p, val0_addr, lb_emit_load(p, elem));
}
if (val1_type) {
- ExactValue idx = exact_value_add(exact_value_i64(i), t->EnumeratedArray.min_value);
+ ExactValue idx = exact_value_add(exact_value_i64(i), *t->EnumeratedArray.min_value);
lb_addr_store(p, val1_addr, lb_const_value(m, val1_type, idx));
}