diff options
| author | gingerBill <bill@gingerbill.org> | 2018-09-08 12:02:25 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-09-08 12:02:25 +0100 |
| commit | 3cd6ae311df68c1ac8b4015ebf5eef694126a59b (patch) | |
| tree | 11ef64b5c9187dfd1dfd3ee0d9d268eed84fea45 /src/ir.cpp | |
| parent | 26cfc0257dc891816d6bcdd311a6c348e1d9cdf5 (diff) | |
Parametric polymorphic union type
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
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; |