diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-03-07 18:41:45 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-07 18:41:45 -0800 |
| commit | 97aa5f7b8a059f91b78ce7cd70cba0f3aa2c5118 (patch) | |
| tree | 4e2dc7d8083a24bb01cf8e94e684e3256b7f0a31 /src/link | |
| parent | 377ecc6afb14a112a07c6d2c3570e2b77b12a116 (diff) | |
| parent | 38331b1cabf86586bdf70c80ed98f74c60305160 (diff) | |
| download | zig-97aa5f7b8a059f91b78ce7cd70cba0f3aa2c5118.tar.gz zig-97aa5f7b8a059f91b78ce7cd70cba0f3aa2c5118.zip | |
Merge pull request #19190 from mlugg/struct-equivalence
compiler: namespace type equivalence based on AST node + captures
Diffstat (limited to 'src/link')
| -rw-r--r-- | src/link/Dwarf.zig | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/link/Dwarf.zig b/src/link/Dwarf.zig index a28926c1c0..ae14d16be2 100644 --- a/src/link/Dwarf.zig +++ b/src/link/Dwarf.zig @@ -311,7 +311,8 @@ pub const DeclState = struct { try leb128.writeULEB128(dbg_info_buffer.writer(), field_off); } }, - .struct_type => |struct_type| { + .struct_type => { + const struct_type = ip.loadStructType(ty.toIntern()); // DW.AT.name, DW.FORM.string try ty.print(dbg_info_buffer.writer(), mod); try dbg_info_buffer.append(0); @@ -374,7 +375,7 @@ pub const DeclState = struct { try ty.print(dbg_info_buffer.writer(), mod); try dbg_info_buffer.append(0); - const enum_type = ip.indexToKey(ty.ip_index).enum_type; + const enum_type = ip.loadEnumType(ty.ip_index); for (enum_type.names.get(ip), 0..) |field_name_index, field_i| { const field_name = ip.stringToSlice(field_name_index); // DW.AT.enumerator @@ -442,7 +443,7 @@ pub const DeclState = struct { try dbg_info_buffer.append(0); } - for (union_obj.field_types.get(ip), union_obj.field_names.get(ip)) |field_ty, field_name| { + for (union_obj.field_types.get(ip), union_obj.loadTagType(ip).names.get(ip)) |field_ty, field_name| { if (!Type.fromInterned(field_ty).hasRuntimeBits(mod)) continue; // DW.AT.member try dbg_info_buffer.append(@intFromEnum(AbbrevCode.struct_member)); |
