| ... | ... | @@ -2415,9 +2415,11 @@ pub fn get(ip: *InternPool, gpa: Allocator, key: Key) Allocator.Error!Index { |
| 2415 | 2415 | assert(ptr_type.elem_type != .none); |
| 2416 | 2416 | |
| 2417 | 2417 | if (ptr_type.size == .Slice) { |
| 2418 | _ = ip.map.pop(); |
| 2418 | 2419 | var new_key = key; |
| 2419 | 2420 | new_key.ptr_type.size = .Many; |
| 2420 | 2421 | const ptr_type_index = try get(ip, gpa, new_key); |
| 2422 | assert(!(try ip.map.getOrPutAdapted(gpa, key, adapter)).found_existing); |
| 2421 | 2423 | try ip.items.ensureUnusedCapacity(gpa, 1); |
| 2422 | 2424 | ip.items.appendAssumeCapacity(.{ |
| 2423 | 2425 | .tag = .type_slice, |
| ... | ... | @@ -2737,10 +2739,12 @@ pub fn get(ip: *InternPool, gpa: Allocator, key: Key) Allocator.Error!Index { |
| 2737 | 2739 | }), |
| 2738 | 2740 | }), |
| 2739 | 2741 | .elem, .field => |base_index| { |
| 2742 | _ = ip.map.pop(); |
| 2740 | 2743 | const index_index = try get(ip, gpa, .{ .int = .{ |
| 2741 | 2744 | .ty = .usize_type, |
| 2742 | 2745 | .storage = .{ .u64 = base_index.index }, |
| 2743 | 2746 | } }); |
| 2747 | assert(!(try ip.map.getOrPutAdapted(gpa, key, adapter)).found_existing); |
| 2744 | 2748 | try ip.items.ensureUnusedCapacity(gpa, 1); |
| 2745 | 2749 | ip.items.appendAssumeCapacity(.{ |
| 2746 | 2750 | .tag = .ptr_elem, |
| ... | ... | @@ -2755,11 +2759,13 @@ pub fn get(ip: *InternPool, gpa: Allocator, key: Key) Allocator.Error!Index { |
| 2755 | 2759 | }, |
| 2756 | 2760 | else => { |
| 2757 | 2761 | assert(ptr_type.size == .Slice); |
| 2762 | _ = ip.map.pop(); |
| 2758 | 2763 | var new_key = key; |
| 2759 | 2764 | new_key.ptr.ty = ip.slicePtrType(ptr.ty); |
| 2760 | 2765 | new_key.ptr.len = .none; |
| 2761 | 2766 | assert(ip.indexToKey(new_key.ptr.ty).ptr_type.size == .Many); |
| 2762 | 2767 | const ptr_index = try get(ip, gpa, new_key); |
| 2768 | assert(!(try ip.map.getOrPutAdapted(gpa, key, adapter)).found_existing); |
| 2763 | 2769 | try ip.items.ensureUnusedCapacity(gpa, 1); |
| 2764 | 2770 | ip.items.appendAssumeCapacity(.{ |
| 2765 | 2771 | .tag = .ptr_slice, |
| ... | ... | @@ -3148,7 +3154,6 @@ pub fn getIncompleteEnum( |
| 3148 | 3154 | gpa: Allocator, |
| 3149 | 3155 | enum_type: Key.IncompleteEnumType, |
| 3150 | 3156 | ) Allocator.Error!InternPool.IncompleteEnumType { |
| 3151 | | try ip.items.ensureUnusedCapacity(gpa, 1); |
| 3152 | 3157 | switch (enum_type.tag_mode) { |
| 3153 | 3158 | .auto => return getIncompleteEnumAuto(ip, gpa, enum_type), |
| 3154 | 3159 | .explicit => return getIncompleteEnumExplicit(ip, gpa, enum_type, .type_enum_explicit), |
| ... | ... | @@ -3180,6 +3185,7 @@ pub fn getIncompleteEnumAuto( |
| 3180 | 3185 | |
| 3181 | 3186 | const extra_fields_len: u32 = @typeInfo(EnumAuto).Struct.fields.len; |
| 3182 | 3187 | try ip.extra.ensureUnusedCapacity(gpa, extra_fields_len + enum_type.fields_len); |
| 3188 | try ip.items.ensureUnusedCapacity(gpa, 1); |
| 3183 | 3189 | |
| 3184 | 3190 | const extra_index = ip.addExtraAssumeCapacity(EnumAuto{ |
| 3185 | 3191 | .decl = enum_type.decl, |
| ... | ... | @@ -3227,6 +3233,7 @@ fn getIncompleteEnumExplicit( |
| 3227 | 3233 | |
| 3228 | 3234 | const extra_fields_len: u32 = @typeInfo(EnumExplicit).Struct.fields.len; |
| 3229 | 3235 | try ip.extra.ensureUnusedCapacity(gpa, extra_fields_len + reserved_len); |
| 3236 | try ip.items.ensureUnusedCapacity(gpa, 1); |
| 3230 | 3237 | |
| 3231 | 3238 | const extra_index = ip.addExtraAssumeCapacity(EnumExplicit{ |
| 3232 | 3239 | .decl = enum_type.decl, |