From 41b6d215bb381ecb4190acd8cbde481442b7ab85 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 3 Mar 2018 20:07:12 +0000 Subject: Fix `using` determination order --- src/ir.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index 5b488c403..74f51d727 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -683,7 +683,7 @@ bool ir_type_has_default_values(Type *t) { case Type_Struct: if (t->Struct.is_raw_union) return false; for_array(i, t->Struct.fields) { - Entity *f = t->Struct.fields_in_src_order[i]; + Entity *f = t->Struct.fields[i]; if (f->kind != Entity_Variable) continue; if (f->Variable.default_is_nil) { // NOTE(bill): This is technically zero @@ -4735,7 +4735,7 @@ irValue *ir_build_builtin_proc(irProcedure *proc, AstNode *expr, TypeAndValue tv irValue *tuple = ir_add_local_generated(proc, tv.type); for_array(src_index, t->Struct.fields) { - Entity *field = t->Struct.fields_in_src_order[src_index]; + Entity *field = t->Struct.fields[src_index]; i32 field_index = field->Variable.field_index; irValue *f = ir_emit_struct_ev(proc, s, field_index); irValue *ep = ir_emit_struct_ep(proc, tuple, cast(i32)src_index); @@ -5851,7 +5851,7 @@ irAddr ir_build_addr(irProcedure *proc, AstNode *expr) { } else { TypeAndValue tav = type_and_value_of_expr(proc->module->info, elem); Selection sel = lookup_field_from_index(proc->module->allocator, bt, - st->fields_in_src_order[field_index]->Variable.field_src_index); + st->fields[field_index]->Variable.field_src_index); index = sel.index[0]; } @@ -8141,7 +8141,7 @@ void ir_setup_type_info_data(irProcedure *proc) { // NOTE(bill): Setup type_info type_set_offsets(a, t); // NOTE(bill): Just incase the offsets have not been set yet for (isize source_index = 0; source_index < count; source_index++) { // TODO(bill): Order fields in source order not layout order - Entity *f = t->Struct.fields_in_src_order[source_index]; + Entity *f = t->Struct.fields[source_index]; irValue *tip = ir_get_type_info_ptr(proc, f->type); i64 foffset = 0; if (!t->Struct.is_raw_union) { -- cgit v1.2.3