authorgravatar for alex_naskos@hotmail.comAlexandros Naskos <alex_naskos@hotmail.com> 2018-04-26 18:18:47+03:00
committergravatar for alex_naskos@hotmail.comAlexandros Naskos <alex_naskos@hotmail.com> 2018-04-26 18:18:47+03:00
logfbbbee6b72991b65c31a8eac8f1edfc3d1a88b59
tree5b8d11c6d73c9bea57f09d2b52ae984337775def
parent4aa5d87ada56f9887d49c7a2a80246e0bb9d5fb9

Switched to shallow TypeInfo.


2 files changed, 69 insertions(+), 226 deletions(-)

src/codegen.cpp+12-12
......@@ -6390,12 +6390,12 @@ static void define_builtin_compile_vars(CodeGen *g) {
63906390 " is_const: bool,\n"
63916391 " is_volatile: bool,\n"
63926392 " alignment: u32,\n"
6393 " child: &TypeInfo,\n"
6393 " child: type,\n"
63946394 " };\n"
63956395 "\n"
63966396 " pub const Array = struct {\n"
63976397 " len: usize,\n"
6398 " child: &TypeInfo,\n"
6398 " child: type,\n"
63996399 " };\n"
64006400 "\n"
64016401 " pub const ContainerLayout = enum {\n"
......@@ -6412,7 +6412,7 @@ static void define_builtin_compile_vars(CodeGen *g) {
64126412 " pub const StructField = struct {\n"
64136413 " name: []const u8,\n"
64146414 " offset: usize,\n"
6415 " type_info: &TypeInfo,\n"
6415 " field_type: type,\n"
64166416 " };\n"
64176417 "\n"
64186418 " pub const Struct = struct {\n"
......@@ -6422,12 +6422,12 @@ static void define_builtin_compile_vars(CodeGen *g) {
64226422 " };\n"
64236423 "\n"
64246424 " pub const Nullable = struct {\n"
6425 " child: &TypeInfo,\n"
6425 " child: type,\n"
64266426 " };\n"
64276427 "\n"
64286428 " pub const ErrorUnion = struct {\n"
64296429 " error_set: &ErrorSet,\n"
6430 " payload: &TypeInfo,\n"
6430 " payload: type,\n"
64316431 " };\n"
64326432 "\n"
64336433 " pub const Error = struct {\n"
......@@ -6446,7 +6446,7 @@ static void define_builtin_compile_vars(CodeGen *g) {
64466446 "\n"
64476447 " pub const Enum = struct {\n"
64486448 " layout: ContainerLayout,\n"
6449 " tag_type: &Int,\n"
6449 " tag_type: type,\n"
64506450 " fields: []EnumField,\n"
64516451 " methods: []Method,\n"
64526452 " };\n"
......@@ -6454,12 +6454,12 @@ static void define_builtin_compile_vars(CodeGen *g) {
64546454 " pub const UnionField = struct {\n"
64556455 " name: []const u8,\n"
64566456 " enum_field: EnumField,\n"
6457 " type_info: &TypeInfo,\n"
6457 " field_type: type,\n"
64586458 " };\n"
64596459 "\n"
64606460 " pub const Union = struct {\n"
64616461 " layout: ContainerLayout,\n"
6462 " tag_type: ?Enum,\n"
6462 " tag_type: type,\n"
64636463 " fields: []UnionField,\n"
64646464 " methods: []Method,\n"
64656465 " };\n"
......@@ -6476,24 +6476,24 @@ static void define_builtin_compile_vars(CodeGen *g) {
64766476 " pub const FnArg = struct {\n"
64776477 " is_comptime: bool,\n"
64786478 " name: []const u8,\n"
6479 " type_info: &TypeInfo,\n"
6479 " arg_type: type,\n"
64806480 " };\n"
64816481 "\n"
64826482 " pub const Fn = struct {\n"
64836483 " calling_convention: CallingConvention,\n"
64846484 " is_generic: bool,\n"
64856485 " is_varargs: bool,\n"
6486 " return_type: &TypeInfo,\n"
6486 " return_type: type,\n"
64876487 " args: []FnArg,\n"
64886488 " };\n"
64896489 "\n"
64906490 " pub const BoundFn = struct {\n"
6491 " bound_type: &TypeInfo,\n"
6491 " bound_type: type,\n"
64926492 " fn_info: Fn,\n"
64936493 " };\n"
64946494 "\n"
64956495 " pub const Promise = struct {\n"
6496 " child: ?&TypeInfo,\n"
6496 " child: type,\n"
64976497 " };\n"
64986498 "};\n\n");
64996499 assert(ContainerLayoutAuto == 0);
src/ir.cpp+57-214
......@@ -15748,31 +15748,6 @@ static void ensure_field_index(TypeTableEntry *type, const char *field_name, siz
1574815748 (buf_deinit(field_name_buf), true));
1574915749}
1575015750
15751static void ir_type_info_struct_set_parent(ConstExprValue *struct_val, ConstExprValue *parent, ssize_t parent_field_index)
15752{
15753 assert(struct_val->type->id == TypeTableEntryIdStruct);
15754 assert(parent->type != nullptr && !type_is_invalid(parent->type));
15755
15756 switch (parent->type->id)
15757 {
15758 case TypeTableEntryIdArray:
15759 zig_panic("TODO - Only expected struct or union parent.");
15760 case TypeTableEntryIdStruct:
15761 assert(parent_field_index >= 0);
15762 struct_val->data.x_struct.parent.id = ConstParentIdStruct;
15763 struct_val->data.x_struct.parent.data.p_struct.struct_val = parent;
15764 struct_val->data.x_struct.parent.data.p_struct.field_index = parent_field_index;
15765 break;
15766 case TypeTableEntryIdUnion:
15767 assert(parent_field_index == -1);
15768 struct_val->data.x_struct.parent.id = ConstParentIdUnion;
15769 struct_val->data.x_struct.parent.data.p_union.union_val = parent;
15770 break;
15771 default:
15772 struct_val->data.x_struct.parent.id = ConstParentIdNone;
15773 }
15774}
15775
1577615751static TypeTableEntry *ir_type_info_get_type(IrAnalyze *ira, const char *type_name)
1577715752{
1577815753 static ConstExprValue *type_info_var = nullptr;
......@@ -15807,69 +15782,12 @@ static TypeTableEntry *ir_type_info_get_type(IrAnalyze *ira, const char *type_na
1580715782 return var->value->data.x_type;
1580815783}
1580915784
15810static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, ConstExprValue *parent,
15811 ssize_t parent_field_index, TypeTableEntry *type_entry)
15785static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *type_entry)
1581215786{
1581315787 assert(type_entry != nullptr);
1581415788 assert(!type_is_invalid(type_entry));
1581515789
15816 // Lookup an available value in our cache.
15817 auto entry = ira->codegen->type_info_cache.maybe_get(type_entry);
15818 if (entry != nullptr)
15819 {
15820 // Override the parent if we need to.
15821 ConstExprValue *result = entry->value;
15822
15823 assert(result->type->id == TypeTableEntryIdStruct);
15824
15825 ConstParent *curr_parent = &result->data.x_struct.parent;
15826 if (curr_parent->id == ConstParentIdStruct)
15827 {
15828 if (curr_parent->data.p_struct.struct_val == parent &&
15829 parent_field_index != -1 &&
15830 curr_parent->data.p_struct.field_index == (size_t)parent_field_index)
15831 {
15832 return result;
15833 }
15834 ConstExprValue *new_result = create_const_vals(1);
15835 copy_const_val(new_result, result, true);
15836 ir_type_info_struct_set_parent(new_result, parent, parent_field_index);
15837 return new_result;
15838 }
15839 else if (curr_parent->id == ConstParentIdUnion)
15840 {
15841 if (curr_parent->data.p_union.union_val == parent)
15842 {
15843 return result;
15844 }
15845 ConstExprValue *new_result = create_const_vals(1);
15846 copy_const_val(new_result, result, true);
15847 ir_type_info_struct_set_parent(new_result, parent, parent_field_index);
15848 return new_result;
15849 }
15850 else if (curr_parent->id == ConstParentIdNone)
15851 {
15852 if (parent->type->id != TypeTableEntryIdStruct &&
15853 parent->type->id != TypeTableEntryIdArray &&
15854 parent->type->id != TypeTableEntryIdUnion)
15855 {
15856 return result;
15857 }
15858 ConstExprValue *new_result = create_const_vals(1);
15859 copy_const_val(new_result, result, true);
15860 ir_type_info_struct_set_parent(new_result, parent, parent_field_index);
15861 return new_result;
15862 }
15863
15864 return result;
15865 }
15866
15867 // If the value is not present in the cache, we will build it, add it and return it.
15868 // We add values to the cache eagerly, as soon as we have filled out the root object's fields.
15869 // That way, if we need to fetch the value in a recursive call down the line, even if we need to
15870 // copy the value and reajust the parent, the value we get back still points to child values that
15871 // will be filled later.
15872
15790 ConstExprValue *result = nullptr;
1587315791 switch (type_entry->id)
1587415792 {
1587515793 case TypeTableEntryIdInvalid:
......@@ -15887,18 +15805,24 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, ConstExprValue *p
1588715805 case TypeTableEntryIdArgTuple:
1588815806 case TypeTableEntryIdOpaque:
1588915807 return nullptr;
15808 default:
15809 {
15810 // Lookup an available value in our cache.
15811 auto entry = ira->codegen->type_info_cache.maybe_get(type_entry);
15812 if (entry != nullptr)
15813 return entry->value;
15814
15815 // Fallthrough if we don't find one.
15816 }
1589015817 case TypeTableEntryIdInt:
1589115818 {
15892 ConstExprValue *result = create_const_vals(1);
15819 result = create_const_vals(1);
1589315820 result->special = ConstValSpecialStatic;
1589415821 result->type = ir_type_info_get_type(ira, "Int");
1589515822
1589615823 ConstExprValue *fields = create_const_vals(2);
1589715824 result->data.x_struct.fields = fields;
1589815825
15899 ir_type_info_struct_set_parent(result, parent, parent_field_index);
15900 ira->codegen->type_info_cache.put(type_entry, result);
15901
1590215826 // is_signed: bool
1590315827 ensure_field_index(result->type, "is_signed", 0);
1590415828 fields[0].special = ConstValSpecialStatic;
......@@ -15910,40 +15834,34 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, ConstExprValue *p
1591015834 fields[1].type = ira->codegen->builtin_types.entry_u8;
1591115835 bigint_init_unsigned(&fields[1].data.x_bigint, type_entry->data.integral.bit_count);
1591215836
15913 return result;
15837 break;
1591415838 }
1591515839 case TypeTableEntryIdFloat:
1591615840 {
15917 ConstExprValue *result = create_const_vals(1);
15841 result = create_const_vals(1);
1591815842 result->special = ConstValSpecialStatic;
1591915843 result->type = ir_type_info_get_type(ira, "Float");
1592015844
1592115845 ConstExprValue *fields = create_const_vals(1);
1592215846 result->data.x_struct.fields = fields;
1592315847
15924 ir_type_info_struct_set_parent(result, parent, parent_field_index);
15925 ira->codegen->type_info_cache.put(type_entry, result);
15926
1592715848 // bits: u8
1592815849 ensure_field_index(result->type, "bits", 0);
1592915850 fields[0].special = ConstValSpecialStatic;
1593015851 fields[0].type = ira->codegen->builtin_types.entry_u8;
1593115852 bigint_init_unsigned(&fields->data.x_bigint, type_entry->data.floating.bit_count);
1593215853
15933 return result;
15854 break;
1593415855 }
1593515856 case TypeTableEntryIdPointer:
1593615857 {
15937 ConstExprValue *result = create_const_vals(1);
15858 result = create_const_vals(1);
1593815859 result->special = ConstValSpecialStatic;
1593915860 result->type = ir_type_info_get_type(ira, "Pointer");
1594015861
1594115862 ConstExprValue *fields = create_const_vals(4);
1594215863 result->data.x_struct.fields = fields;
1594315864
15944 ir_type_info_struct_set_parent(result, parent, parent_field_index);
15945 ira->codegen->type_info_cache.put(type_entry, result);
15946
1594715865 // is_const: bool
1594815866 ensure_field_index(result->type, "is_const", 0);
1594915867 fields[0].special = ConstValSpecialStatic;
......@@ -15959,175 +15877,94 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, ConstExprValue *p
1595915877 fields[2].special = ConstValSpecialStatic;
1596015878 fields[2].type = ira->codegen->builtin_types.entry_u32;
1596115879 bigint_init_unsigned(&fields[2].data.x_bigint, type_entry->data.pointer.alignment);
15962 // child: &TypeInfo
15880 // child: type
1596315881 ensure_field_index(result->type, "child", 3);
15964
15965 TypeTableEntry *type_info_type = ir_type_info_get_type(ira, nullptr);
15966
1596715882 fields[3].special = ConstValSpecialStatic;
15968 fields[3].type = get_pointer_to_type(ira->codegen, type_info_type, false);
15969 fields[3].data.x_ptr.special = ConstPtrSpecialRef;
15970 fields[3].data.x_ptr.mut = ConstPtrMutComptimeVar;
15971 ConstExprValue *union_val = create_const_vals(1);
15972 union_val->special = ConstValSpecialStatic;
15973 union_val->type = type_info_type;
15974 bigint_init_unsigned(&union_val->data.x_union.tag, type_id_index(type_entry->data.pointer.child_type->id));
15883 fields[3].type = ira->codegen->builtin_types.entry_type;
15884 fields[3].data.x_type = type_entry->data.pointer.child_type;
1597515885
15976 union_val->data.x_union.payload = ir_make_type_info_value(ira, union_val, -1,
15977 type_entry->data.pointer.child_type);
15978
15979 fields[3].data.x_ptr.data.ref.pointee = union_val;
15980
15981 return result;
15886 break;
1598215887 }
1598315888 case TypeTableEntryIdArray:
1598415889 {
15985 ConstExprValue *result = create_const_vals(1);
15890 result = create_const_vals(1);
1598615891 result->special = ConstValSpecialStatic;
1598715892 result->type = ir_type_info_get_type(ira, "Array");
1598815893
1598915894 ConstExprValue *fields = create_const_vals(2);
1599015895 result->data.x_struct.fields = fields;
1599115896
15992 ir_type_info_struct_set_parent(result, parent, parent_field_index);
15993 ira->codegen->type_info_cache.put(type_entry, result);
15994
1599515897 // len: usize
1599615898 ensure_field_index(result->type, "len", 0);
1599715899 fields[0].special = ConstValSpecialStatic;
1599815900 fields[0].type = ira->codegen->builtin_types.entry_usize;
1599915901 bigint_init_unsigned(&fields[0].data.x_bigint, type_entry->data.array.len);
16000 // child: &TypeInfo
15902 // child: type
1600115903 ensure_field_index(result->type, "child", 1);
16002 TypeTableEntry *type_info_type = ir_type_info_get_type(ira, nullptr);
16003
1600415904 fields[1].special = ConstValSpecialStatic;
16005 fields[1].type = get_pointer_to_type(ira->codegen, type_info_type, false);
16006 fields[1].data.x_ptr.special = ConstPtrSpecialRef;
16007 fields[1].data.x_ptr.mut = ConstPtrMutComptimeVar;
16008 ConstExprValue *union_val = create_const_vals(1);
16009 union_val->special = ConstValSpecialStatic;
16010 union_val->type = type_info_type;
16011 bigint_init_unsigned(&union_val->data.x_union.tag, type_id_index(type_entry->data.array.child_type->id));
15905 fields[1].type = ira->codegen->builtin_types.entry_type;
15906 fields[1].data.x_type = type_entry->data.array.child_type;
1601215907
16013 union_val->data.x_union.payload = ir_make_type_info_value(ira, union_val, -1,
16014 type_entry->data.array.child_type);
16015
16016 fields[1].data.x_ptr.data.ref.pointee = union_val;
16017
16018 return result;
15908 break;
1601915909 }
1602015910 case TypeTableEntryIdMaybe:
1602115911 {
16022 ConstExprValue *result = create_const_vals(1);
15912 result = create_const_vals(1);
1602315913 result->special = ConstValSpecialStatic;
1602415914 result->type = ir_type_info_get_type(ira, "Nullable");
1602515915
1602615916 ConstExprValue *fields = create_const_vals(1);
1602715917 result->data.x_struct.fields = fields;
1602815918
16029 ir_type_info_struct_set_parent(result, parent, parent_field_index);
16030 ira->codegen->type_info_cache.put(type_entry, result);
16031
16032 // child: &TypeInfo
15919 // child: type
1603315920 ensure_field_index(result->type, "child", 0);
16034
16035 TypeTableEntry *type_info_type = ir_type_info_get_type(ira, nullptr);
16036
1603715921 fields[0].special = ConstValSpecialStatic;
16038 fields[0].type = get_pointer_to_type(ira->codegen, type_info_type, false);
16039 fields[0].data.x_ptr.special = ConstPtrSpecialRef;
16040 fields[0].data.x_ptr.mut = ConstPtrMutComptimeVar;
16041 ConstExprValue *union_val = create_const_vals(1);
16042 union_val->special = ConstValSpecialStatic;
16043 union_val->type = type_info_type;
16044 bigint_init_unsigned(&union_val->data.x_union.tag, type_id_index(type_entry->data.maybe.child_type->id));
16045
16046 union_val->data.x_union.payload = ir_make_type_info_value(ira, union_val, -1,
16047 type_entry->data.maybe.child_type);
16048
16049 fields[0].data.x_ptr.data.ref.pointee = union_val;
15922 fields[0].type = ira->codegen->builtin_types.entry_type;
15923 fields[0].data.x_type = type_entry->data.maybe.child_type;
1605015924
16051 return result;
15925 break;
1605215926 }
1605315927 case TypeTableEntryIdPromise:
1605415928 {
16055 ConstExprValue *result = create_const_vals(1);
15929 result = create_const_vals(1);
1605615930 result->special = ConstValSpecialStatic;
1605715931 result->type = ir_type_info_get_type(ira, "Promise");
1605815932
1605915933 ConstExprValue *fields = create_const_vals(1);
1606015934 result->data.x_struct.fields = fields;
1606115935
16062 ir_type_info_struct_set_parent(result, parent, parent_field_index);
16063 ira->codegen->type_info_cache.put(type_entry, result);
16064
16065 // child: ?&TypeInfo
15936 // @TODO ?type instead of using @typeOf(undefined) when we have no type.
15937 // child: type
1606615938 ensure_field_index(result->type, "child", 0);
16067
16068 TypeTableEntry *type_info_type = ir_type_info_get_type(ira, nullptr);
16069 TypeTableEntry *type_info_ptr_type = get_pointer_to_type(ira->codegen, type_info_type, false);
16070
1607115939 fields[0].special = ConstValSpecialStatic;
16072 fields[0].type = get_maybe_type(ira->codegen, type_info_ptr_type);
15940 fields[0].type = ira->codegen->builtin_types.entry_type;
1607315941
1607415942 if (type_entry->data.promise.result_type == nullptr)
16075 {
16076 fields[0].data.x_maybe = nullptr;
16077 }
15943 fields[0].data.x_type = ira->codegen->builtin_types.entry_undef;
1607815944 else
16079 {
16080 ConstExprValue *maybe_value = create_const_vals(1);
16081 maybe_value->special = ConstValSpecialStatic;
16082 maybe_value->type = type_info_ptr_type;
16083
16084 maybe_value->data.x_ptr.special = ConstPtrSpecialRef;
16085 maybe_value->data.x_ptr.mut = ConstPtrMutComptimeVar;
16086
16087 ConstExprValue *union_val = create_const_vals(1);
16088 union_val->special = ConstValSpecialStatic;
16089 union_val->type = type_info_type;
16090 bigint_init_unsigned(&union_val->data.x_union.tag, type_id_index(type_entry->data.promise.result_type->id));
16091 union_val->data.x_union.payload = ir_make_type_info_value(ira, union_val, -1,
16092 type_entry->data.promise.result_type);
16093
16094 maybe_value->data.x_ptr.data.ref.pointee = union_val;
16095 fields[0].data.x_maybe = maybe_value;
16096 }
15945 fields[0].data.x_type = type_entry->data.promise.result_type;
1609715946
16098 return result;
15947 break;
1609915948 }
1610015949 case TypeTableEntryIdEnum:
1610115950 {
16102 ConstExprValue *result = create_const_vals(1);
15951 result = create_const_vals(1);
1610315952 result->special = ConstValSpecialStatic;
1610415953 result->type = ir_type_info_get_type(ira, "Enum");
1610515954
1610615955 ConstExprValue *fields = create_const_vals(4);
1610715956 result->data.x_struct.fields = fields;
1610815957
16109 ir_type_info_struct_set_parent(result, parent, parent_field_index);
16110 ira->codegen->type_info_cache.put(type_entry, result);
16111
1611215958 // layout: ContainerLayout
1611315959 ensure_field_index(result->type, "layout", 0);
1611415960 fields[0].special = ConstValSpecialStatic;
1611515961 fields[0].type = ir_type_info_get_type(ira, "ContainerLayout");
1611615962 bigint_init_unsigned(&fields[0].data.x_enum_tag, type_entry->data.enumeration.layout);
16117 // tag_type: &TypeInfo.Int
15963 // tag_type: type
1611815964 ensure_field_index(result->type, "tag_type", 1);
16119
16120 TypeTableEntry *type_info_int_type = ir_type_info_get_type(ira, "Int");
16121
1612215965 fields[1].special = ConstValSpecialStatic;
16123 fields[1].type = get_pointer_to_type(ira->codegen, type_info_int_type, false);
16124 fields[1].data.x_ptr.special = ConstPtrSpecialRef;
16125 fields[1].data.x_ptr.mut = ConstPtrMutComptimeVar;
16126
16127 ConstExprValue *tag_type_info_struct = ir_make_type_info_value(ira, &fields[1], -1,
16128 type_entry->data.enumeration.tag_int_type);
16129 assert(tag_type_info_struct->type == type_info_int_type);
16130 fields[1].data.x_ptr.data.ref.pointee = tag_type_info_struct;
15966 fields[1].type = ira->codegen->builtin_types.entry_type;
15967 fields[1].data.x_type = type_entry->data.enumeration.tag_int_type;
1613115968 // fields: []TypeInfo.EnumField
1613215969 ensure_field_index(result->type, "fields", 2);
1613315970
......@@ -16172,20 +16009,17 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, ConstExprValue *p
1617216009
1617316010 // @TODO
1617416011 // methods: []TypeInfo.Method
16175 return result;
16012 break;
1617616013 }
1617716014 case TypeTableEntryIdErrorSet:
1617816015 {
16179 ConstExprValue *result = create_const_vals(1);
16016 result = create_const_vals(1);
1618016017 result->special = ConstValSpecialStatic;
1618116018 result->type = ir_type_info_get_type(ira, "ErrorSet");
1618216019
1618316020 ConstExprValue *fields = create_const_vals(1);
1618416021 result->data.x_struct.fields = fields;
1618516022
16186 ir_type_info_struct_set_parent(result, parent, parent_field_index);
16187 ira->codegen->type_info_cache.put(type_entry, result);
16188
1618916023 // errors: []TypeInfo.Error
1619016024 ensure_field_index(result->type, "errors", 0);
1619116025
......@@ -16229,13 +16063,13 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, ConstExprValue *p
1622916063 error_val->data.x_struct.parent.data.p_array.elem_index = error_index;
1623016064 }
1623116065
16232 return result;
16066 break;
1623316067 }
16234 default:
16235 zig_unreachable();
1623616068 }
1623716069
16238 zig_unreachable();
16070 assert(result != nullptr);
16071 ira->codegen->type_info_cache.put(type_entry, result);
16072 return result;
1623916073}
1624016074
1624116075static TypeTableEntry *ir_analyze_instruction_type_info(IrAnalyze *ira,
......@@ -16251,7 +16085,16 @@ static TypeTableEntry *ir_analyze_instruction_type_info(IrAnalyze *ira,
1625116085 ConstExprValue *out_val = ir_build_const_from(ira, &instruction->base);
1625216086 out_val->type = result_type;
1625316087 bigint_init_unsigned(&out_val->data.x_union.tag, type_id_index(type_entry->id));
16254 out_val->data.x_union.payload = ir_make_type_info_value(ira, out_val, -1, type_entry);
16088
16089 ConstExprValue *payload = ir_make_type_info_value(ira, type_entry);
16090 out_val->data.x_union.payload = payload;
16091
16092 if (payload != nullptr)
16093 {
16094 assert(payload->type->id == TypeTableEntryIdStruct);
16095 payload->data.x_struct.parent.id = ConstParentIdUnion;
16096 payload->data.x_struct.parent.data.p_union.union_val = out_val;
16097 }
1625516098
1625616099 return result_type;
1625716100}