aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-06-03 21:10:07 +0100
committergingerBill <bill@gingerbill.org>2020-06-03 21:10:07 +0100
commitd80049bfd253b950ad0467717444c2135124af95 (patch)
treea71f760de9b49cdcd74c779de0a29c730a01c745 /src/ir.cpp
parent626b4740b148a86f2ed484528e08981e86ea4dea (diff)
Change runtime.Type_Info_Enum_Value to be `i64` internally rather than a `union`
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 066089211..381c24459 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -9799,7 +9799,7 @@ void ir_build_range_enum(irProcedure *proc, Type *enum_type, Type *val_type, irV
GB_ASSERT(are_types_identical(enum_type, val_type));
if (is_type_integer(core_elem)) {
- irValue *i = ir_emit_load(proc, ir_emit_conv(proc, val_ptr, t_i64_ptr));
+ irValue *i = ir_emit_load(proc, val_ptr);
val = ir_emit_conv(proc, i, t);
} else {
GB_PANIC("TODO(bill): enum core type %s", type_to_string(core_elem));
@@ -11812,8 +11812,8 @@ void ir_setup_type_info_data(irProcedure *proc) { // NOTE(bill): Setup type_info
irValue *min_v = ir_value_constant(core_type(t->EnumeratedArray.index), t->EnumeratedArray.min_value);
irValue *max_v = ir_value_constant(core_type(t->EnumeratedArray.index), t->EnumeratedArray.max_value);
- ir_emit_store_union_variant(proc, min_value, min_v, ir_type(min_v));
- ir_emit_store_union_variant(proc, max_value, max_v, ir_type(max_v));
+ ir_emit_store(proc, min_value, min_v);
+ ir_emit_store(proc, max_value, max_v);
break;
}
case Type_DynamicArray: {
@@ -11907,9 +11907,9 @@ void ir_setup_type_info_data(irProcedure *proc) { // NOTE(bill): Setup type_info
irValue *value_ep = ir_emit_array_epi(proc, value_array, cast(i32)i);
ExactValue value = fields[i]->Constant.value;
- irValue *v = ir_value_constant(t->Enum.base_type, value);
+ irValue *v = ir_value_constant(t_i64, value);
- ir_emit_store_union_variant(proc, value_ep, v, ir_type(v));
+ ir_emit_store(proc, value_ep, v);
ir_emit_store(proc, name_ep, ir_const_string(proc->module, fields[i]->token.string));
}