| ... | ... | @@ -441,7 +441,7 @@ pub fn toValue(self: Type) Value { |
| 441 | 441 | |
| 442 | 442 | const RuntimeBitsError = SemaError || error{NeedLazy}; |
| 443 | 443 | |
| 444 | | pub fn hasRuntimeBits(ty: Type, zcu: *Zcu) bool { |
| 444 | pub fn hasRuntimeBits(ty: Type, zcu: *const Zcu) bool { |
| 445 | 445 | return hasRuntimeBitsInner(ty, false, .eager, zcu, {}) catch unreachable; |
| 446 | 446 | } |
| 447 | 447 | |
| ... | ... | @@ -452,7 +452,7 @@ pub fn hasRuntimeBitsSema(ty: Type, pt: Zcu.PerThread) SemaError!bool { |
| 452 | 452 | }; |
| 453 | 453 | } |
| 454 | 454 | |
| 455 | | pub fn hasRuntimeBitsIgnoreComptime(ty: Type, zcu: *Zcu) bool { |
| 455 | pub fn hasRuntimeBitsIgnoreComptime(ty: Type, zcu: *const Zcu) bool { |
| 456 | 456 | return hasRuntimeBitsInner(ty, true, .eager, zcu, {}) catch unreachable; |
| 457 | 457 | } |
| 458 | 458 | |
| ... | ... | @@ -471,7 +471,7 @@ pub fn hasRuntimeBitsInner( |
| 471 | 471 | ty: Type, |
| 472 | 472 | ignore_comptime_only: bool, |
| 473 | 473 | comptime strat: ResolveStratLazy, |
| 474 | | zcu: *Zcu, |
| 474 | zcu: strat.ZcuPtr(), |
| 475 | 475 | tid: strat.Tid(), |
| 476 | 476 | ) RuntimeBitsError!bool { |
| 477 | 477 | const ip = &zcu.intern_pool; |
| ... | ... | @@ -560,7 +560,7 @@ pub fn hasRuntimeBitsInner( |
| 560 | 560 | }, |
| 561 | 561 | .struct_type => { |
| 562 | 562 | const struct_type = ip.loadStructType(ty.toIntern()); |
| 563 | | if (struct_type.assumeRuntimeBitsIfFieldTypesWip(ip)) { |
| 563 | if (strat != .eager and struct_type.assumeRuntimeBitsIfFieldTypesWip(ip)) { |
| 564 | 564 | // In this case, we guess that hasRuntimeBits() for this type is true, |
| 565 | 565 | // and then later if our guess was incorrect, we emit a compile error. |
| 566 | 566 | return true; |
| ... | ... | @@ -596,7 +596,7 @@ pub fn hasRuntimeBitsInner( |
| 596 | 596 | const union_type = ip.loadUnionType(ty.toIntern()); |
| 597 | 597 | const union_flags = union_type.flagsUnordered(ip); |
| 598 | 598 | switch (union_flags.runtime_tag) { |
| 599 | | .none => { |
| 599 | .none => if (strat != .eager) { |
| 600 | 600 | // In this case, we guess that hasRuntimeBits() for this type is true, |
| 601 | 601 | // and then later if our guess was incorrect, we emit a compile error. |
| 602 | 602 | if (union_type.assumeRuntimeBitsIfFieldTypesWip(ip)) return true; |
| ... | ... | @@ -774,7 +774,7 @@ pub fn fnHasRuntimeBitsSema(ty: Type, pt: Zcu.PerThread) SemaError!bool { |
| 774 | 774 | pub fn fnHasRuntimeBitsInner( |
| 775 | 775 | ty: Type, |
| 776 | 776 | comptime strat: ResolveStrat, |
| 777 | | zcu: *Zcu, |
| 777 | zcu: strat.ZcuPtr(), |
| 778 | 778 | tid: strat.Tid(), |
| 779 | 779 | ) SemaError!bool { |
| 780 | 780 | const fn_info = zcu.typeToFunc(ty).?; |
| ... | ... | @@ -815,7 +815,7 @@ pub fn ptrAlignmentSema(ty: Type, pt: Zcu.PerThread) SemaError!Alignment { |
| 815 | 815 | pub fn ptrAlignmentInner( |
| 816 | 816 | ty: Type, |
| 817 | 817 | comptime strat: ResolveStrat, |
| 818 | | zcu: *Zcu, |
| 818 | zcu: strat.ZcuPtr(), |
| 819 | 819 | tid: strat.Tid(), |
| 820 | 820 | ) !Alignment { |
| 821 | 821 | return switch (zcu.intern_pool.indexToKey(ty.toIntern())) { |
| ... | ... | @@ -868,14 +868,25 @@ pub const ResolveStratLazy = enum { |
| 868 | 868 | /// This should typically be used from semantic analysis. |
| 869 | 869 | sema, |
| 870 | 870 | |
| 871 | | pub fn Tid(comptime strat: ResolveStratLazy) type { |
| 871 | pub fn Tid(strat: ResolveStratLazy) type { |
| 872 | 872 | return switch (strat) { |
| 873 | 873 | .lazy, .sema => Zcu.PerThread.Id, |
| 874 | 874 | .eager => void, |
| 875 | 875 | }; |
| 876 | 876 | } |
| 877 | 877 | |
| 878 | | pub fn pt(comptime strat: ResolveStratLazy, zcu: *Zcu, tid: strat.Tid()) switch (strat) { |
| 878 | pub fn ZcuPtr(strat: ResolveStratLazy) type { |
| 879 | return switch (strat) { |
| 880 | .eager => *const Zcu, |
| 881 | .sema, .lazy => *Zcu, |
| 882 | }; |
| 883 | } |
| 884 | |
| 885 | pub fn pt( |
| 886 | comptime strat: ResolveStratLazy, |
| 887 | zcu: strat.ZcuPtr(), |
| 888 | tid: strat.Tid(), |
| 889 | ) switch (strat) { |
| 879 | 890 | .lazy, .sema => Zcu.PerThread, |
| 880 | 891 | .eager => void, |
| 881 | 892 | } { |
| ... | ... | @@ -896,14 +907,21 @@ pub const ResolveStrat = enum { |
| 896 | 907 | /// This should typically be used from semantic analysis. |
| 897 | 908 | sema, |
| 898 | 909 | |
| 899 | | pub fn Tid(comptime strat: ResolveStrat) type { |
| 910 | pub fn Tid(strat: ResolveStrat) type { |
| 900 | 911 | return switch (strat) { |
| 901 | 912 | .sema => Zcu.PerThread.Id, |
| 902 | 913 | .normal => void, |
| 903 | 914 | }; |
| 904 | 915 | } |
| 905 | 916 | |
| 906 | | pub fn pt(comptime strat: ResolveStrat, zcu: *Zcu, tid: strat.Tid()) switch (strat) { |
| 917 | pub fn ZcuPtr(strat: ResolveStrat) type { |
| 918 | return switch (strat) { |
| 919 | .normal => *const Zcu, |
| 920 | .sema => *Zcu, |
| 921 | }; |
| 922 | } |
| 923 | |
| 924 | pub fn pt(comptime strat: ResolveStrat, zcu: strat.ZcuPtr(), tid: strat.Tid()) switch (strat) { |
| 907 | 925 | .sema => Zcu.PerThread, |
| 908 | 926 | .normal => void, |
| 909 | 927 | } { |
| ... | ... | @@ -922,7 +940,7 @@ pub const ResolveStrat = enum { |
| 922 | 940 | }; |
| 923 | 941 | |
| 924 | 942 | /// Never returns `none`. Asserts that all necessary type resolution is already done. |
| 925 | | pub fn abiAlignment(ty: Type, zcu: *Zcu) Alignment { |
| 943 | pub fn abiAlignment(ty: Type, zcu: *const Zcu) Alignment { |
| 926 | 944 | return (ty.abiAlignmentInner(.eager, zcu, {}) catch unreachable).scalar; |
| 927 | 945 | } |
| 928 | 946 | |
| ... | ... | @@ -939,7 +957,7 @@ pub fn abiAlignmentSema(ty: Type, pt: Zcu.PerThread) SemaError!Alignment { |
| 939 | 957 | pub fn abiAlignmentInner( |
| 940 | 958 | ty: Type, |
| 941 | 959 | comptime strat: ResolveStratLazy, |
| 942 | | zcu: *Zcu, |
| 960 | zcu: strat.ZcuPtr(), |
| 943 | 961 | tid: strat.Tid(), |
| 944 | 962 | ) SemaError!AbiAlignmentInner { |
| 945 | 963 | const pt = strat.pt(zcu, tid); |
| ... | ... | @@ -1156,7 +1174,7 @@ pub fn abiAlignmentInner( |
| 1156 | 1174 | fn abiAlignmentInnerErrorUnion( |
| 1157 | 1175 | ty: Type, |
| 1158 | 1176 | comptime strat: ResolveStratLazy, |
| 1159 | | zcu: *Zcu, |
| 1177 | zcu: strat.ZcuPtr(), |
| 1160 | 1178 | tid: strat.Tid(), |
| 1161 | 1179 | payload_ty: Type, |
| 1162 | 1180 | ) SemaError!AbiAlignmentInner { |
| ... | ... | @@ -1198,7 +1216,7 @@ fn abiAlignmentInnerErrorUnion( |
| 1198 | 1216 | fn abiAlignmentInnerOptional( |
| 1199 | 1217 | ty: Type, |
| 1200 | 1218 | comptime strat: ResolveStratLazy, |
| 1201 | | zcu: *Zcu, |
| 1219 | zcu: strat.ZcuPtr(), |
| 1202 | 1220 | tid: strat.Tid(), |
| 1203 | 1221 | ) SemaError!AbiAlignmentInner { |
| 1204 | 1222 | const pt = strat.pt(zcu, tid); |
| ... | ... | @@ -1244,7 +1262,7 @@ const AbiSizeInner = union(enum) { |
| 1244 | 1262 | |
| 1245 | 1263 | /// Asserts the type has the ABI size already resolved. |
| 1246 | 1264 | /// Types that return false for hasRuntimeBits() return 0. |
| 1247 | | pub fn abiSize(ty: Type, zcu: *Zcu) u64 { |
| 1265 | pub fn abiSize(ty: Type, zcu: *const Zcu) u64 { |
| 1248 | 1266 | return (abiSizeInner(ty, .eager, zcu, {}) catch unreachable).scalar; |
| 1249 | 1267 | } |
| 1250 | 1268 | |
| ... | ... | @@ -1269,7 +1287,7 @@ pub fn abiSizeSema(ty: Type, pt: Zcu.PerThread) SemaError!u64 { |
| 1269 | 1287 | pub fn abiSizeInner( |
| 1270 | 1288 | ty: Type, |
| 1271 | 1289 | comptime strat: ResolveStratLazy, |
| 1272 | | zcu: *Zcu, |
| 1290 | zcu: strat.ZcuPtr(), |
| 1273 | 1291 | tid: strat.Tid(), |
| 1274 | 1292 | ) SemaError!AbiSizeInner { |
| 1275 | 1293 | const target = zcu.getTarget(); |
| ... | ... | @@ -1542,7 +1560,7 @@ pub fn abiSizeInner( |
| 1542 | 1560 | fn abiSizeInnerOptional( |
| 1543 | 1561 | ty: Type, |
| 1544 | 1562 | comptime strat: ResolveStratLazy, |
| 1545 | | zcu: *Zcu, |
| 1563 | zcu: strat.ZcuPtr(), |
| 1546 | 1564 | tid: strat.Tid(), |
| 1547 | 1565 | ) SemaError!AbiSizeInner { |
| 1548 | 1566 | const child_ty = ty.optionalChild(zcu); |
| ... | ... | @@ -1701,7 +1719,7 @@ pub fn maxIntAlignment(target: std.Target, use_llvm: bool) u16 { |
| 1701 | 1719 | }; |
| 1702 | 1720 | } |
| 1703 | 1721 | |
| 1704 | | pub fn bitSize(ty: Type, zcu: *Zcu) u64 { |
| 1722 | pub fn bitSize(ty: Type, zcu: *const Zcu) u64 { |
| 1705 | 1723 | return bitSizeInner(ty, .normal, zcu, {}) catch unreachable; |
| 1706 | 1724 | } |
| 1707 | 1725 | |
| ... | ... | @@ -1712,7 +1730,7 @@ pub fn bitSizeSema(ty: Type, pt: Zcu.PerThread) SemaError!u64 { |
| 1712 | 1730 | pub fn bitSizeInner( |
| 1713 | 1731 | ty: Type, |
| 1714 | 1732 | comptime strat: ResolveStrat, |
| 1715 | | zcu: *Zcu, |
| 1733 | zcu: strat.ZcuPtr(), |
| 1716 | 1734 | tid: strat.Tid(), |
| 1717 | 1735 | ) SemaError!u64 { |
| 1718 | 1736 | const target = zcu.getTarget(); |
| ... | ... | @@ -2148,7 +2166,7 @@ pub fn unionBackingType(ty: Type, pt: Zcu.PerThread) !Type { |
| 2148 | 2166 | }; |
| 2149 | 2167 | } |
| 2150 | 2168 | |
| 2151 | | pub fn unionGetLayout(ty: Type, zcu: *Zcu) Zcu.UnionLayout { |
| 2169 | pub fn unionGetLayout(ty: Type, zcu: *const Zcu) Zcu.UnionLayout { |
| 2152 | 2170 | const union_obj = zcu.intern_pool.loadUnionType(ty.toIntern()); |
| 2153 | 2171 | return Type.getUnionLayout(union_obj, zcu); |
| 2154 | 2172 | } |
| ... | ... | @@ -2746,7 +2764,7 @@ pub fn onePossibleValue(starting_type: Type, pt: Zcu.PerThread) !?Value { |
| 2746 | 2764 | |
| 2747 | 2765 | /// During semantic analysis, instead call `ty.comptimeOnlySema` which |
| 2748 | 2766 | /// resolves field types rather than asserting they are already resolved. |
| 2749 | | pub fn comptimeOnly(ty: Type, zcu: *Zcu) bool { |
| 2767 | pub fn comptimeOnly(ty: Type, zcu: *const Zcu) bool { |
| 2750 | 2768 | return ty.comptimeOnlyInner(.normal, zcu, {}) catch unreachable; |
| 2751 | 2769 | } |
| 2752 | 2770 | |
| ... | ... | @@ -2759,7 +2777,7 @@ pub fn comptimeOnlySema(ty: Type, pt: Zcu.PerThread) SemaError!bool { |
| 2759 | 2777 | pub fn comptimeOnlyInner( |
| 2760 | 2778 | ty: Type, |
| 2761 | 2779 | comptime strat: ResolveStrat, |
| 2762 | | zcu: *Zcu, |
| 2780 | zcu: strat.ZcuPtr(), |
| 2763 | 2781 | tid: strat.Tid(), |
| 2764 | 2782 | ) SemaError!bool { |
| 2765 | 2783 | const ip = &zcu.intern_pool; |
| ... | ... | @@ -2834,40 +2852,44 @@ pub fn comptimeOnlyInner( |
| 2834 | 2852 | if (struct_type.layout == .@"packed") |
| 2835 | 2853 | return false; |
| 2836 | 2854 | |
| 2837 | | // A struct with no fields is not comptime-only. |
| 2838 | | return switch (struct_type.setRequiresComptimeWip(ip)) { |
| 2839 | | .no, .wip => false, |
| 2840 | | .yes => true, |
| 2841 | | .unknown => { |
| 2842 | | // Inlined `assert` so that the resolution calls below are not statically reachable. |
| 2843 | | if (strat != .sema) unreachable; |
| 2844 | | |
| 2845 | | if (struct_type.flagsUnordered(ip).field_types_wip) { |
| 2846 | | struct_type.setRequiresComptime(ip, .unknown); |
| 2847 | | return false; |
| 2848 | | } |
| 2855 | return switch (strat) { |
| 2856 | .normal => switch (struct_type.requiresComptime(ip)) { |
| 2857 | .wip => unreachable, |
| 2858 | .no => false, |
| 2859 | .yes => true, |
| 2860 | .unknown => unreachable, |
| 2861 | }, |
| 2862 | .sema => switch (struct_type.setRequiresComptimeWip(ip)) { |
| 2863 | .no, .wip => false, |
| 2864 | .yes => true, |
| 2865 | .unknown => { |
| 2866 | if (struct_type.flagsUnordered(ip).field_types_wip) { |
| 2867 | struct_type.setRequiresComptime(ip, .unknown); |
| 2868 | return false; |
| 2869 | } |
| 2849 | 2870 | |
| 2850 | | errdefer struct_type.setRequiresComptime(ip, .unknown); |
| 2871 | errdefer struct_type.setRequiresComptime(ip, .unknown); |
| 2851 | 2872 | |
| 2852 | | const pt = strat.pt(zcu, tid); |
| 2853 | | try ty.resolveFields(pt); |
| 2854 | | |
| 2855 | | for (0..struct_type.field_types.len) |i_usize| { |
| 2856 | | const i: u32 = @intCast(i_usize); |
| 2857 | | if (struct_type.fieldIsComptime(ip, i)) continue; |
| 2858 | | const field_ty = struct_type.field_types.get(ip)[i]; |
| 2859 | | if (try Type.fromInterned(field_ty).comptimeOnlyInner(strat, zcu, tid)) { |
| 2860 | | // Note that this does not cause the layout to |
| 2861 | | // be considered resolved. Comptime-only types |
| 2862 | | // still maintain a layout of their |
| 2863 | | // runtime-known fields. |
| 2864 | | struct_type.setRequiresComptime(ip, .yes); |
| 2865 | | return true; |
| 2873 | const pt = strat.pt(zcu, tid); |
| 2874 | try ty.resolveFields(pt); |
| 2875 | |
| 2876 | for (0..struct_type.field_types.len) |i_usize| { |
| 2877 | const i: u32 = @intCast(i_usize); |
| 2878 | if (struct_type.fieldIsComptime(ip, i)) continue; |
| 2879 | const field_ty = struct_type.field_types.get(ip)[i]; |
| 2880 | if (try Type.fromInterned(field_ty).comptimeOnlyInner(strat, zcu, tid)) { |
| 2881 | // Note that this does not cause the layout to |
| 2882 | // be considered resolved. Comptime-only types |
| 2883 | // still maintain a layout of their |
| 2884 | // runtime-known fields. |
| 2885 | struct_type.setRequiresComptime(ip, .yes); |
| 2886 | return true; |
| 2887 | } |
| 2866 | 2888 | } |
| 2867 | | } |
| 2868 | 2889 | |
| 2869 | | struct_type.setRequiresComptime(ip, .no); |
| 2870 | | return false; |
| 2890 | struct_type.setRequiresComptime(ip, .no); |
| 2891 | return false; |
| 2892 | }, |
| 2871 | 2893 | }, |
| 2872 | 2894 | }; |
| 2873 | 2895 | }, |
| ... | ... | @@ -2882,35 +2904,40 @@ pub fn comptimeOnlyInner( |
| 2882 | 2904 | |
| 2883 | 2905 | .union_type => { |
| 2884 | 2906 | const union_type = ip.loadUnionType(ty.toIntern()); |
| 2885 | | switch (union_type.setRequiresComptimeWip(ip)) { |
| 2886 | | .no, .wip => return false, |
| 2887 | | .yes => return true, |
| 2888 | | .unknown => { |
| 2889 | | // Inlined `assert` so that the resolution calls below are not statically reachable. |
| 2890 | | if (strat != .sema) unreachable; |
| 2891 | | |
| 2892 | | if (union_type.flagsUnordered(ip).status == .field_types_wip) { |
| 2893 | | union_type.setRequiresComptime(ip, .unknown); |
| 2894 | | return false; |
| 2895 | | } |
| 2907 | return switch (strat) { |
| 2908 | .normal => switch (union_type.requiresComptime(ip)) { |
| 2909 | .wip => unreachable, |
| 2910 | .no => false, |
| 2911 | .yes => true, |
| 2912 | .unknown => unreachable, |
| 2913 | }, |
| 2914 | .sema => switch (union_type.setRequiresComptimeWip(ip)) { |
| 2915 | .no, .wip => return false, |
| 2916 | .yes => return true, |
| 2917 | .unknown => { |
| 2918 | if (union_type.flagsUnordered(ip).status == .field_types_wip) { |
| 2919 | union_type.setRequiresComptime(ip, .unknown); |
| 2920 | return false; |
| 2921 | } |
| 2896 | 2922 | |
| 2897 | | errdefer union_type.setRequiresComptime(ip, .unknown); |
| 2923 | errdefer union_type.setRequiresComptime(ip, .unknown); |
| 2898 | 2924 | |
| 2899 | | const pt = strat.pt(zcu, tid); |
| 2900 | | try ty.resolveFields(pt); |
| 2925 | const pt = strat.pt(zcu, tid); |
| 2926 | try ty.resolveFields(pt); |
| 2901 | 2927 | |
| 2902 | | for (0..union_type.field_types.len) |field_idx| { |
| 2903 | | const field_ty = union_type.field_types.get(ip)[field_idx]; |
| 2904 | | if (try Type.fromInterned(field_ty).comptimeOnlyInner(strat, zcu, tid)) { |
| 2905 | | union_type.setRequiresComptime(ip, .yes); |
| 2906 | | return true; |
| 2928 | for (0..union_type.field_types.len) |field_idx| { |
| 2929 | const field_ty = union_type.field_types.get(ip)[field_idx]; |
| 2930 | if (try Type.fromInterned(field_ty).comptimeOnlyInner(strat, zcu, tid)) { |
| 2931 | union_type.setRequiresComptime(ip, .yes); |
| 2932 | return true; |
| 2933 | } |
| 2907 | 2934 | } |
| 2908 | | } |
| 2909 | 2935 | |
| 2910 | | union_type.setRequiresComptime(ip, .no); |
| 2911 | | return false; |
| 2936 | union_type.setRequiresComptime(ip, .no); |
| 2937 | return false; |
| 2938 | }, |
| 2912 | 2939 | }, |
| 2913 | | } |
| 2940 | }; |
| 2914 | 2941 | }, |
| 2915 | 2942 | |
| 2916 | 2943 | .opaque_type => false, |
| ... | ... | @@ -3207,7 +3234,7 @@ pub fn fieldAlignmentInner( |
| 3207 | 3234 | ty: Type, |
| 3208 | 3235 | index: usize, |
| 3209 | 3236 | comptime strat: ResolveStrat, |
| 3210 | | zcu: *Zcu, |
| 3237 | zcu: strat.ZcuPtr(), |
| 3211 | 3238 | tid: strat.Tid(), |
| 3212 | 3239 | ) SemaError!Alignment { |
| 3213 | 3240 | const ip = &zcu.intern_pool; |
| ... | ... | @@ -3281,7 +3308,7 @@ pub fn structFieldAlignmentInner( |
| 3281 | 3308 | explicit_alignment: Alignment, |
| 3282 | 3309 | layout: std.builtin.Type.ContainerLayout, |
| 3283 | 3310 | comptime strat: Type.ResolveStrat, |
| 3284 | | zcu: *Zcu, |
| 3311 | zcu: strat.ZcuPtr(), |
| 3285 | 3312 | tid: strat.Tid(), |
| 3286 | 3313 | ) SemaError!Alignment { |
| 3287 | 3314 | assert(layout != .@"packed"); |
| ... | ... | @@ -3323,7 +3350,7 @@ pub fn unionFieldAlignmentInner( |
| 3323 | 3350 | explicit_alignment: Alignment, |
| 3324 | 3351 | layout: std.builtin.Type.ContainerLayout, |
| 3325 | 3352 | comptime strat: Type.ResolveStrat, |
| 3326 | | zcu: *Zcu, |
| 3353 | zcu: strat.ZcuPtr(), |
| 3327 | 3354 | tid: strat.Tid(), |
| 3328 | 3355 | ) SemaError!Alignment { |
| 3329 | 3356 | assert(layout != .@"packed"); |
| ... | ... | @@ -3392,11 +3419,7 @@ pub const FieldOffset = struct { |
| 3392 | 3419 | }; |
| 3393 | 3420 | |
| 3394 | 3421 | /// Supports structs and unions. |
| 3395 | | pub fn structFieldOffset( |
| 3396 | | ty: Type, |
| 3397 | | index: usize, |
| 3398 | | zcu: *Zcu, |
| 3399 | | ) u64 { |
| 3422 | pub fn structFieldOffset(ty: Type, index: usize, zcu: *const Zcu) u64 { |
| 3400 | 3423 | const ip = &zcu.intern_pool; |
| 3401 | 3424 | switch (ip.indexToKey(ty.toIntern())) { |
| 3402 | 3425 | .struct_type => { |
| ... | ... | @@ -3944,7 +3967,7 @@ fn resolveUnionInner( |
| 3944 | 3967 | }; |
| 3945 | 3968 | } |
| 3946 | 3969 | |
| 3947 | | pub fn getUnionLayout(loaded_union: InternPool.LoadedUnionType, zcu: *Zcu) Zcu.UnionLayout { |
| 3970 | pub fn getUnionLayout(loaded_union: InternPool.LoadedUnionType, zcu: *const Zcu) Zcu.UnionLayout { |
| 3948 | 3971 | const ip = &zcu.intern_pool; |
| 3949 | 3972 | assert(loaded_union.haveLayout(ip)); |
| 3950 | 3973 | var most_aligned_field: u32 = undefined; |