From 3cd6ae311df68c1ac8b4015ebf5eef694126a59b Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 8 Sep 2018 12:02:25 +0100 Subject: Parametric polymorphic union type --- src/ir.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index c36fc4d6d..a46c375ae 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -8104,9 +8104,10 @@ void ir_setup_type_info_data(irProcedure *proc) { // NOTE(bill): Setup type_info tag = ir_emit_conv(proc, variant_ptr, t_type_info_union_ptr); { - irValue *variant_types = ir_emit_struct_ep(proc, tag, 0); - irValue *tag_offset_ptr = ir_emit_struct_ep(proc, tag, 1); - irValue *tag_type_ptr = ir_emit_struct_ep(proc, tag, 2); + irValue *variant_types = ir_emit_struct_ep(proc, tag, 0); + irValue *tag_offset_ptr = ir_emit_struct_ep(proc, tag, 1); + irValue *tag_type_ptr = ir_emit_struct_ep(proc, tag, 2); + irValue *custom_align_ptr = ir_emit_struct_ep(proc, tag, 3); isize variant_count = gb_max(0, t->Union.variants.count); irValue *memory_types = ir_type_info_member_types_offset(proc, variant_count); @@ -8131,6 +8132,9 @@ void ir_setup_type_info_data(irProcedure *proc) { // NOTE(bill): Setup type_info ir_emit_store(proc, tag_offset_ptr, ir_const_uintptr(tag_offset)); ir_emit_store(proc, tag_type_ptr, ir_type_info(proc, union_tag_type(t))); } + + irValue *is_custom_align = ir_const_bool(t->Union.custom_align != 0); + ir_emit_store(proc, custom_align_ptr, is_custom_align); } break; -- cgit v1.2.3