| ... | @@ -1431,16 +1431,12 @@ pub const OptionalMapIndex = enum(u32) { | ... | @@ -1431,16 +1431,12 @@ pub const OptionalMapIndex = enum(u32) { |
| 1431 | pub const MapIndex = enum(u32) { | 1431 | pub const MapIndex = enum(u32) { |
| 1432 | _, | 1432 | _, |
| 1433 | | 1433 | |
| 1434 | pub fn get(map_index: MapIndex, ip: *InternPool) *FieldMap { | 1434 | pub fn get(map_index: MapIndex, ip: *const InternPool) *FieldMap { |
| 1435 | const unwrapped_map_index = map_index.unwrap(ip); | 1435 | const unwrapped_map_index = map_index.unwrap(ip); |
| 1436 | const maps = ip.getLocalShared(unwrapped_map_index.tid).maps.acquire(); | 1436 | const maps = ip.getLocalShared(unwrapped_map_index.tid).maps.acquire(); |
| 1437 | return &maps.view().items(.@"0")[unwrapped_map_index.index]; | 1437 | return &maps.view().items(.@"0")[unwrapped_map_index.index]; |
| 1438 | } | 1438 | } |
| 1439 | | 1439 | |
| 1440 | pub fn getConst(map_index: MapIndex, ip: *const InternPool) FieldMap { | | |
| 1441 | return map_index.get(@constCast(ip)).*; | | |
| 1442 | } | | |
| 1443 | | | |
| 1444 | pub fn toOptional(i: MapIndex) OptionalMapIndex { | 1440 | pub fn toOptional(i: MapIndex) OptionalMapIndex { |
| 1445 | return @enumFromInt(@intFromEnum(i)); | 1441 | return @enumFromInt(@intFromEnum(i)); |
| 1446 | } | 1442 | } |
| ... | @@ -1853,7 +1849,7 @@ pub const Key = union(enum) { | ... | @@ -1853,7 +1849,7 @@ pub const Key = union(enum) { |
| 1853 | | 1849 | |
| 1854 | /// Look up field index based on field name. | 1850 | /// Look up field index based on field name. |
| 1855 | pub fn nameIndex(self: ErrorSetType, ip: *const InternPool, name: NullTerminatedString) ?u32 { | 1851 | pub fn nameIndex(self: ErrorSetType, ip: *const InternPool, name: NullTerminatedString) ?u32 { |
| 1856 | const map = self.names_map.unwrap().?.getConst(ip); | 1852 | const map = self.names_map.unwrap().?.get(ip); |
| 1857 | const adapter: NullTerminatedString.Adapter = .{ .strings = self.names.get(ip) }; | 1853 | const adapter: NullTerminatedString.Adapter = .{ .strings = self.names.get(ip) }; |
| 1858 | const field_index = map.getIndexAdapted(name, adapter) orelse return null; | 1854 | const field_index = map.getIndexAdapted(name, adapter) orelse return null; |
| 1859 | return @intCast(field_index); | 1855 | return @intCast(field_index); |
| ... | @@ -2101,13 +2097,13 @@ pub const Key = union(enum) { | ... | @@ -2101,13 +2097,13 @@ pub const Key = union(enum) { |
| 2101 | comptime_args: Index.Slice, | 2097 | comptime_args: Index.Slice, |
| 2102 | | 2098 | |
| 2103 | /// Returns a pointer that becomes invalid after any additions to the `InternPool`. | 2099 | /// Returns a pointer that becomes invalid after any additions to the `InternPool`. |
| 2104 | fn analysisPtr(func: Func, ip: *InternPool) *FuncAnalysis { | 2100 | fn analysisPtr(func: Func, ip: *const InternPool) *FuncAnalysis { |
| 2105 | const extra = ip.getLocalShared(func.tid).extra.acquire(); | 2101 | const extra = ip.getLocalShared(func.tid).extra.acquire(); |
| 2106 | return @ptrCast(&extra.view().items(.@"0")[func.analysis_extra_index]); | 2102 | return @ptrCast(&extra.view().items(.@"0")[func.analysis_extra_index]); |
| 2107 | } | 2103 | } |
| 2108 | | 2104 | |
| 2109 | pub fn analysisUnordered(func: Func, ip: *const InternPool) FuncAnalysis { | 2105 | pub fn analysisUnordered(func: Func, ip: *const InternPool) FuncAnalysis { |
| 2110 | return @atomicLoad(FuncAnalysis, func.analysisPtr(@constCast(ip)), .unordered); | 2106 | return @atomicLoad(FuncAnalysis, func.analysisPtr(ip), .unordered); |
| 2111 | } | 2107 | } |
| 2112 | | 2108 | |
| 2113 | pub fn setAnalysisState(func: Func, ip: *InternPool, state: FuncAnalysis.State) void { | 2109 | pub fn setAnalysisState(func: Func, ip: *InternPool, state: FuncAnalysis.State) void { |
| ... | @@ -2144,23 +2140,23 @@ pub const Key = union(enum) { | ... | @@ -2144,23 +2140,23 @@ pub const Key = union(enum) { |
| 2144 | } | 2140 | } |
| 2145 | | 2141 | |
| 2146 | /// Returns a pointer that becomes invalid after any additions to the `InternPool`. | 2142 | /// Returns a pointer that becomes invalid after any additions to the `InternPool`. |
| 2147 | fn zirBodyInstPtr(func: Func, ip: *InternPool) *TrackedInst.Index { | 2143 | fn zirBodyInstPtr(func: Func, ip: *const InternPool) *TrackedInst.Index { |
| 2148 | const extra = ip.getLocalShared(func.tid).extra.acquire(); | 2144 | const extra = ip.getLocalShared(func.tid).extra.acquire(); |
| 2149 | return @ptrCast(&extra.view().items(.@"0")[func.zir_body_inst_extra_index]); | 2145 | return @ptrCast(&extra.view().items(.@"0")[func.zir_body_inst_extra_index]); |
| 2150 | } | 2146 | } |
| 2151 | | 2147 | |
| 2152 | pub fn zirBodyInstUnordered(func: Func, ip: *const InternPool) TrackedInst.Index { | 2148 | pub fn zirBodyInstUnordered(func: Func, ip: *const InternPool) TrackedInst.Index { |
| 2153 | return @atomicLoad(TrackedInst.Index, func.zirBodyInstPtr(@constCast(ip)), .unordered); | 2149 | return @atomicLoad(TrackedInst.Index, func.zirBodyInstPtr(ip), .unordered); |
| 2154 | } | 2150 | } |
| 2155 | | 2151 | |
| 2156 | /// Returns a pointer that becomes invalid after any additions to the `InternPool`. | 2152 | /// Returns a pointer that becomes invalid after any additions to the `InternPool`. |
| 2157 | fn branchQuotaPtr(func: Func, ip: *InternPool) *u32 { | 2153 | fn branchQuotaPtr(func: Func, ip: *const InternPool) *u32 { |
| 2158 | const extra = ip.getLocalShared(func.tid).extra.acquire(); | 2154 | const extra = ip.getLocalShared(func.tid).extra.acquire(); |
| 2159 | return &extra.view().items(.@"0")[func.branch_quota_extra_index]; | 2155 | return &extra.view().items(.@"0")[func.branch_quota_extra_index]; |
| 2160 | } | 2156 | } |
| 2161 | | 2157 | |
| 2162 | pub fn branchQuotaUnordered(func: Func, ip: *const InternPool) u32 { | 2158 | pub fn branchQuotaUnordered(func: Func, ip: *const InternPool) u32 { |
| 2163 | return @atomicLoad(u32, func.branchQuotaPtr(@constCast(ip)), .unordered); | 2159 | return @atomicLoad(u32, func.branchQuotaPtr(ip), .unordered); |
| 2164 | } | 2160 | } |
| 2165 | | 2161 | |
| 2166 | pub fn maxBranchQuota(func: Func, ip: *InternPool, new_branch_quota: u32) void { | 2162 | pub fn maxBranchQuota(func: Func, ip: *InternPool, new_branch_quota: u32) void { |
| ... | @@ -2173,14 +2169,14 @@ pub const Key = union(enum) { | ... | @@ -2173,14 +2169,14 @@ pub const Key = union(enum) { |
| 2173 | } | 2169 | } |
| 2174 | | 2170 | |
| 2175 | /// Returns a pointer that becomes invalid after any additions to the `InternPool`. | 2171 | /// Returns a pointer that becomes invalid after any additions to the `InternPool`. |
| 2176 | fn resolvedErrorSetPtr(func: Func, ip: *InternPool) *Index { | 2172 | fn resolvedErrorSetPtr(func: Func, ip: *const InternPool) *Index { |
| 2177 | const extra = ip.getLocalShared(func.tid).extra.acquire(); | 2173 | const extra = ip.getLocalShared(func.tid).extra.acquire(); |
| 2178 | assert(func.analysisUnordered(ip).inferred_error_set); | 2174 | assert(func.analysisUnordered(ip).inferred_error_set); |
| 2179 | return @ptrCast(&extra.view().items(.@"0")[func.resolved_error_set_extra_index]); | 2175 | return @ptrCast(&extra.view().items(.@"0")[func.resolved_error_set_extra_index]); |
| 2180 | } | 2176 | } |
| 2181 | | 2177 | |
| 2182 | pub fn resolvedErrorSetUnordered(func: Func, ip: *const InternPool) Index { | 2178 | pub fn resolvedErrorSetUnordered(func: Func, ip: *const InternPool) Index { |
| 2183 | return @atomicLoad(Index, func.resolvedErrorSetPtr(@constCast(ip)), .unordered); | 2179 | return @atomicLoad(Index, func.resolvedErrorSetPtr(ip), .unordered); |
| 2184 | } | 2180 | } |
| 2185 | | 2181 | |
| 2186 | pub fn setResolvedErrorSet(func: Func, ip: *InternPool, ies: Index) void { | 2182 | pub fn setResolvedErrorSet(func: Func, ip: *InternPool, ies: Index) void { |
| ... | @@ -3135,14 +3131,14 @@ pub const LoadedUnionType = struct { | ... | @@ -3135,14 +3131,14 @@ pub const LoadedUnionType = struct { |
| 3135 | /// This accessor is provided so that the tag type can be mutated, and so that | 3131 | /// This accessor is provided so that the tag type can be mutated, and so that |
| 3136 | /// when it is mutated, the mutations are observed. | 3132 | /// when it is mutated, the mutations are observed. |
| 3137 | /// The returned pointer expires with any addition to the `InternPool`. | 3133 | /// The returned pointer expires with any addition to the `InternPool`. |
| 3138 | fn tagTypePtr(self: LoadedUnionType, ip: *InternPool) *Index { | 3134 | fn tagTypePtr(self: LoadedUnionType, ip: *const InternPool) *Index { |
| 3139 | const extra = ip.getLocalShared(self.tid).extra.acquire(); | 3135 | const extra = ip.getLocalShared(self.tid).extra.acquire(); |
| 3140 | const field_index = std.meta.fieldIndex(Tag.TypeUnion, "tag_ty").?; | 3136 | const field_index = std.meta.fieldIndex(Tag.TypeUnion, "tag_ty").?; |
| 3141 | return @ptrCast(&extra.view().items(.@"0")[self.extra_index + field_index]); | 3137 | return @ptrCast(&extra.view().items(.@"0")[self.extra_index + field_index]); |
| 3142 | } | 3138 | } |
| 3143 | | 3139 | |
| 3144 | pub fn tagTypeUnordered(u: LoadedUnionType, ip: *const InternPool) Index { | 3140 | pub fn tagTypeUnordered(u: LoadedUnionType, ip: *const InternPool) Index { |
| 3145 | return @atomicLoad(Index, u.tagTypePtr(@constCast(ip)), .unordered); | 3141 | return @atomicLoad(Index, u.tagTypePtr(ip), .unordered); |
| 3146 | } | 3142 | } |
| 3147 | | 3143 | |
| 3148 | pub fn setTagType(u: LoadedUnionType, ip: *InternPool, tag_type: Index) void { | 3144 | pub fn setTagType(u: LoadedUnionType, ip: *InternPool, tag_type: Index) void { |
| ... | @@ -3154,14 +3150,14 @@ pub const LoadedUnionType = struct { | ... | @@ -3154,14 +3150,14 @@ pub const LoadedUnionType = struct { |
| 3154 | } | 3150 | } |
| 3155 | | 3151 | |
| 3156 | /// The returned pointer expires with any addition to the `InternPool`. | 3152 | /// The returned pointer expires with any addition to the `InternPool`. |
| 3157 | fn flagsPtr(self: LoadedUnionType, ip: *InternPool) *Tag.TypeUnion.Flags { | 3153 | fn flagsPtr(self: LoadedUnionType, ip: *const InternPool) *Tag.TypeUnion.Flags { |
| 3158 | const extra = ip.getLocalShared(self.tid).extra.acquire(); | 3154 | const extra = ip.getLocalShared(self.tid).extra.acquire(); |
| 3159 | const field_index = std.meta.fieldIndex(Tag.TypeUnion, "flags").?; | 3155 | const field_index = std.meta.fieldIndex(Tag.TypeUnion, "flags").?; |
| 3160 | return @ptrCast(&extra.view().items(.@"0")[self.extra_index + field_index]); | 3156 | return @ptrCast(&extra.view().items(.@"0")[self.extra_index + field_index]); |
| 3161 | } | 3157 | } |
| 3162 | | 3158 | |
| 3163 | pub fn flagsUnordered(u: LoadedUnionType, ip: *const InternPool) Tag.TypeUnion.Flags { | 3159 | pub fn flagsUnordered(u: LoadedUnionType, ip: *const InternPool) Tag.TypeUnion.Flags { |
| 3164 | return @atomicLoad(Tag.TypeUnion.Flags, u.flagsPtr(@constCast(ip)), .unordered); | 3160 | return @atomicLoad(Tag.TypeUnion.Flags, u.flagsPtr(ip), .unordered); |
| 3165 | } | 3161 | } |
| 3166 | | 3162 | |
| 3167 | pub fn setStatus(u: LoadedUnionType, ip: *InternPool, status: Status) void { | 3163 | pub fn setStatus(u: LoadedUnionType, ip: *InternPool, status: Status) void { |
| ... | @@ -3254,25 +3250,25 @@ pub const LoadedUnionType = struct { | ... | @@ -3254,25 +3250,25 @@ pub const LoadedUnionType = struct { |
| 3254 | } | 3250 | } |
| 3255 | | 3251 | |
| 3256 | /// The returned pointer expires with any addition to the `InternPool`. | 3252 | /// The returned pointer expires with any addition to the `InternPool`. |
| 3257 | fn sizePtr(self: LoadedUnionType, ip: *InternPool) *u32 { | 3253 | fn sizePtr(self: LoadedUnionType, ip: *const InternPool) *u32 { |
| 3258 | const extra = ip.getLocalShared(self.tid).extra.acquire(); | 3254 | const extra = ip.getLocalShared(self.tid).extra.acquire(); |
| 3259 | const field_index = std.meta.fieldIndex(Tag.TypeUnion, "size").?; | 3255 | const field_index = std.meta.fieldIndex(Tag.TypeUnion, "size").?; |
| 3260 | return &extra.view().items(.@"0")[self.extra_index + field_index]; | 3256 | return &extra.view().items(.@"0")[self.extra_index + field_index]; |
| 3261 | } | 3257 | } |
| 3262 | | 3258 | |
| 3263 | pub fn sizeUnordered(u: LoadedUnionType, ip: *const InternPool) u32 { | 3259 | pub fn sizeUnordered(u: LoadedUnionType, ip: *const InternPool) u32 { |
| 3264 | return @atomicLoad(u32, u.sizePtr(@constCast(ip)), .unordered); | 3260 | return @atomicLoad(u32, u.sizePtr(ip), .unordered); |
| 3265 | } | 3261 | } |
| 3266 | | 3262 | |
| 3267 | /// The returned pointer expires with any addition to the `InternPool`. | 3263 | /// The returned pointer expires with any addition to the `InternPool`. |
| 3268 | fn paddingPtr(self: LoadedUnionType, ip: *InternPool) *u32 { | 3264 | fn paddingPtr(self: LoadedUnionType, ip: *const InternPool) *u32 { |
| 3269 | const extra = ip.getLocalShared(self.tid).extra.acquire(); | 3265 | const extra = ip.getLocalShared(self.tid).extra.acquire(); |
| 3270 | const field_index = std.meta.fieldIndex(Tag.TypeUnion, "padding").?; | 3266 | const field_index = std.meta.fieldIndex(Tag.TypeUnion, "padding").?; |
| 3271 | return &extra.view().items(.@"0")[self.extra_index + field_index]; | 3267 | return &extra.view().items(.@"0")[self.extra_index + field_index]; |
| 3272 | } | 3268 | } |
| 3273 | | 3269 | |
| 3274 | pub fn paddingUnordered(u: LoadedUnionType, ip: *const InternPool) u32 { | 3270 | pub fn paddingUnordered(u: LoadedUnionType, ip: *const InternPool) u32 { |
| 3275 | return @atomicLoad(u32, u.paddingPtr(@constCast(ip)), .unordered); | 3271 | return @atomicLoad(u32, u.paddingPtr(ip), .unordered); |
| 3276 | } | 3272 | } |
| 3277 | | 3273 | |
| 3278 | pub fn hasTag(self: LoadedUnionType, ip: *const InternPool) bool { | 3274 | pub fn hasTag(self: LoadedUnionType, ip: *const InternPool) bool { |
| ... | @@ -3480,7 +3476,7 @@ pub const LoadedStructType = struct { | ... | @@ -3480,7 +3476,7 @@ pub const LoadedStructType = struct { |
| 3480 | if (i >= s.field_types.len) return null; | 3476 | if (i >= s.field_types.len) return null; |
| 3481 | return i; | 3477 | return i; |
| 3482 | }; | 3478 | }; |
| 3483 | const map = names_map.getConst(ip); | 3479 | const map = names_map.get(ip); |
| 3484 | const adapter: NullTerminatedString.Adapter = .{ .strings = s.field_names.get(ip) }; | 3480 | const adapter: NullTerminatedString.Adapter = .{ .strings = s.field_names.get(ip) }; |
| 3485 | const field_index = map.getIndexAdapted(name, adapter) orelse return null; | 3481 | const field_index = map.getIndexAdapted(name, adapter) orelse return null; |
| 3486 | return @intCast(field_index); | 3482 | return @intCast(field_index); |
| ... | @@ -3523,7 +3519,7 @@ pub const LoadedStructType = struct { | ... | @@ -3523,7 +3519,7 @@ pub const LoadedStructType = struct { |
| 3523 | | 3519 | |
| 3524 | /// The returned pointer expires with any addition to the `InternPool`. | 3520 | /// The returned pointer expires with any addition to the `InternPool`. |
| 3525 | /// Asserts the struct is not packed. | 3521 | /// Asserts the struct is not packed. |
| 3526 | fn flagsPtr(s: LoadedStructType, ip: *InternPool) *Tag.TypeStruct.Flags { | 3522 | fn flagsPtr(s: LoadedStructType, ip: *const InternPool) *Tag.TypeStruct.Flags { |
| 3527 | assert(s.layout != .@"packed"); | 3523 | assert(s.layout != .@"packed"); |
| 3528 | const extra = ip.getLocalShared(s.tid).extra.acquire(); | 3524 | const extra = ip.getLocalShared(s.tid).extra.acquire(); |
| 3529 | const flags_field_index = std.meta.fieldIndex(Tag.TypeStruct, "flags").?; | 3525 | const flags_field_index = std.meta.fieldIndex(Tag.TypeStruct, "flags").?; |
| ... | @@ -3531,12 +3527,12 @@ pub const LoadedStructType = struct { | ... | @@ -3531,12 +3527,12 @@ pub const LoadedStructType = struct { |
| 3531 | } | 3527 | } |
| 3532 | | 3528 | |
| 3533 | pub fn flagsUnordered(s: LoadedStructType, ip: *const InternPool) Tag.TypeStruct.Flags { | 3529 | pub fn flagsUnordered(s: LoadedStructType, ip: *const InternPool) Tag.TypeStruct.Flags { |
| 3534 | return @atomicLoad(Tag.TypeStruct.Flags, s.flagsPtr(@constCast(ip)), .unordered); | 3530 | return @atomicLoad(Tag.TypeStruct.Flags, s.flagsPtr(ip), .unordered); |
| 3535 | } | 3531 | } |
| 3536 | | 3532 | |
| 3537 | /// The returned pointer expires with any addition to the `InternPool`. | 3533 | /// The returned pointer expires with any addition to the `InternPool`. |
| 3538 | /// Asserts that the struct is packed. | 3534 | /// Asserts that the struct is packed. |
| 3539 | fn packedFlagsPtr(s: LoadedStructType, ip: *InternPool) *Tag.TypeStructPacked.Flags { | 3535 | fn packedFlagsPtr(s: LoadedStructType, ip: *const InternPool) *Tag.TypeStructPacked.Flags { |
| 3540 | assert(s.layout == .@"packed"); | 3536 | assert(s.layout == .@"packed"); |
| 3541 | const extra = ip.getLocalShared(s.tid).extra.acquire(); | 3537 | const extra = ip.getLocalShared(s.tid).extra.acquire(); |
| 3542 | const flags_field_index = std.meta.fieldIndex(Tag.TypeStructPacked, "flags").?; | 3538 | const flags_field_index = std.meta.fieldIndex(Tag.TypeStructPacked, "flags").?; |
| ... | @@ -3544,7 +3540,7 @@ pub const LoadedStructType = struct { | ... | @@ -3544,7 +3540,7 @@ pub const LoadedStructType = struct { |
| 3544 | } | 3540 | } |
| 3545 | | 3541 | |
| 3546 | pub fn packedFlagsUnordered(s: LoadedStructType, ip: *const InternPool) Tag.TypeStructPacked.Flags { | 3542 | pub fn packedFlagsUnordered(s: LoadedStructType, ip: *const InternPool) Tag.TypeStructPacked.Flags { |
| 3547 | return @atomicLoad(Tag.TypeStructPacked.Flags, s.packedFlagsPtr(@constCast(ip)), .unordered); | 3543 | return @atomicLoad(Tag.TypeStructPacked.Flags, s.packedFlagsPtr(ip), .unordered); |
| 3548 | } | 3544 | } |
| 3549 | | 3545 | |
| 3550 | /// Reads the non-opv flag calculated during AstGen. Used to short-circuit more | 3546 | /// Reads the non-opv flag calculated during AstGen. Used to short-circuit more |
| ... | @@ -3794,7 +3790,7 @@ pub const LoadedStructType = struct { | ... | @@ -3794,7 +3790,7 @@ pub const LoadedStructType = struct { |
| 3794 | | 3790 | |
| 3795 | /// The returned pointer expires with any addition to the `InternPool`. | 3791 | /// The returned pointer expires with any addition to the `InternPool`. |
| 3796 | /// Asserts the struct is not packed. | 3792 | /// Asserts the struct is not packed. |
| 3797 | fn sizePtr(s: LoadedStructType, ip: *InternPool) *u32 { | 3793 | fn sizePtr(s: LoadedStructType, ip: *const InternPool) *u32 { |
| 3798 | assert(s.layout != .@"packed"); | 3794 | assert(s.layout != .@"packed"); |
| 3799 | const extra = ip.getLocalShared(s.tid).extra.acquire(); | 3795 | const extra = ip.getLocalShared(s.tid).extra.acquire(); |
| 3800 | const size_field_index = std.meta.fieldIndex(Tag.TypeStruct, "size").?; | 3796 | const size_field_index = std.meta.fieldIndex(Tag.TypeStruct, "size").?; |
| ... | @@ -3802,14 +3798,14 @@ pub const LoadedStructType = struct { | ... | @@ -3802,14 +3798,14 @@ pub const LoadedStructType = struct { |
| 3802 | } | 3798 | } |
| 3803 | | 3799 | |
| 3804 | pub fn sizeUnordered(s: LoadedStructType, ip: *const InternPool) u32 { | 3800 | pub fn sizeUnordered(s: LoadedStructType, ip: *const InternPool) u32 { |
| 3805 | return @atomicLoad(u32, s.sizePtr(@constCast(ip)), .unordered); | 3801 | return @atomicLoad(u32, s.sizePtr(ip), .unordered); |
| 3806 | } | 3802 | } |
| 3807 | | 3803 | |
| 3808 | /// The backing integer type of the packed struct. Whether zig chooses | 3804 | /// The backing integer type of the packed struct. Whether zig chooses |
| 3809 | /// this type or the user specifies it, it is stored here. This will be | 3805 | /// this type or the user specifies it, it is stored here. This will be |
| 3810 | /// set to `none` until the layout is resolved. | 3806 | /// set to `none` until the layout is resolved. |
| 3811 | /// Asserts the struct is packed. | 3807 | /// Asserts the struct is packed. |
| 3812 | fn backingIntTypePtr(s: LoadedStructType, ip: *InternPool) *Index { | 3808 | fn backingIntTypePtr(s: LoadedStructType, ip: *const InternPool) *Index { |
| 3813 | assert(s.layout == .@"packed"); | 3809 | assert(s.layout == .@"packed"); |
| 3814 | const extra = ip.getLocalShared(s.tid).extra.acquire(); | 3810 | const extra = ip.getLocalShared(s.tid).extra.acquire(); |
| 3815 | const field_index = std.meta.fieldIndex(Tag.TypeStructPacked, "backing_int_ty").?; | 3811 | const field_index = std.meta.fieldIndex(Tag.TypeStructPacked, "backing_int_ty").?; |
| ... | @@ -3817,7 +3813,7 @@ pub const LoadedStructType = struct { | ... | @@ -3817,7 +3813,7 @@ pub const LoadedStructType = struct { |
| 3817 | } | 3813 | } |
| 3818 | | 3814 | |
| 3819 | pub fn backingIntTypeUnordered(s: LoadedStructType, ip: *const InternPool) Index { | 3815 | pub fn backingIntTypeUnordered(s: LoadedStructType, ip: *const InternPool) Index { |
| 3820 | return @atomicLoad(Index, s.backingIntTypePtr(@constCast(ip)), .unordered); | 3816 | return @atomicLoad(Index, s.backingIntTypePtr(ip), .unordered); |
| 3821 | } | 3817 | } |
| 3822 | | 3818 | |
| 3823 | pub fn setBackingIntType(s: LoadedStructType, ip: *InternPool, backing_int_ty: Index) void { | 3819 | pub fn setBackingIntType(s: LoadedStructType, ip: *InternPool, backing_int_ty: Index) void { |
| ... | @@ -4190,7 +4186,7 @@ pub const LoadedEnumType = struct { | ... | @@ -4190,7 +4186,7 @@ pub const LoadedEnumType = struct { |
| 4190 | | 4186 | |
| 4191 | /// Look up field index based on field name. | 4187 | /// Look up field index based on field name. |
| 4192 | pub fn nameIndex(self: LoadedEnumType, ip: *const InternPool, name: NullTerminatedString) ?u32 { | 4188 | pub fn nameIndex(self: LoadedEnumType, ip: *const InternPool, name: NullTerminatedString) ?u32 { |
| 4193 | const map = self.names_map.getConst(ip); | 4189 | const map = self.names_map.get(ip); |
| 4194 | const adapter: NullTerminatedString.Adapter = .{ .strings = self.names.get(ip) }; | 4190 | const adapter: NullTerminatedString.Adapter = .{ .strings = self.names.get(ip) }; |
| 4195 | const field_index = map.getIndexAdapted(name, adapter) orelse return null; | 4191 | const field_index = map.getIndexAdapted(name, adapter) orelse return null; |
| 4196 | return @intCast(field_index); | 4192 | return @intCast(field_index); |
| ... | @@ -4210,7 +4206,7 @@ pub const LoadedEnumType = struct { | ... | @@ -4210,7 +4206,7 @@ pub const LoadedEnumType = struct { |
| 4210 | else => unreachable, | 4206 | else => unreachable, |
| 4211 | }; | 4207 | }; |
| 4212 | if (self.values_map.unwrap()) |values_map| { | 4208 | if (self.values_map.unwrap()) |values_map| { |
| 4213 | const map = values_map.getConst(ip); | 4209 | const map = values_map.get(ip); |
| 4214 | const adapter: Index.Adapter = .{ .indexes = self.values.get(ip) }; | 4210 | const adapter: Index.Adapter = .{ .indexes = self.values.get(ip) }; |
| 4215 | const field_index = map.getIndexAdapted(int_tag_val, adapter) orelse return null; | 4211 | const field_index = map.getIndexAdapted(int_tag_val, adapter) orelse return null; |
| 4216 | return @intCast(field_index); | 4212 | return @intCast(field_index); |
| ... | @@ -11731,7 +11727,7 @@ pub fn isFuncBody(ip: *const InternPool, func: Index) bool { | ... | @@ -11731,7 +11727,7 @@ pub fn isFuncBody(ip: *const InternPool, func: Index) bool { |
| 11731 | }; | 11727 | }; |
| 11732 | } | 11728 | } |
| 11733 | | 11729 | |
| 11734 | fn funcAnalysisPtr(ip: *InternPool, func: Index) *FuncAnalysis { | 11730 | fn funcAnalysisPtr(ip: *const InternPool, func: Index) *FuncAnalysis { |
| 11735 | const unwrapped_func = func.unwrap(ip); | 11731 | const unwrapped_func = func.unwrap(ip); |
| 11736 | const extra = unwrapped_func.getExtra(ip); | 11732 | const extra = unwrapped_func.getExtra(ip); |
| 11737 | const item = unwrapped_func.getItem(ip); | 11733 | const item = unwrapped_func.getItem(ip); |
| ... | @@ -11757,7 +11753,7 @@ fn funcAnalysisPtr(ip: *InternPool, func: Index) *FuncAnalysis { | ... | @@ -11757,7 +11753,7 @@ fn funcAnalysisPtr(ip: *InternPool, func: Index) *FuncAnalysis { |
| 11757 | } | 11753 | } |
| 11758 | | 11754 | |
| 11759 | pub fn funcAnalysisUnordered(ip: *const InternPool, func: Index) FuncAnalysis { | 11755 | pub fn funcAnalysisUnordered(ip: *const InternPool, func: Index) FuncAnalysis { |
| 11760 | return @atomicLoad(FuncAnalysis, @constCast(ip).funcAnalysisPtr(func), .unordered); | 11756 | return @atomicLoad(FuncAnalysis, ip.funcAnalysisPtr(func), .unordered); |
| 11761 | } | 11757 | } |
| 11762 | | 11758 | |
| 11763 | pub fn funcSetCallsOrAwaitsErrorableFn(ip: *InternPool, func: Index) void { | 11759 | pub fn funcSetCallsOrAwaitsErrorableFn(ip: *InternPool, func: Index) void { |
| ... | @@ -11833,7 +11829,7 @@ fn iesResolvedPtr(ip: *InternPool, ies_index: Index) *Index { | ... | @@ -11833,7 +11829,7 @@ fn iesResolvedPtr(ip: *InternPool, ies_index: Index) *Index { |
| 11833 | /// Returns a mutable pointer to the resolved error set type of an inferred | 11829 | /// Returns a mutable pointer to the resolved error set type of an inferred |
| 11834 | /// error set function. The returned pointer is invalidated when anything is | 11830 | /// error set function. The returned pointer is invalidated when anything is |
| 11835 | /// added to `ip`. | 11831 | /// added to `ip`. |
| 11836 | fn funcIesResolvedPtr(ip: *InternPool, func_index: Index) *Index { | 11832 | fn funcIesResolvedPtr(ip: *const InternPool, func_index: Index) *Index { |
| 11837 | assert(ip.funcAnalysisUnordered(func_index).inferred_error_set); | 11833 | assert(ip.funcAnalysisUnordered(func_index).inferred_error_set); |
| 11838 | const unwrapped_func = func_index.unwrap(ip); | 11834 | const unwrapped_func = func_index.unwrap(ip); |
| 11839 | const func_extra = unwrapped_func.getExtra(ip); | 11835 | const func_extra = unwrapped_func.getExtra(ip); |
| ... | @@ -11861,7 +11857,7 @@ fn funcIesResolvedPtr(ip: *InternPool, func_index: Index) *Index { | ... | @@ -11861,7 +11857,7 @@ fn funcIesResolvedPtr(ip: *InternPool, func_index: Index) *Index { |
| 11861 | } | 11857 | } |
| 11862 | | 11858 | |
| 11863 | pub fn funcIesResolvedUnordered(ip: *const InternPool, index: Index) Index { | 11859 | pub fn funcIesResolvedUnordered(ip: *const InternPool, index: Index) Index { |
| 11864 | return @atomicLoad(Index, @constCast(ip).funcIesResolvedPtr(index), .unordered); | 11860 | return @atomicLoad(Index, ip.funcIesResolvedPtr(index), .unordered); |
| 11865 | } | 11861 | } |
| 11866 | | 11862 | |
| 11867 | pub fn funcSetIesResolved(ip: *InternPool, index: Index, ies: Index) void { | 11863 | pub fn funcSetIesResolved(ip: *InternPool, index: Index, ies: Index) void { |