authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2025-01-06 03:51:04-05:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2025-01-06 17:08:47-05:00
log7aa95bc7f6bf673d69b9d9021c3cfb38b5b45f0e
tree720a43ebba32c1bc0f0203ea53722990157b1aec
parentf34ef39af191f97242bee53ba55de3060f5a6bb2

Dwarf: fix abbrev code being overwritten with the wrong empty variant


1 files changed, 192 insertions(+), 190 deletions(-)

src/link/Dwarf.zig+192-190
......@@ -1980,7 +1980,7 @@ pub const WipNav = struct {
19801980 abbrev_code: struct {
19811981 decl: AbbrevCode,
19821982 generic_decl: AbbrevCode,
1983 instance: AbbrevCode,
1983 decl_instance: AbbrevCode,
19841984 },
19851985 nav: *const InternPool.Nav,
19861986 file: Zcu.File.Index,
......@@ -2001,8 +2001,8 @@ pub const WipNav = struct {
20012001 switch (try dwarf.debug_info.declAbbrevCode(wip_nav.unit, decl_gop.value_ptr.*)) {
20022002 else => unreachable,
20032003 .decl_alias,
2004 .decl_enum,
20052004 .decl_empty_enum,
2005 .decl_enum,
20062006 .decl_namespace_struct,
20072007 .decl_struct,
20082008 .decl_packed_struct,
......@@ -2012,15 +2012,11 @@ pub const WipNav = struct {
20122012 .decl_const_runtime_bits,
20132013 .decl_const_comptime_state,
20142014 .decl_const_runtime_bits_comptime_state,
2015 .decl_func,
20162015 .decl_empty_func,
2017 .decl_func_generic,
2016 .decl_func,
20182017 .decl_empty_func_generic,
2018 .decl_func_generic,
20192019 => false,
2020 .generic_decl_alias,
2021 .generic_decl_enum,
2022 .generic_decl_struct,
2023 .generic_decl_union,
20242020 .generic_decl_var,
20252021 .generic_decl_const,
20262022 .generic_decl_func,
......@@ -2054,7 +2050,7 @@ pub const WipNav = struct {
20542050 try dwarf.debug_info.section.replaceEntry(wip_nav.unit, generic_decl_entry, dwarf, wip_nav.debug_info.items);
20552051 wip_nav.debug_info.clearRetainingCapacity();
20562052 wip_nav.entry = orig_entry;
2057 try wip_nav.abbrevCode(abbrev_code.instance);
2053 try wip_nav.abbrevCode(abbrev_code.decl_instance);
20582054 try wip_nav.refType(parent_type.?);
20592055 try wip_nav.infoSectionOffset(.debug_info, wip_nav.unit, generic_decl_entry, 0);
20602056 }
......@@ -2402,7 +2398,7 @@ pub fn initWipNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool.Nav.In
24022398 try wip_nav.declCommon(.{
24032399 .decl = .decl_var,
24042400 .generic_decl = .generic_decl_var,
2405 .instance = .instance_var,
2401 .decl_instance = .decl_instance_var,
24062402 }, &nav, inst_info.file, &decl);
24072403 try wip_nav.strp(nav.fqn.toSlice(ip));
24082404 const ty: Type = nav_val.typeOf(zcu);
......@@ -2429,7 +2425,14 @@ pub fn initWipNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool.Nav.In
24292425 },
24302426 }
24312427 },
2432 .func => |func| {
2428 .func => |func| if (func.owner_nav != nav_index) {
2429 try wip_nav.declCommon(.{
2430 .decl = .decl_alias,
2431 .generic_decl = .generic_decl_const,
2432 .decl_instance = .decl_instance_alias,
2433 }, &nav, inst_info.file, &decl);
2434 try wip_nav.refNav(func.owner_nav);
2435 } else {
24332436 const func_type = ip.indexToKey(func.ty).func_type;
24342437 wip_nav.func = nav_val.toIntern();
24352438 wip_nav.func_sym_index = sym_index;
......@@ -2479,7 +2482,7 @@ pub fn initWipNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool.Nav.In
24792482 try wip_nav.declCommon(.{
24802483 .decl = .decl_func,
24812484 .generic_decl = .generic_decl_func,
2482 .instance = .instance_func,
2485 .decl_instance = .decl_instance_func,
24832486 }, &nav, inst_info.file, &decl);
24842487 try wip_nav.strp(nav.fqn.toSlice(ip));
24852488 try wip_nav.refType(.fromInterned(func_type.return_type));
......@@ -2599,11 +2602,20 @@ pub fn finishWipNavFunc(
25992602 if (wip_nav.any_children) {
26002603 const diw = wip_nav.debug_info.writer(dwarf.gpa);
26012604 try uleb128(diw, @intFromEnum(AbbrevCode.null));
2602 } else std.leb.writeUnsignedFixed(
2603 AbbrevCode.decl_bytes,
2604 wip_nav.debug_info.items[0..AbbrevCode.decl_bytes],
2605 try dwarf.refAbbrevCode(.decl_empty_func),
2606 );
2605 } else {
2606 const abbrev_code_buf = wip_nav.debug_info.items[0..AbbrevCode.decl_bytes];
2607 var abbrev_code_fbs = std.io.fixedBufferStream(abbrev_code_buf);
2608 const abbrev_code: AbbrevCode = @enumFromInt(std.leb.readUleb128(@typeInfo(AbbrevCode).@"enum".tag_type, abbrev_code_fbs.reader()) catch unreachable);
2609 std.leb.writeUnsignedFixed(
2610 AbbrevCode.decl_bytes,
2611 abbrev_code_buf,
2612 try dwarf.refAbbrevCode(switch (abbrev_code) {
2613 else => unreachable,
2614 .decl_func => .decl_empty_func,
2615 .decl_instance_func => .decl_instance_empty_func,
2616 }),
2617 );
2618 }
26072619 }
26082620 {
26092621 try dwarf.debug_rnglists.section.getUnit(wip_nav.unit).getEntry(wip_nav.entry).external_relocs.appendSlice(dwarf.gpa, &.{
......@@ -2702,14 +2714,20 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
27022714 const nav_gop = try dwarf.navs.getOrPut(dwarf.gpa, nav_index);
27032715 errdefer _ = if (!nav_gop.found_existing) dwarf.navs.pop();
27042716
2705 const tag: enum { done, decl_alias, decl_var, decl_const } = switch (ip.indexToKey(nav_val.toIntern())) {
2717 const tag: union(enum) {
2718 done,
2719 decl_alias,
2720 decl_var,
2721 decl_const,
2722 decl_func_alias: InternPool.Nav.Index,
2723 } = switch (ip.indexToKey(nav_val.toIntern())) {
27062724 .int_type,
27072725 .ptr_type,
27082726 .array_type,
27092727 .vector_type,
27102728 .opt_type,
2711 .anyframe_type,
27122729 .error_union_type,
2730 .anyframe_type,
27132731 .simple_type,
27142732 .tuple_type,
27152733 .func_type,
......@@ -2739,12 +2757,12 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
27392757 .auto, .@"extern" => {
27402758 try wip_nav.declCommon(if (loaded_struct.field_types.len == 0) .{
27412759 .decl = .decl_namespace_struct,
2742 .generic_decl = .generic_decl_struct,
2743 .instance = .instance_namespace_struct,
2760 .generic_decl = .generic_decl_const,
2761 .decl_instance = .decl_instance_namespace_struct,
27442762 } else .{
27452763 .decl = .decl_struct,
2746 .generic_decl = .generic_decl_struct,
2747 .instance = .instance_struct,
2764 .generic_decl = .generic_decl_const,
2765 .decl_instance = .decl_instance_struct,
27482766 }, &nav, inst_info.file, &decl);
27492767 if (loaded_struct.field_types.len == 0) try diw.writeByte(@intFromBool(false)) else {
27502768 try uleb128(diw, nav_val.toType().abiSize(zcu));
......@@ -2799,8 +2817,8 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
27992817 .@"packed" => {
28002818 try wip_nav.declCommon(.{
28012819 .decl = .decl_packed_struct,
2802 .generic_decl = .generic_decl_struct,
2803 .instance = .instance_packed_struct,
2820 .generic_decl = .generic_decl_const,
2821 .decl_instance = .decl_instance_packed_struct,
28042822 }, &nav, inst_info.file, &decl);
28052823 try wip_nav.refType(.fromInterned(loaded_struct.backingIntTypeUnordered(ip)));
28062824 var field_bit_offset: u16 = 0;
......@@ -2837,12 +2855,12 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
28372855 const diw = wip_nav.debug_info.writer(dwarf.gpa);
28382856 try wip_nav.declCommon(if (loaded_enum.names.len > 0) .{
28392857 .decl = .decl_enum,
2840 .generic_decl = .generic_decl_enum,
2841 .instance = .instance_enum,
2858 .generic_decl = .generic_decl_const,
2859 .decl_instance = .decl_instance_enum,
28422860 } else .{
28432861 .decl = .decl_empty_enum,
2844 .generic_decl = .generic_decl_enum,
2845 .instance = .instance_empty_enum,
2862 .generic_decl = .generic_decl_const,
2863 .decl_instance = .decl_instance_empty_enum,
28462864 }, &nav, inst_info.file, &decl);
28472865 try wip_nav.refType(.fromInterned(loaded_enum.tag_ty));
28482866 for (0..loaded_enum.names.len) |field_index| {
......@@ -2875,8 +2893,8 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
28752893 const diw = wip_nav.debug_info.writer(dwarf.gpa);
28762894 try wip_nav.declCommon(.{
28772895 .decl = .decl_union,
2878 .generic_decl = .generic_decl_union,
2879 .instance = .instance_union,
2896 .generic_decl = .generic_decl_const,
2897 .decl_instance = .decl_instance_union,
28802898 }, &nav, inst_info.file, &decl);
28812899 const union_layout = Type.getUnionLayout(loaded_union, zcu);
28822900 try uleb128(diw, union_layout.abi_size);
......@@ -2945,8 +2963,8 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
29452963 const diw = wip_nav.debug_info.writer(dwarf.gpa);
29462964 try wip_nav.declCommon(.{
29472965 .decl = .decl_namespace_struct,
2948 .generic_decl = .generic_decl_struct,
2949 .instance = .instance_namespace_struct,
2966 .generic_decl = .generic_decl_const,
2967 .decl_instance = .decl_instance_namespace_struct,
29502968 }, &nav, inst_info.file, &decl);
29512969 try diw.writeByte(@intFromBool(true));
29522970 break :tag .done;
......@@ -2969,14 +2987,15 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
29692987 .variable => .decl_var,
29702988 .@"extern" => unreachable,
29712989 .func => |func| tag: {
2990 if (func.owner_nav != nav_index) break :tag .{ .decl_func_alias = func.owner_nav };
29722991 if (nav_gop.found_existing) switch (try dwarf.debug_info.declAbbrevCode(wip_nav.unit, nav_gop.value_ptr.*)) {
29732992 .null => {},
29742993 else => unreachable,
2975 .decl_func, .decl_empty_func, .instance_func, .instance_empty_func => return,
2976 .decl_func_generic,
2994 .decl_empty_func, .decl_func, .decl_instance_empty_func, .decl_instance_func => return,
29772995 .decl_empty_func_generic,
2978 .instance_func_generic,
2979 .instance_empty_func_generic,
2996 .decl_func_generic,
2997 .decl_instance_empty_func_generic,
2998 .decl_instance_func_generic,
29802999 => dwarf.debug_info.section.getUnit(wip_nav.unit).getEntry(nav_gop.value_ptr.*).clear(),
29813000 } else nav_gop.value_ptr.* = try dwarf.addCommonEntry(wip_nav.unit);
29823001 wip_nav.entry = nav_gop.value_ptr.*;
......@@ -2986,11 +3005,11 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
29863005 try wip_nav.declCommon(if (func_type.param_types.len > 0 or func_type.is_var_args) .{
29873006 .decl = .decl_func_generic,
29883007 .generic_decl = .generic_decl_func,
2989 .instance = .instance_func_generic,
3008 .decl_instance = .decl_instance_func_generic,
29903009 } else .{
29913010 .decl = .decl_empty_func_generic,
29923011 .generic_decl = .generic_decl_func,
2993 .instance = .instance_empty_func_generic,
3012 .decl_instance = .decl_instance_empty_func_generic,
29943013 }, &nav, inst_info.file, &decl);
29953014 try wip_nav.refType(.fromInterned(func_type.return_type));
29963015 if (func_type.param_types.len > 0 or func_type.is_var_args) {
......@@ -3018,8 +3037,8 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
30183037 .decl_alias => {
30193038 try wip_nav.declCommon(.{
30203039 .decl = .decl_alias,
3021 .generic_decl = .generic_decl_alias,
3022 .instance = .instance_alias,
3040 .generic_decl = .generic_decl_const,
3041 .decl_instance = .decl_instance_alias,
30233042 }, &nav, inst_info.file, &decl);
30243043 try wip_nav.refType(nav_val.toType());
30253044 },
......@@ -3028,7 +3047,7 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
30283047 try wip_nav.declCommon(.{
30293048 .decl = .decl_var,
30303049 .generic_decl = .generic_decl_var,
3031 .instance = .instance_var,
3050 .decl_instance = .decl_instance_var,
30323051 }, &nav, inst_info.file, &decl);
30333052 try wip_nav.strp(nav.fqn.toSlice(ip));
30343053 const nav_ty = nav_val.typeOf(zcu);
......@@ -3046,19 +3065,19 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
30463065 try wip_nav.declCommon(if (has_runtime_bits and has_comptime_state) .{
30473066 .decl = .decl_const_runtime_bits_comptime_state,
30483067 .generic_decl = .generic_decl_const,
3049 .instance = .instance_const_runtime_bits_comptime_state,
3068 .decl_instance = .decl_instance_const_runtime_bits_comptime_state,
30503069 } else if (has_comptime_state) .{
30513070 .decl = .decl_const_comptime_state,
30523071 .generic_decl = .generic_decl_const,
3053 .instance = .instance_const_comptime_state,
3072 .decl_instance = .decl_instance_const_comptime_state,
30543073 } else if (has_runtime_bits) .{
30553074 .decl = .decl_const_runtime_bits,
30563075 .generic_decl = .generic_decl_const,
3057 .instance = .instance_const_runtime_bits,
3076 .decl_instance = .decl_instance_const_runtime_bits,
30583077 } else .{
30593078 .decl = .decl_const,
30603079 .generic_decl = .generic_decl_const,
3061 .instance = .instance_const,
3080 .decl_instance = .decl_instance_const,
30623081 }, &nav, inst_info.file, &decl);
30633082 try wip_nav.strp(nav.fqn.toSlice(ip));
30643083 const nav_ty_reloc_index = try wip_nav.refForward();
......@@ -3071,6 +3090,14 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
30713090 try wip_nav.abbrevCode(.is_const);
30723091 try wip_nav.refType(nav_ty);
30733092 },
3093 .decl_func_alias => |owner_nav| {
3094 try wip_nav.declCommon(.{
3095 .decl = .decl_alias,
3096 .generic_decl = .generic_decl_const,
3097 .decl_instance = .decl_instance_alias,
3098 }, &nav, inst_info.file, &decl);
3099 try wip_nav.refNav(owner_nav);
3100 },
30743101 }
30753102 try dwarf.debug_info.section.replaceEntry(wip_nav.unit, wip_nav.entry, dwarf, wip_nav.debug_info.items);
30763103 try wip_nav.updateLazy(nav_src_loc);
......@@ -3442,7 +3469,7 @@ fn updateLazyType(
34423469 },
34433470 .enum_type => {
34443471 const loaded_enum = ip.loadEnumType(type_index);
3445 try wip_nav.abbrevCode(if (loaded_enum.names.len > 0) .generated_enum_type else .generated_empty_enum_type);
3472 try wip_nav.abbrevCode(if (loaded_enum.names.len == 0) .generated_empty_enum_type else .generated_enum_type);
34463473 try wip_nav.strp(name);
34473474 try wip_nav.refType(.fromInterned(loaded_enum.tag_ty));
34483475 for (0..loaded_enum.names.len) |field_index| {
......@@ -3467,7 +3494,7 @@ fn updateLazyType(
34673494 }
34683495 // For better or worse, we try to match what Clang emits.
34693496 break :cc switch (func_type.cc) {
3470 .@"inline" => unreachable,
3497 .@"inline" => .nocall,
34713498 .@"async", .auto, .naked => .normal,
34723499 .x86_64_sysv => .LLVM_X86_64SysV,
34733500 .x86_64_win => .LLVM_Win64,
......@@ -3534,7 +3561,7 @@ fn updateLazyType(
35343561 if (!is_nullary) try uleb128(diw, @intFromEnum(AbbrevCode.null));
35353562 },
35363563 .error_set_type => |error_set_type| {
3537 try wip_nav.abbrevCode(if (error_set_type.names.len > 0) .generated_enum_type else .generated_empty_enum_type);
3564 try wip_nav.abbrevCode(if (error_set_type.names.len == 0) .generated_empty_enum_type else .generated_enum_type);
35383565 try wip_nav.strp(name);
35393566 try wip_nav.refType(.fromInterned(try pt.intern(.{ .int_type = .{
35403567 .signedness = .unsigned,
......@@ -4318,7 +4345,7 @@ pub fn flushModule(dwarf: *Dwarf, pt: Zcu.PerThread) FlushError!void {
43184345 defer wip_nav.deinit();
43194346 const diw = wip_nav.debug_info.writer(dwarf.gpa);
43204347 const global_error_set_names = ip.global_error_set.getNamesFromMainThread();
4321 try wip_nav.abbrevCode(if (global_error_set_names.len > 0) .generated_enum_type else .generated_empty_enum_type);
4348 try wip_nav.abbrevCode(if (global_error_set_names.len == 0) .generated_empty_enum_type else .generated_enum_type);
43224349 try wip_nav.strp("anyerror");
43234350 try wip_nav.refType(.fromInterned(try pt.intern(.{ .int_type = .{
43244351 .signedness = .unsigned,
......@@ -4707,10 +4734,10 @@ const AbbrevCode = enum {
47074734 // padding codes must be one byte uleb128 values to function
47084735 pad_1,
47094736 pad_n,
4710 // (generic) decl codes are assumed to all have the same uleb128 length
4737 // decl, generic decl, and instance codes are assumed to all have the same uleb128 length
47114738 decl_alias,
4712 decl_enum,
47134739 decl_empty_enum,
4740 decl_enum,
47144741 decl_namespace_struct,
47154742 decl_struct,
47164743 decl_packed_struct,
......@@ -4720,38 +4747,35 @@ const AbbrevCode = enum {
47204747 decl_const_runtime_bits,
47214748 decl_const_comptime_state,
47224749 decl_const_runtime_bits_comptime_state,
4723 decl_func,
47244750 decl_empty_func,
4725 decl_func_generic,
4751 decl_func,
47264752 decl_empty_func_generic,
4727 generic_decl_alias,
4728 generic_decl_enum,
4729 generic_decl_struct,
4730 generic_decl_union,
4753 decl_func_generic,
47314754 generic_decl_var,
47324755 generic_decl_const,
47334756 generic_decl_func,
4734 // the rest are unrestricted
4735 instance_alias,
4736 instance_enum,
4737 instance_empty_enum,
4738 instance_namespace_struct,
4739 instance_struct,
4740 instance_packed_struct,
4741 instance_union,
4742 instance_var,
4743 instance_const,
4744 instance_const_runtime_bits,
4745 instance_const_comptime_state,
4746 instance_const_runtime_bits_comptime_state,
4747 instance_func,
4748 instance_empty_func,
4749 instance_func_generic,
4750 instance_empty_func_generic,
4757 decl_instance_alias,
4758 decl_instance_empty_enum,
4759 decl_instance_enum,
4760 decl_instance_namespace_struct,
4761 decl_instance_struct,
4762 decl_instance_packed_struct,
4763 decl_instance_union,
4764 decl_instance_var,
4765 decl_instance_const,
4766 decl_instance_const_runtime_bits,
4767 decl_instance_const_comptime_state,
4768 decl_instance_const_runtime_bits_comptime_state,
4769 decl_instance_empty_func,
4770 decl_instance_func,
4771 decl_instance_empty_func_generic,
4772 decl_instance_func_generic,
4773 // the rest are unrestricted other than empty variants must not be longer
4774 // than the non-empty variant, and so should appear first
47514775 compile_unit,
47524776 module,
4753 file,
47544777 empty_file,
4778 file,
47554779 signed_enum_field,
47564780 unsigned_enum_field,
47574781 big_enum_field,
......@@ -4784,19 +4808,19 @@ const AbbrevCode = enum {
47844808 func_type,
47854809 func_type_param,
47864810 is_var_args,
4787 generated_enum_type,
47884811 generated_empty_enum_type,
4789 generated_struct_type,
4812 generated_enum_type,
47904813 generated_empty_struct_type,
4814 generated_struct_type,
47914815 generated_union_type,
4792 enum_type,
47934816 empty_enum_type,
4794 struct_type,
4817 enum_type,
47954818 empty_struct_type,
4796 packed_struct_type,
4819 struct_type,
47974820 empty_packed_struct_type,
4798 union_type,
4821 packed_struct_type,
47994822 empty_union_type,
4823 union_type,
48004824 empty_block,
48014825 block,
48024826 empty_inlined_func,
......@@ -4818,7 +4842,12 @@ const AbbrevCode = enum {
48184842 comptime_value_elem_runtime_bits,
48194843 comptime_value_elem_comptime_state,
48204844
4821 const decl_bytes = uleb128Bytes(@intFromEnum(AbbrevCode.generic_decl_func));
4845 const decl_bytes = uleb128Bytes(@intFromEnum(AbbrevCode.decl_instance_func_generic));
4846 comptime {
4847 assert(uleb128Bytes(@intFromEnum(AbbrevCode.pad_1)) == 1);
4848 assert(uleb128Bytes(@intFromEnum(AbbrevCode.pad_n)) == 1);
4849 assert(uleb128Bytes(@intFromEnum(AbbrevCode.decl_alias)) == decl_bytes);
4850 }
48224851
48234852 const Attr = struct {
48244853 DeclValEnum(DW.AT),
......@@ -4831,7 +4860,10 @@ const AbbrevCode = enum {
48314860 .{ .accessibility, .data1 },
48324861 .{ .name, .strp },
48334862 };
4834 const instance_abbrev_common_attrs = &[_]Attr{
4863 const generic_decl_abbrev_common_attrs = decl_abbrev_common_attrs ++ &[_]Attr{
4864 .{ .declaration, .flag_present },
4865 };
4866 const decl_instance_abbrev_common_attrs = &[_]Attr{
48354867 .{ .ZIG_parent, .ref_addr },
48364868 .{ .abstract_origin, .ref_addr },
48374869 };
......@@ -4855,15 +4887,15 @@ const AbbrevCode = enum {
48554887 .{ .import, .ref_addr },
48564888 },
48574889 },
4858 .decl_enum = .{
4890 .decl_empty_enum = .{
48594891 .tag = .enumeration_type,
4860 .children = true,
48614892 .attrs = decl_abbrev_common_attrs ++ .{
48624893 .{ .type, .ref_addr },
48634894 },
48644895 },
4865 .decl_empty_enum = .{
4896 .decl_enum = .{
48664897 .tag = .enumeration_type,
4898 .children = true,
48674899 .attrs = decl_abbrev_common_attrs ++ .{
48684900 .{ .type, .ref_addr },
48694901 },
......@@ -4947,9 +4979,8 @@ const AbbrevCode = enum {
49474979 .{ .ZIG_comptime_value, .ref_addr },
49484980 },
49494981 },
4950 .decl_func = .{
4982 .decl_empty_func = .{
49514983 .tag = .subprogram,
4952 .children = true,
49534984 .attrs = decl_abbrev_common_attrs ++ .{
49544985 .{ .linkage_name, .strp },
49554986 .{ .type, .ref_addr },
......@@ -4960,8 +4991,9 @@ const AbbrevCode = enum {
49604991 .{ .noreturn, .flag },
49614992 },
49624993 },
4963 .decl_empty_func = .{
4994 .decl_func = .{
49644995 .tag = .subprogram,
4996 .children = true,
49654997 .attrs = decl_abbrev_common_attrs ++ .{
49664998 .{ .linkage_name, .strp },
49674999 .{ .type, .ref_addr },
......@@ -4972,112 +5004,82 @@ const AbbrevCode = enum {
49725004 .{ .noreturn, .flag },
49735005 },
49745006 },
4975 .decl_func_generic = .{
5007 .decl_empty_func_generic = .{
49765008 .tag = .subprogram,
4977 .children = true,
49785009 .attrs = decl_abbrev_common_attrs ++ .{
49795010 .{ .type, .ref_addr },
49805011 },
49815012 },
4982 .decl_empty_func_generic = .{
5013 .decl_func_generic = .{
49835014 .tag = .subprogram,
5015 .children = true,
49845016 .attrs = decl_abbrev_common_attrs ++ .{
49855017 .{ .type, .ref_addr },
49865018 },
49875019 },
4988 .generic_decl_alias = .{
4989 .tag = .imported_declaration,
4990 .attrs = decl_abbrev_common_attrs ++ .{
4991 .{ .declaration, .flag_present },
4992 },
4993 },
4994 .generic_decl_enum = .{
4995 .tag = .enumeration_type,
4996 .attrs = decl_abbrev_common_attrs ++ .{
4997 .{ .declaration, .flag_present },
4998 },
4999 },
5000 .generic_decl_struct = .{
5001 .tag = .structure_type,
5002 .attrs = decl_abbrev_common_attrs ++ .{
5003 .{ .declaration, .flag_present },
5004 },
5005 },
5006 .generic_decl_union = .{
5007 .tag = .union_type,
5008 .attrs = decl_abbrev_common_attrs ++ .{
5009 .{ .declaration, .flag_present },
5010 },
5011 },
50125020 .generic_decl_var = .{
50135021 .tag = .variable,
5014 .attrs = decl_abbrev_common_attrs ++ .{
5015 .{ .declaration, .flag_present },
5016 },
5022 .attrs = generic_decl_abbrev_common_attrs,
50175023 },
50185024 .generic_decl_const = .{
50195025 .tag = .constant,
5020 .attrs = decl_abbrev_common_attrs ++ .{
5021 .{ .declaration, .flag_present },
5022 },
5026 .attrs = generic_decl_abbrev_common_attrs,
50235027 },
50245028 .generic_decl_func = .{
50255029 .tag = .subprogram,
5026 .attrs = decl_abbrev_common_attrs ++ .{
5027 .{ .declaration, .flag_present },
5028 },
5030 .attrs = generic_decl_abbrev_common_attrs,
50295031 },
5030 .instance_alias = .{
5032 .decl_instance_alias = .{
50315033 .tag = .imported_declaration,
5032 .attrs = instance_abbrev_common_attrs ++ .{
5034 .attrs = decl_instance_abbrev_common_attrs ++ .{
50335035 .{ .import, .ref_addr },
50345036 },
50355037 },
5036 .instance_enum = .{
5038 .decl_instance_empty_enum = .{
50375039 .tag = .enumeration_type,
5038 .children = true,
5039 .attrs = instance_abbrev_common_attrs ++ .{
5040 .attrs = decl_instance_abbrev_common_attrs ++ .{
50405041 .{ .type, .ref_addr },
50415042 },
50425043 },
5043 .instance_empty_enum = .{
5044 .decl_instance_enum = .{
50445045 .tag = .enumeration_type,
5045 .attrs = instance_abbrev_common_attrs ++ .{
5046 .children = true,
5047 .attrs = decl_instance_abbrev_common_attrs ++ .{
50465048 .{ .type, .ref_addr },
50475049 },
50485050 },
5049 .instance_namespace_struct = .{
5051 .decl_instance_namespace_struct = .{
50505052 .tag = .structure_type,
5051 .attrs = instance_abbrev_common_attrs ++ .{
5053 .attrs = decl_instance_abbrev_common_attrs ++ .{
50525054 .{ .declaration, .flag },
50535055 },
50545056 },
5055 .instance_struct = .{
5057 .decl_instance_struct = .{
50565058 .tag = .structure_type,
50575059 .children = true,
5058 .attrs = instance_abbrev_common_attrs ++ .{
5060 .attrs = decl_instance_abbrev_common_attrs ++ .{
50595061 .{ .byte_size, .udata },
50605062 .{ .alignment, .udata },
50615063 },
50625064 },
5063 .instance_packed_struct = .{
5065 .decl_instance_packed_struct = .{
50645066 .tag = .structure_type,
50655067 .children = true,
5066 .attrs = instance_abbrev_common_attrs ++ .{
5068 .attrs = decl_instance_abbrev_common_attrs ++ .{
50675069 .{ .type, .ref_addr },
50685070 },
50695071 },
5070 .instance_union = .{
5072 .decl_instance_union = .{
50715073 .tag = .union_type,
50725074 .children = true,
5073 .attrs = instance_abbrev_common_attrs ++ .{
5075 .attrs = decl_instance_abbrev_common_attrs ++ .{
50745076 .{ .byte_size, .udata },
50755077 .{ .alignment, .udata },
50765078 },
50775079 },
5078 .instance_var = .{
5080 .decl_instance_var = .{
50795081 .tag = .variable,
5080 .attrs = instance_abbrev_common_attrs ++ .{
5082 .attrs = decl_instance_abbrev_common_attrs ++ .{
50815083 .{ .linkage_name, .strp },
50825084 .{ .type, .ref_addr },
50835085 .{ .location, .exprloc },
......@@ -5085,18 +5087,18 @@ const AbbrevCode = enum {
50855087 .{ .external, .flag },
50865088 },
50875089 },
5088 .instance_const = .{
5090 .decl_instance_const = .{
50895091 .tag = .constant,
5090 .attrs = instance_abbrev_common_attrs ++ .{
5092 .attrs = decl_instance_abbrev_common_attrs ++ .{
50915093 .{ .linkage_name, .strp },
50925094 .{ .type, .ref_addr },
50935095 .{ .alignment, .udata },
50945096 .{ .external, .flag },
50955097 },
50965098 },
5097 .instance_const_runtime_bits = .{
5099 .decl_instance_const_runtime_bits = .{
50985100 .tag = .constant,
5099 .attrs = instance_abbrev_common_attrs ++ .{
5101 .attrs = decl_instance_abbrev_common_attrs ++ .{
51005102 .{ .linkage_name, .strp },
51015103 .{ .type, .ref_addr },
51025104 .{ .alignment, .udata },
......@@ -5104,9 +5106,9 @@ const AbbrevCode = enum {
51045106 .{ .const_value, .block },
51055107 },
51065108 },
5107 .instance_const_comptime_state = .{
5109 .decl_instance_const_comptime_state = .{
51085110 .tag = .constant,
5109 .attrs = instance_abbrev_common_attrs ++ .{
5111 .attrs = decl_instance_abbrev_common_attrs ++ .{
51105112 .{ .linkage_name, .strp },
51115113 .{ .type, .ref_addr },
51125114 .{ .alignment, .udata },
......@@ -5114,9 +5116,9 @@ const AbbrevCode = enum {
51145116 .{ .ZIG_comptime_value, .ref_addr },
51155117 },
51165118 },
5117 .instance_const_runtime_bits_comptime_state = .{
5119 .decl_instance_const_runtime_bits_comptime_state = .{
51185120 .tag = .constant,
5119 .attrs = instance_abbrev_common_attrs ++ .{
5121 .attrs = decl_instance_abbrev_common_attrs ++ .{
51205122 .{ .linkage_name, .strp },
51215123 .{ .type, .ref_addr },
51225124 .{ .alignment, .udata },
......@@ -5125,10 +5127,9 @@ const AbbrevCode = enum {
51255127 .{ .ZIG_comptime_value, .ref_addr },
51265128 },
51275129 },
5128 .instance_func = .{
5130 .decl_instance_empty_func = .{
51295131 .tag = .subprogram,
5130 .children = true,
5131 .attrs = instance_abbrev_common_attrs ++ .{
5132 .attrs = decl_instance_abbrev_common_attrs ++ .{
51325133 .{ .linkage_name, .strp },
51335134 .{ .type, .ref_addr },
51345135 .{ .low_pc, .addr },
......@@ -5138,9 +5139,10 @@ const AbbrevCode = enum {
51385139 .{ .noreturn, .flag },
51395140 },
51405141 },
5141 .instance_empty_func = .{
5142 .decl_instance_func = .{
51425143 .tag = .subprogram,
5143 .attrs = instance_abbrev_common_attrs ++ .{
5144 .children = true,
5145 .attrs = decl_instance_abbrev_common_attrs ++ .{
51445146 .{ .linkage_name, .strp },
51455147 .{ .type, .ref_addr },
51465148 .{ .low_pc, .addr },
......@@ -5150,16 +5152,16 @@ const AbbrevCode = enum {
51505152 .{ .noreturn, .flag },
51515153 },
51525154 },
5153 .instance_func_generic = .{
5155 .decl_instance_empty_func_generic = .{
51545156 .tag = .subprogram,
5155 .children = true,
5156 .attrs = instance_abbrev_common_attrs ++ .{
5157 .attrs = decl_instance_abbrev_common_attrs ++ .{
51575158 .{ .type, .ref_addr },
51585159 },
51595160 },
5160 .instance_empty_func_generic = .{
5161 .decl_instance_func_generic = .{
51615162 .tag = .subprogram,
5162 .attrs = instance_abbrev_common_attrs ++ .{
5163 .children = true,
5164 .attrs = decl_instance_abbrev_common_attrs ++ .{
51635165 .{ .type, .ref_addr },
51645166 },
51655167 },
......@@ -5185,21 +5187,21 @@ const AbbrevCode = enum {
51855187 .{ .ranges, .rnglistx },
51865188 },
51875189 },
5188 .file = .{
5190 .empty_file = .{
51895191 .tag = .structure_type,
5190 .children = true,
51915192 .attrs = &.{
51925193 .{ .decl_file, .udata },
51935194 .{ .name, .strp },
5194 .{ .byte_size, .udata },
5195 .{ .alignment, .udata },
51965195 },
51975196 },
5198 .empty_file = .{
5197 .file = .{
51995198 .tag = .structure_type,
5199 .children = true,
52005200 .attrs = &.{
52015201 .{ .decl_file, .udata },
52025202 .{ .name, .strp },
5203 .{ .byte_size, .udata },
5204 .{ .alignment, .udata },
52035205 },
52045206 },
52055207 .signed_enum_field = .{
......@@ -5449,35 +5451,35 @@ const AbbrevCode = enum {
54495451 .is_var_args = .{
54505452 .tag = .unspecified_parameters,
54515453 },
5452 .generated_enum_type = .{
5454 .generated_empty_enum_type = .{
54535455 .tag = .enumeration_type,
5454 .children = true,
54555456 .attrs = &.{
54565457 .{ .name, .strp },
54575458 .{ .type, .ref_addr },
54585459 },
54595460 },
5460 .generated_empty_enum_type = .{
5461 .generated_enum_type = .{
54615462 .tag = .enumeration_type,
5463 .children = true,
54625464 .attrs = &.{
54635465 .{ .name, .strp },
54645466 .{ .type, .ref_addr },
54655467 },
54665468 },
5467 .generated_struct_type = .{
5469 .generated_empty_struct_type = .{
54685470 .tag = .structure_type,
5469 .children = true,
54705471 .attrs = &.{
54715472 .{ .name, .strp },
5472 .{ .byte_size, .udata },
5473 .{ .alignment, .udata },
5473 .{ .declaration, .flag },
54745474 },
54755475 },
5476 .generated_empty_struct_type = .{
5476 .generated_struct_type = .{
54775477 .tag = .structure_type,
5478 .children = true,
54785479 .attrs = &.{
54795480 .{ .name, .strp },
5480 .{ .declaration, .flag },
5481 .{ .byte_size, .udata },
5482 .{ .alignment, .udata },
54815483 },
54825484 },
54835485 .generated_union_type = .{
......@@ -5489,61 +5491,60 @@ const AbbrevCode = enum {
54895491 .{ .alignment, .udata },
54905492 },
54915493 },
5492 .enum_type = .{
5494 .empty_enum_type = .{
54935495 .tag = .enumeration_type,
5494 .children = true,
54955496 .attrs = &.{
54965497 .{ .decl_file, .udata },
54975498 .{ .name, .strp },
54985499 .{ .type, .ref_addr },
54995500 },
55005501 },
5501 .empty_enum_type = .{
5502 .enum_type = .{
55025503 .tag = .enumeration_type,
5504 .children = true,
55035505 .attrs = &.{
55045506 .{ .decl_file, .udata },
55055507 .{ .name, .strp },
55065508 .{ .type, .ref_addr },
55075509 },
55085510 },
5509 .struct_type = .{
5511 .empty_struct_type = .{
55105512 .tag = .structure_type,
5511 .children = true,
55125513 .attrs = &.{
55135514 .{ .decl_file, .udata },
55145515 .{ .name, .strp },
5515 .{ .byte_size, .udata },
5516 .{ .alignment, .udata },
5516 .{ .declaration, .flag },
55175517 },
55185518 },
5519 .empty_struct_type = .{
5519 .struct_type = .{
55205520 .tag = .structure_type,
5521 .children = true,
55215522 .attrs = &.{
55225523 .{ .decl_file, .udata },
55235524 .{ .name, .strp },
5524 .{ .declaration, .flag },
5525 .{ .byte_size, .udata },
5526 .{ .alignment, .udata },
55255527 },
55265528 },
5527 .packed_struct_type = .{
5529 .empty_packed_struct_type = .{
55285530 .tag = .structure_type,
5529 .children = true,
55305531 .attrs = &.{
55315532 .{ .decl_file, .udata },
55325533 .{ .name, .strp },
55335534 .{ .type, .ref_addr },
55345535 },
55355536 },
5536 .empty_packed_struct_type = .{
5537 .packed_struct_type = .{
55375538 .tag = .structure_type,
5539 .children = true,
55385540 .attrs = &.{
55395541 .{ .decl_file, .udata },
55405542 .{ .name, .strp },
55415543 .{ .type, .ref_addr },
55425544 },
55435545 },
5544 .union_type = .{
5546 .empty_union_type = .{
55455547 .tag = .union_type,
5546 .children = true,
55475548 .attrs = &.{
55485549 .{ .decl_file, .udata },
55495550 .{ .name, .strp },
......@@ -5551,8 +5552,9 @@ const AbbrevCode = enum {
55515552 .{ .alignment, .udata },
55525553 },
55535554 },
5554 .empty_union_type = .{
5555 .union_type = .{
55555556 .tag = .union_type,
5557 .children = true,
55565558 .attrs = &.{
55575559 .{ .decl_file, .udata },
55585560 .{ .name, .strp },