| ... | @@ -34199,6 +34199,9 @@ pub fn resolveStructAlignment( | ... | @@ -34199,6 +34199,9 @@ pub fn resolveStructAlignment( |
| 34199 | if (struct_type.assumePointerAlignedIfWip(ip, ptr_align)) return; | 34199 | if (struct_type.assumePointerAlignedIfWip(ip, ptr_align)) return; |
| 34200 | defer struct_type.clearAlignmentWip(ip); | 34200 | defer struct_type.clearAlignmentWip(ip); |
| 34201 | | 34201 | |
| | 34202 | // No `zcu.trackUnitSema` calls, since this phase isn't really doing any semantic analysis. |
| | 34203 | // It's just triggering *other* analysis, alongside a simple loop over already-resolved info. |
| | 34204 | |
| 34202 | var alignment: Alignment = .@"1"; | 34205 | var alignment: Alignment = .@"1"; |
| 34203 | | 34206 | |
| 34204 | for (0..struct_type.field_types.len) |i| { | 34207 | for (0..struct_type.field_types.len) |i| { |
| ... | @@ -34229,6 +34232,9 @@ pub fn resolveStructLayout(sema: *Sema, ty: Type) SemaError!void { | ... | @@ -34229,6 +34232,9 @@ pub fn resolveStructLayout(sema: *Sema, ty: Type) SemaError!void { |
| 34229 | | 34232 | |
| 34230 | try sema.resolveStructFieldTypes(ty.toIntern(), struct_type); | 34233 | try sema.resolveStructFieldTypes(ty.toIntern(), struct_type); |
| 34231 | | 34234 | |
| | 34235 | // No `zcu.trackUnitSema` calls, since this phase isn't really doing any semantic analysis. |
| | 34236 | // It's just triggering *other* analysis, alongside a simple loop over already-resolved info. |
| | 34237 | |
| 34232 | if (struct_type.layout == .@"packed") { | 34238 | if (struct_type.layout == .@"packed") { |
| 34233 | sema.backingIntType(struct_type) catch |err| switch (err) { | 34239 | sema.backingIntType(struct_type) catch |err| switch (err) { |
| 34234 | error.OutOfMemory, error.AnalysisFail => |e| return e, | 34240 | error.OutOfMemory, error.AnalysisFail => |e| return e, |
| ... | @@ -34532,6 +34538,9 @@ pub fn resolveUnionAlignment( | ... | @@ -34532,6 +34538,9 @@ pub fn resolveUnionAlignment( |
| 34532 | | 34538 | |
| 34533 | try sema.resolveUnionFieldTypes(ty, union_type); | 34539 | try sema.resolveUnionFieldTypes(ty, union_type); |
| 34534 | | 34540 | |
| | 34541 | // No `zcu.trackUnitSema` calls, since this phase isn't really doing any semantic analysis. |
| | 34542 | // It's just triggering *other* analysis, alongside a simple loop over already-resolved info. |
| | 34543 | |
| 34535 | var max_align: Alignment = .@"1"; | 34544 | var max_align: Alignment = .@"1"; |
| 34536 | for (0..union_type.field_types.len) |field_index| { | 34545 | for (0..union_type.field_types.len) |field_index| { |
| 34537 | const field_ty: Type = .fromInterned(union_type.field_types.get(ip)[field_index]); | 34546 | const field_ty: Type = .fromInterned(union_type.field_types.get(ip)[field_index]); |
| ... | @@ -34579,6 +34588,9 @@ pub fn resolveUnionLayout(sema: *Sema, ty: Type) SemaError!void { | ... | @@ -34579,6 +34588,9 @@ pub fn resolveUnionLayout(sema: *Sema, ty: Type) SemaError!void { |
| 34579 | | 34588 | |
| 34580 | union_type.setStatus(ip, .layout_wip); | 34589 | union_type.setStatus(ip, .layout_wip); |
| 34581 | | 34590 | |
| | 34591 | // No `zcu.trackUnitSema` calls, since this phase isn't really doing any semantic analysis. |
| | 34592 | // It's just triggering *other* analysis, alongside a simple loop over already-resolved info. |
| | 34593 | |
| 34582 | var max_size: u64 = 0; | 34594 | var max_size: u64 = 0; |
| 34583 | var max_align: Alignment = .@"1"; | 34595 | var max_align: Alignment = .@"1"; |
| 34584 | for (0..union_type.field_types.len) |field_index| { | 34596 | for (0..union_type.field_types.len) |field_index| { |
| ... | @@ -34695,6 +34707,9 @@ pub fn resolveStructFully(sema: *Sema, ty: Type) SemaError!void { | ... | @@ -34695,6 +34707,9 @@ pub fn resolveStructFully(sema: *Sema, ty: Type) SemaError!void { |
| 34695 | if (struct_type.setFullyResolved(ip)) return; | 34707 | if (struct_type.setFullyResolved(ip)) return; |
| 34696 | errdefer struct_type.clearFullyResolved(ip); | 34708 | errdefer struct_type.clearFullyResolved(ip); |
| 34697 | | 34709 | |
| | 34710 | // No `zcu.trackUnitSema` calls, since this phase isn't really doing any semantic analysis. |
| | 34711 | // It's just triggering *other* analysis, alongside a simple loop over already-resolved info. |
| | 34712 | |
| 34698 | // After we have resolve struct layout we have to go over the fields again to | 34713 | // After we have resolve struct layout we have to go over the fields again to |
| 34699 | // make sure pointer fields get their child types resolved as well. | 34714 | // make sure pointer fields get their child types resolved as well. |
| 34700 | // See also similar code for unions. | 34715 | // See also similar code for unions. |
| ... | @@ -34720,6 +34735,9 @@ pub fn resolveUnionFully(sema: *Sema, ty: Type) SemaError!void { | ... | @@ -34720,6 +34735,9 @@ pub fn resolveUnionFully(sema: *Sema, ty: Type) SemaError!void { |
| 34720 | .fully_resolved_wip, .fully_resolved => return, | 34735 | .fully_resolved_wip, .fully_resolved => return, |
| 34721 | } | 34736 | } |
| 34722 | | 34737 | |
| | 34738 | // No `zcu.trackUnitSema` calls, since this phase isn't really doing any semantic analysis. |
| | 34739 | // It's just triggering *other* analysis, alongside a simple loop over already-resolved info. |
| | 34740 | |
| 34723 | { | 34741 | { |
| 34724 | // After we have resolve union layout we have to go over the fields again to | 34742 | // After we have resolve union layout we have to go over the fields again to |
| 34725 | // make sure pointer fields get their child types resolved as well. | 34743 | // make sure pointer fields get their child types resolved as well. |
| ... | @@ -34762,6 +34780,10 @@ pub fn resolveStructFieldTypes( | ... | @@ -34762,6 +34780,10 @@ pub fn resolveStructFieldTypes( |
| 34762 | } | 34780 | } |
| 34763 | defer struct_type.clearFieldTypesWip(ip); | 34781 | defer struct_type.clearFieldTypesWip(ip); |
| 34764 | | 34782 | |
| | 34783 | // can't happen earlier than this because we only want the progress node if not already resolved |
| | 34784 | const tracked_unit = zcu.trackUnitSema(struct_type.name.toSlice(ip), null); |
| | 34785 | defer tracked_unit.end(zcu); |
| | 34786 | |
| 34765 | sema.structFields(struct_type) catch |err| switch (err) { | 34787 | sema.structFields(struct_type) catch |err| switch (err) { |
| 34766 | error.AnalysisFail, error.OutOfMemory => |e| return e, | 34788 | error.AnalysisFail, error.OutOfMemory => |e| return e, |
| 34767 | error.ComptimeBreak, error.ComptimeReturn => unreachable, | 34789 | error.ComptimeBreak, error.ComptimeReturn => unreachable, |
| ... | @@ -34791,6 +34813,10 @@ pub fn resolveStructFieldInits(sema: *Sema, ty: Type) SemaError!void { | ... | @@ -34791,6 +34813,10 @@ pub fn resolveStructFieldInits(sema: *Sema, ty: Type) SemaError!void { |
| 34791 | } | 34813 | } |
| 34792 | defer struct_type.clearInitsWip(ip); | 34814 | defer struct_type.clearInitsWip(ip); |
| 34793 | | 34815 | |
| | 34816 | // can't happen earlier than this because we only want the progress node if not already resolved |
| | 34817 | const tracked_unit = zcu.trackUnitSema(struct_type.name.toSlice(ip), null); |
| | 34818 | defer tracked_unit.end(zcu); |
| | 34819 | |
| 34794 | sema.structFieldInits(struct_type) catch |err| switch (err) { | 34820 | sema.structFieldInits(struct_type) catch |err| switch (err) { |
| 34795 | error.AnalysisFail, error.OutOfMemory => |e| return e, | 34821 | error.AnalysisFail, error.OutOfMemory => |e| return e, |
| 34796 | error.ComptimeBreak, error.ComptimeReturn => unreachable, | 34822 | error.ComptimeBreak, error.ComptimeReturn => unreachable, |
| ... | @@ -34819,6 +34845,10 @@ pub fn resolveUnionFieldTypes(sema: *Sema, ty: Type, union_type: InternPool.Load | ... | @@ -34819,6 +34845,10 @@ pub fn resolveUnionFieldTypes(sema: *Sema, ty: Type, union_type: InternPool.Load |
| 34819 | => return, | 34845 | => return, |
| 34820 | } | 34846 | } |
| 34821 | | 34847 | |
| | 34848 | // can't happen earlier than this because we only want the progress node if not already resolved |
| | 34849 | const tracked_unit = zcu.trackUnitSema(union_type.name.toSlice(ip), null); |
| | 34850 | defer tracked_unit.end(zcu); |
| | 34851 | |
| 34822 | union_type.setStatus(ip, .field_types_wip); | 34852 | union_type.setStatus(ip, .field_types_wip); |
| 34823 | errdefer union_type.setStatus(ip, .none); | 34853 | errdefer union_type.setStatus(ip, .none); |
| 34824 | sema.unionFields(ty.toIntern(), union_type) catch |err| switch (err) { | 34854 | sema.unionFields(ty.toIntern(), union_type) catch |err| switch (err) { |