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 {...@@ -1980,7 +1980,7 @@ pub const WipNav = struct {
1980 abbrev_code: struct {1980 abbrev_code: struct {
1981 decl: AbbrevCode,1981 decl: AbbrevCode,
1982 generic_decl: AbbrevCode,1982 generic_decl: AbbrevCode,
1983 instance: AbbrevCode,1983 decl_instance: AbbrevCode,
1984 },1984 },
1985 nav: *const InternPool.Nav,1985 nav: *const InternPool.Nav,
1986 file: Zcu.File.Index,1986 file: Zcu.File.Index,
...@@ -2001,8 +2001,8 @@ pub const WipNav = struct {...@@ -2001,8 +2001,8 @@ pub const WipNav = struct {
2001 switch (try dwarf.debug_info.declAbbrevCode(wip_nav.unit, decl_gop.value_ptr.*)) {2001 switch (try dwarf.debug_info.declAbbrevCode(wip_nav.unit, decl_gop.value_ptr.*)) {
2002 else => unreachable,2002 else => unreachable,
2003 .decl_alias,2003 .decl_alias,
2004 .decl_enum,
2005 .decl_empty_enum,2004 .decl_empty_enum,
2005 .decl_enum,
2006 .decl_namespace_struct,2006 .decl_namespace_struct,
2007 .decl_struct,2007 .decl_struct,
2008 .decl_packed_struct,2008 .decl_packed_struct,
...@@ -2012,15 +2012,11 @@ pub const WipNav = struct {...@@ -2012,15 +2012,11 @@ pub const WipNav = struct {
2012 .decl_const_runtime_bits,2012 .decl_const_runtime_bits,
2013 .decl_const_comptime_state,2013 .decl_const_comptime_state,
2014 .decl_const_runtime_bits_comptime_state,2014 .decl_const_runtime_bits_comptime_state,
2015 .decl_func,
2016 .decl_empty_func,2015 .decl_empty_func,
2017 .decl_func_generic,2016 .decl_func,
2018 .decl_empty_func_generic,2017 .decl_empty_func_generic,
2018 .decl_func_generic,
2019 => false,2019 => false,
2020 .generic_decl_alias,
2021 .generic_decl_enum,
2022 .generic_decl_struct,
2023 .generic_decl_union,
2024 .generic_decl_var,2020 .generic_decl_var,
2025 .generic_decl_const,2021 .generic_decl_const,
2026 .generic_decl_func,2022 .generic_decl_func,
...@@ -2054,7 +2050,7 @@ pub const WipNav = struct {...@@ -2054,7 +2050,7 @@ pub const WipNav = struct {
2054 try dwarf.debug_info.section.replaceEntry(wip_nav.unit, generic_decl_entry, dwarf, wip_nav.debug_info.items);2050 try dwarf.debug_info.section.replaceEntry(wip_nav.unit, generic_decl_entry, dwarf, wip_nav.debug_info.items);
2055 wip_nav.debug_info.clearRetainingCapacity();2051 wip_nav.debug_info.clearRetainingCapacity();
2056 wip_nav.entry = orig_entry;2052 wip_nav.entry = orig_entry;
2057 try wip_nav.abbrevCode(abbrev_code.instance);2053 try wip_nav.abbrevCode(abbrev_code.decl_instance);
2058 try wip_nav.refType(parent_type.?);2054 try wip_nav.refType(parent_type.?);
2059 try wip_nav.infoSectionOffset(.debug_info, wip_nav.unit, generic_decl_entry, 0);2055 try wip_nav.infoSectionOffset(.debug_info, wip_nav.unit, generic_decl_entry, 0);
2060 }2056 }
...@@ -2402,7 +2398,7 @@ pub fn initWipNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool.Nav.In...@@ -2402,7 +2398,7 @@ pub fn initWipNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool.Nav.In
2402 try wip_nav.declCommon(.{2398 try wip_nav.declCommon(.{
2403 .decl = .decl_var,2399 .decl = .decl_var,
2404 .generic_decl = .generic_decl_var,2400 .generic_decl = .generic_decl_var,
2405 .instance = .instance_var,2401 .decl_instance = .decl_instance_var,
2406 }, &nav, inst_info.file, &decl);2402 }, &nav, inst_info.file, &decl);
2407 try wip_nav.strp(nav.fqn.toSlice(ip));2403 try wip_nav.strp(nav.fqn.toSlice(ip));
2408 const ty: Type = nav_val.typeOf(zcu);2404 const ty: Type = nav_val.typeOf(zcu);
...@@ -2429,7 +2425,14 @@ pub fn initWipNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool.Nav.In...@@ -2429,7 +2425,14 @@ pub fn initWipNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool.Nav.In
2429 },2425 },
2430 }2426 }
2431 },2427 },
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 {
2433 const func_type = ip.indexToKey(func.ty).func_type;2436 const func_type = ip.indexToKey(func.ty).func_type;
2434 wip_nav.func = nav_val.toIntern();2437 wip_nav.func = nav_val.toIntern();
2435 wip_nav.func_sym_index = sym_index;2438 wip_nav.func_sym_index = sym_index;
...@@ -2479,7 +2482,7 @@ pub fn initWipNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool.Nav.In...@@ -2479,7 +2482,7 @@ pub fn initWipNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool.Nav.In
2479 try wip_nav.declCommon(.{2482 try wip_nav.declCommon(.{
2480 .decl = .decl_func,2483 .decl = .decl_func,
2481 .generic_decl = .generic_decl_func,2484 .generic_decl = .generic_decl_func,
2482 .instance = .instance_func,2485 .decl_instance = .decl_instance_func,
2483 }, &nav, inst_info.file, &decl);2486 }, &nav, inst_info.file, &decl);
2484 try wip_nav.strp(nav.fqn.toSlice(ip));2487 try wip_nav.strp(nav.fqn.toSlice(ip));
2485 try wip_nav.refType(.fromInterned(func_type.return_type));2488 try wip_nav.refType(.fromInterned(func_type.return_type));
...@@ -2599,11 +2602,20 @@ pub fn finishWipNavFunc(...@@ -2599,11 +2602,20 @@ pub fn finishWipNavFunc(
2599 if (wip_nav.any_children) {2602 if (wip_nav.any_children) {
2600 const diw = wip_nav.debug_info.writer(dwarf.gpa);2603 const diw = wip_nav.debug_info.writer(dwarf.gpa);
2601 try uleb128(diw, @intFromEnum(AbbrevCode.null));2604 try uleb128(diw, @intFromEnum(AbbrevCode.null));
2602 } else std.leb.writeUnsignedFixed(2605 } else {
2603 AbbrevCode.decl_bytes,2606 const abbrev_code_buf = wip_nav.debug_info.items[0..AbbrevCode.decl_bytes];
2604 wip_nav.debug_info.items[0..AbbrevCode.decl_bytes],2607 var abbrev_code_fbs = std.io.fixedBufferStream(abbrev_code_buf);
2605 try dwarf.refAbbrevCode(.decl_empty_func),2608 const abbrev_code: AbbrevCode = @enumFromInt(std.leb.readUleb128(@typeInfo(AbbrevCode).@"enum".tag_type, abbrev_code_fbs.reader()) catch unreachable);
2606 );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 }
2607 }2619 }
2608 {2620 {
2609 try dwarf.debug_rnglists.section.getUnit(wip_nav.unit).getEntry(wip_nav.entry).external_relocs.appendSlice(dwarf.gpa, &.{2621 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...@@ -2702,14 +2714,20 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
2702 const nav_gop = try dwarf.navs.getOrPut(dwarf.gpa, nav_index);2714 const nav_gop = try dwarf.navs.getOrPut(dwarf.gpa, nav_index);
2703 errdefer _ = if (!nav_gop.found_existing) dwarf.navs.pop();2715 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())) {
2706 .int_type,2724 .int_type,
2707 .ptr_type,2725 .ptr_type,
2708 .array_type,2726 .array_type,
2709 .vector_type,2727 .vector_type,
2710 .opt_type,2728 .opt_type,
2711 .anyframe_type,
2712 .error_union_type,2729 .error_union_type,
2730 .anyframe_type,
2713 .simple_type,2731 .simple_type,
2714 .tuple_type,2732 .tuple_type,
2715 .func_type,2733 .func_type,
...@@ -2739,12 +2757,12 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool...@@ -2739,12 +2757,12 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
2739 .auto, .@"extern" => {2757 .auto, .@"extern" => {
2740 try wip_nav.declCommon(if (loaded_struct.field_types.len == 0) .{2758 try wip_nav.declCommon(if (loaded_struct.field_types.len == 0) .{
2741 .decl = .decl_namespace_struct,2759 .decl = .decl_namespace_struct,
2742 .generic_decl = .generic_decl_struct,2760 .generic_decl = .generic_decl_const,
2743 .instance = .instance_namespace_struct,2761 .decl_instance = .decl_instance_namespace_struct,
2744 } else .{2762 } else .{
2745 .decl = .decl_struct,2763 .decl = .decl_struct,
2746 .generic_decl = .generic_decl_struct,2764 .generic_decl = .generic_decl_const,
2747 .instance = .instance_struct,2765 .decl_instance = .decl_instance_struct,
2748 }, &nav, inst_info.file, &decl);2766 }, &nav, inst_info.file, &decl);
2749 if (loaded_struct.field_types.len == 0) try diw.writeByte(@intFromBool(false)) else {2767 if (loaded_struct.field_types.len == 0) try diw.writeByte(@intFromBool(false)) else {
2750 try uleb128(diw, nav_val.toType().abiSize(zcu));2768 try uleb128(diw, nav_val.toType().abiSize(zcu));
...@@ -2799,8 +2817,8 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool...@@ -2799,8 +2817,8 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
2799 .@"packed" => {2817 .@"packed" => {
2800 try wip_nav.declCommon(.{2818 try wip_nav.declCommon(.{
2801 .decl = .decl_packed_struct,2819 .decl = .decl_packed_struct,
2802 .generic_decl = .generic_decl_struct,2820 .generic_decl = .generic_decl_const,
2803 .instance = .instance_packed_struct,2821 .decl_instance = .decl_instance_packed_struct,
2804 }, &nav, inst_info.file, &decl);2822 }, &nav, inst_info.file, &decl);
2805 try wip_nav.refType(.fromInterned(loaded_struct.backingIntTypeUnordered(ip)));2823 try wip_nav.refType(.fromInterned(loaded_struct.backingIntTypeUnordered(ip)));
2806 var field_bit_offset: u16 = 0;2824 var field_bit_offset: u16 = 0;
...@@ -2837,12 +2855,12 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool...@@ -2837,12 +2855,12 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
2837 const diw = wip_nav.debug_info.writer(dwarf.gpa);2855 const diw = wip_nav.debug_info.writer(dwarf.gpa);
2838 try wip_nav.declCommon(if (loaded_enum.names.len > 0) .{2856 try wip_nav.declCommon(if (loaded_enum.names.len > 0) .{
2839 .decl = .decl_enum,2857 .decl = .decl_enum,
2840 .generic_decl = .generic_decl_enum,2858 .generic_decl = .generic_decl_const,
2841 .instance = .instance_enum,2859 .decl_instance = .decl_instance_enum,
2842 } else .{2860 } else .{
2843 .decl = .decl_empty_enum,2861 .decl = .decl_empty_enum,
2844 .generic_decl = .generic_decl_enum,2862 .generic_decl = .generic_decl_const,
2845 .instance = .instance_empty_enum,2863 .decl_instance = .decl_instance_empty_enum,
2846 }, &nav, inst_info.file, &decl);2864 }, &nav, inst_info.file, &decl);
2847 try wip_nav.refType(.fromInterned(loaded_enum.tag_ty));2865 try wip_nav.refType(.fromInterned(loaded_enum.tag_ty));
2848 for (0..loaded_enum.names.len) |field_index| {2866 for (0..loaded_enum.names.len) |field_index| {
...@@ -2875,8 +2893,8 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool...@@ -2875,8 +2893,8 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
2875 const diw = wip_nav.debug_info.writer(dwarf.gpa);2893 const diw = wip_nav.debug_info.writer(dwarf.gpa);
2876 try wip_nav.declCommon(.{2894 try wip_nav.declCommon(.{
2877 .decl = .decl_union,2895 .decl = .decl_union,
2878 .generic_decl = .generic_decl_union,2896 .generic_decl = .generic_decl_const,
2879 .instance = .instance_union,2897 .decl_instance = .decl_instance_union,
2880 }, &nav, inst_info.file, &decl);2898 }, &nav, inst_info.file, &decl);
2881 const union_layout = Type.getUnionLayout(loaded_union, zcu);2899 const union_layout = Type.getUnionLayout(loaded_union, zcu);
2882 try uleb128(diw, union_layout.abi_size);2900 try uleb128(diw, union_layout.abi_size);
...@@ -2945,8 +2963,8 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool...@@ -2945,8 +2963,8 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
2945 const diw = wip_nav.debug_info.writer(dwarf.gpa);2963 const diw = wip_nav.debug_info.writer(dwarf.gpa);
2946 try wip_nav.declCommon(.{2964 try wip_nav.declCommon(.{
2947 .decl = .decl_namespace_struct,2965 .decl = .decl_namespace_struct,
2948 .generic_decl = .generic_decl_struct,2966 .generic_decl = .generic_decl_const,
2949 .instance = .instance_namespace_struct,2967 .decl_instance = .decl_instance_namespace_struct,
2950 }, &nav, inst_info.file, &decl);2968 }, &nav, inst_info.file, &decl);
2951 try diw.writeByte(@intFromBool(true));2969 try diw.writeByte(@intFromBool(true));
2952 break :tag .done;2970 break :tag .done;
...@@ -2969,14 +2987,15 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool...@@ -2969,14 +2987,15 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
2969 .variable => .decl_var,2987 .variable => .decl_var,
2970 .@"extern" => unreachable,2988 .@"extern" => unreachable,
2971 .func => |func| tag: {2989 .func => |func| tag: {
2990 if (func.owner_nav != nav_index) break :tag .{ .decl_func_alias = func.owner_nav };
2972 if (nav_gop.found_existing) switch (try dwarf.debug_info.declAbbrevCode(wip_nav.unit, nav_gop.value_ptr.*)) {2991 if (nav_gop.found_existing) switch (try dwarf.debug_info.declAbbrevCode(wip_nav.unit, nav_gop.value_ptr.*)) {
2973 .null => {},2992 .null => {},
2974 else => unreachable,2993 else => unreachable,
2975 .decl_func, .decl_empty_func, .instance_func, .instance_empty_func => return,2994 .decl_empty_func, .decl_func, .decl_instance_empty_func, .decl_instance_func => return,
2976 .decl_func_generic,
2977 .decl_empty_func_generic,2995 .decl_empty_func_generic,
2978 .instance_func_generic,2996 .decl_func_generic,
2979 .instance_empty_func_generic,2997 .decl_instance_empty_func_generic,
2998 .decl_instance_func_generic,
2980 => dwarf.debug_info.section.getUnit(wip_nav.unit).getEntry(nav_gop.value_ptr.*).clear(),2999 => dwarf.debug_info.section.getUnit(wip_nav.unit).getEntry(nav_gop.value_ptr.*).clear(),
2981 } else nav_gop.value_ptr.* = try dwarf.addCommonEntry(wip_nav.unit);3000 } else nav_gop.value_ptr.* = try dwarf.addCommonEntry(wip_nav.unit);
2982 wip_nav.entry = nav_gop.value_ptr.*;3001 wip_nav.entry = nav_gop.value_ptr.*;
...@@ -2986,11 +3005,11 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool...@@ -2986,11 +3005,11 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
2986 try wip_nav.declCommon(if (func_type.param_types.len > 0 or func_type.is_var_args) .{3005 try wip_nav.declCommon(if (func_type.param_types.len > 0 or func_type.is_var_args) .{
2987 .decl = .decl_func_generic,3006 .decl = .decl_func_generic,
2988 .generic_decl = .generic_decl_func,3007 .generic_decl = .generic_decl_func,
2989 .instance = .instance_func_generic,3008 .decl_instance = .decl_instance_func_generic,
2990 } else .{3009 } else .{
2991 .decl = .decl_empty_func_generic,3010 .decl = .decl_empty_func_generic,
2992 .generic_decl = .generic_decl_func,3011 .generic_decl = .generic_decl_func,
2993 .instance = .instance_empty_func_generic,3012 .decl_instance = .decl_instance_empty_func_generic,
2994 }, &nav, inst_info.file, &decl);3013 }, &nav, inst_info.file, &decl);
2995 try wip_nav.refType(.fromInterned(func_type.return_type));3014 try wip_nav.refType(.fromInterned(func_type.return_type));
2996 if (func_type.param_types.len > 0 or func_type.is_var_args) {3015 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...@@ -3018,8 +3037,8 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
3018 .decl_alias => {3037 .decl_alias => {
3019 try wip_nav.declCommon(.{3038 try wip_nav.declCommon(.{
3020 .decl = .decl_alias,3039 .decl = .decl_alias,
3021 .generic_decl = .generic_decl_alias,3040 .generic_decl = .generic_decl_const,
3022 .instance = .instance_alias,3041 .decl_instance = .decl_instance_alias,
3023 }, &nav, inst_info.file, &decl);3042 }, &nav, inst_info.file, &decl);
3024 try wip_nav.refType(nav_val.toType());3043 try wip_nav.refType(nav_val.toType());
3025 },3044 },
...@@ -3028,7 +3047,7 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool...@@ -3028,7 +3047,7 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
3028 try wip_nav.declCommon(.{3047 try wip_nav.declCommon(.{
3029 .decl = .decl_var,3048 .decl = .decl_var,
3030 .generic_decl = .generic_decl_var,3049 .generic_decl = .generic_decl_var,
3031 .instance = .instance_var,3050 .decl_instance = .decl_instance_var,
3032 }, &nav, inst_info.file, &decl);3051 }, &nav, inst_info.file, &decl);
3033 try wip_nav.strp(nav.fqn.toSlice(ip));3052 try wip_nav.strp(nav.fqn.toSlice(ip));
3034 const nav_ty = nav_val.typeOf(zcu);3053 const nav_ty = nav_val.typeOf(zcu);
...@@ -3046,19 +3065,19 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool...@@ -3046,19 +3065,19 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
3046 try wip_nav.declCommon(if (has_runtime_bits and has_comptime_state) .{3065 try wip_nav.declCommon(if (has_runtime_bits and has_comptime_state) .{
3047 .decl = .decl_const_runtime_bits_comptime_state,3066 .decl = .decl_const_runtime_bits_comptime_state,
3048 .generic_decl = .generic_decl_const,3067 .generic_decl = .generic_decl_const,
3049 .instance = .instance_const_runtime_bits_comptime_state,3068 .decl_instance = .decl_instance_const_runtime_bits_comptime_state,
3050 } else if (has_comptime_state) .{3069 } else if (has_comptime_state) .{
3051 .decl = .decl_const_comptime_state,3070 .decl = .decl_const_comptime_state,
3052 .generic_decl = .generic_decl_const,3071 .generic_decl = .generic_decl_const,
3053 .instance = .instance_const_comptime_state,3072 .decl_instance = .decl_instance_const_comptime_state,
3054 } else if (has_runtime_bits) .{3073 } else if (has_runtime_bits) .{
3055 .decl = .decl_const_runtime_bits,3074 .decl = .decl_const_runtime_bits,
3056 .generic_decl = .generic_decl_const,3075 .generic_decl = .generic_decl_const,
3057 .instance = .instance_const_runtime_bits,3076 .decl_instance = .decl_instance_const_runtime_bits,
3058 } else .{3077 } else .{
3059 .decl = .decl_const,3078 .decl = .decl_const,
3060 .generic_decl = .generic_decl_const,3079 .generic_decl = .generic_decl_const,
3061 .instance = .instance_const,3080 .decl_instance = .decl_instance_const,
3062 }, &nav, inst_info.file, &decl);3081 }, &nav, inst_info.file, &decl);
3063 try wip_nav.strp(nav.fqn.toSlice(ip));3082 try wip_nav.strp(nav.fqn.toSlice(ip));
3064 const nav_ty_reloc_index = try wip_nav.refForward();3083 const nav_ty_reloc_index = try wip_nav.refForward();
...@@ -3071,6 +3090,14 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool...@@ -3071,6 +3090,14 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
3071 try wip_nav.abbrevCode(.is_const);3090 try wip_nav.abbrevCode(.is_const);
3072 try wip_nav.refType(nav_ty);3091 try wip_nav.refType(nav_ty);
3073 },3092 },
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 },
3074 }3101 }
3075 try dwarf.debug_info.section.replaceEntry(wip_nav.unit, wip_nav.entry, dwarf, wip_nav.debug_info.items);3102 try dwarf.debug_info.section.replaceEntry(wip_nav.unit, wip_nav.entry, dwarf, wip_nav.debug_info.items);
3076 try wip_nav.updateLazy(nav_src_loc);3103 try wip_nav.updateLazy(nav_src_loc);
...@@ -3442,7 +3469,7 @@ fn updateLazyType(...@@ -3442,7 +3469,7 @@ fn updateLazyType(
3442 },3469 },
3443 .enum_type => {3470 .enum_type => {
3444 const loaded_enum = ip.loadEnumType(type_index);3471 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);
3446 try wip_nav.strp(name);3473 try wip_nav.strp(name);
3447 try wip_nav.refType(.fromInterned(loaded_enum.tag_ty));3474 try wip_nav.refType(.fromInterned(loaded_enum.tag_ty));
3448 for (0..loaded_enum.names.len) |field_index| {3475 for (0..loaded_enum.names.len) |field_index| {
...@@ -3467,7 +3494,7 @@ fn updateLazyType(...@@ -3467,7 +3494,7 @@ fn updateLazyType(
3467 }3494 }
3468 // For better or worse, we try to match what Clang emits.3495 // For better or worse, we try to match what Clang emits.
3469 break :cc switch (func_type.cc) {3496 break :cc switch (func_type.cc) {
3470 .@"inline" => unreachable,3497 .@"inline" => .nocall,
3471 .@"async", .auto, .naked => .normal,3498 .@"async", .auto, .naked => .normal,
3472 .x86_64_sysv => .LLVM_X86_64SysV,3499 .x86_64_sysv => .LLVM_X86_64SysV,
3473 .x86_64_win => .LLVM_Win64,3500 .x86_64_win => .LLVM_Win64,
...@@ -3534,7 +3561,7 @@ fn updateLazyType(...@@ -3534,7 +3561,7 @@ fn updateLazyType(
3534 if (!is_nullary) try uleb128(diw, @intFromEnum(AbbrevCode.null));3561 if (!is_nullary) try uleb128(diw, @intFromEnum(AbbrevCode.null));
3535 },3562 },
3536 .error_set_type => |error_set_type| {3563 .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);
3538 try wip_nav.strp(name);3565 try wip_nav.strp(name);
3539 try wip_nav.refType(.fromInterned(try pt.intern(.{ .int_type = .{3566 try wip_nav.refType(.fromInterned(try pt.intern(.{ .int_type = .{
3540 .signedness = .unsigned,3567 .signedness = .unsigned,
...@@ -4318,7 +4345,7 @@ pub fn flushModule(dwarf: *Dwarf, pt: Zcu.PerThread) FlushError!void {...@@ -4318,7 +4345,7 @@ pub fn flushModule(dwarf: *Dwarf, pt: Zcu.PerThread) FlushError!void {
4318 defer wip_nav.deinit();4345 defer wip_nav.deinit();
4319 const diw = wip_nav.debug_info.writer(dwarf.gpa);4346 const diw = wip_nav.debug_info.writer(dwarf.gpa);
4320 const global_error_set_names = ip.global_error_set.getNamesFromMainThread();4347 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);
4322 try wip_nav.strp("anyerror");4349 try wip_nav.strp("anyerror");
4323 try wip_nav.refType(.fromInterned(try pt.intern(.{ .int_type = .{4350 try wip_nav.refType(.fromInterned(try pt.intern(.{ .int_type = .{
4324 .signedness = .unsigned,4351 .signedness = .unsigned,
...@@ -4707,10 +4734,10 @@ const AbbrevCode = enum {...@@ -4707,10 +4734,10 @@ const AbbrevCode = enum {
4707 // padding codes must be one byte uleb128 values to function4734 // padding codes must be one byte uleb128 values to function
4708 pad_1,4735 pad_1,
4709 pad_n,4736 pad_n,
4710 // (generic) decl codes are assumed to all have the same uleb128 length4737 // decl, generic decl, and instance codes are assumed to all have the same uleb128 length
4711 decl_alias,4738 decl_alias,
4712 decl_enum,
4713 decl_empty_enum,4739 decl_empty_enum,
4740 decl_enum,
4714 decl_namespace_struct,4741 decl_namespace_struct,
4715 decl_struct,4742 decl_struct,
4716 decl_packed_struct,4743 decl_packed_struct,
...@@ -4720,38 +4747,35 @@ const AbbrevCode = enum {...@@ -4720,38 +4747,35 @@ const AbbrevCode = enum {
4720 decl_const_runtime_bits,4747 decl_const_runtime_bits,
4721 decl_const_comptime_state,4748 decl_const_comptime_state,
4722 decl_const_runtime_bits_comptime_state,4749 decl_const_runtime_bits_comptime_state,
4723 decl_func,
4724 decl_empty_func,4750 decl_empty_func,
4725 decl_func_generic,4751 decl_func,
4726 decl_empty_func_generic,4752 decl_empty_func_generic,
4727 generic_decl_alias,4753 decl_func_generic,
4728 generic_decl_enum,
4729 generic_decl_struct,
4730 generic_decl_union,
4731 generic_decl_var,4754 generic_decl_var,
4732 generic_decl_const,4755 generic_decl_const,
4733 generic_decl_func,4756 generic_decl_func,
4734 // the rest are unrestricted4757 decl_instance_alias,
4735 instance_alias,4758 decl_instance_empty_enum,
4736 instance_enum,4759 decl_instance_enum,
4737 instance_empty_enum,4760 decl_instance_namespace_struct,
4738 instance_namespace_struct,4761 decl_instance_struct,
4739 instance_struct,4762 decl_instance_packed_struct,
4740 instance_packed_struct,4763 decl_instance_union,
4741 instance_union,4764 decl_instance_var,
4742 instance_var,4765 decl_instance_const,
4743 instance_const,4766 decl_instance_const_runtime_bits,
4744 instance_const_runtime_bits,4767 decl_instance_const_comptime_state,
4745 instance_const_comptime_state,4768 decl_instance_const_runtime_bits_comptime_state,
4746 instance_const_runtime_bits_comptime_state,4769 decl_instance_empty_func,
4747 instance_func,4770 decl_instance_func,
4748 instance_empty_func,4771 decl_instance_empty_func_generic,
4749 instance_func_generic,4772 decl_instance_func_generic,
4750 instance_empty_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
4751 compile_unit,4775 compile_unit,
4752 module,4776 module,
4753 file,
4754 empty_file,4777 empty_file,
4778 file,
4755 signed_enum_field,4779 signed_enum_field,
4756 unsigned_enum_field,4780 unsigned_enum_field,
4757 big_enum_field,4781 big_enum_field,
...@@ -4784,19 +4808,19 @@ const AbbrevCode = enum {...@@ -4784,19 +4808,19 @@ const AbbrevCode = enum {
4784 func_type,4808 func_type,
4785 func_type_param,4809 func_type_param,
4786 is_var_args,4810 is_var_args,
4787 generated_enum_type,
4788 generated_empty_enum_type,4811 generated_empty_enum_type,
4789 generated_struct_type,4812 generated_enum_type,
4790 generated_empty_struct_type,4813 generated_empty_struct_type,
4814 generated_struct_type,
4791 generated_union_type,4815 generated_union_type,
4792 enum_type,
4793 empty_enum_type,4816 empty_enum_type,
4794 struct_type,4817 enum_type,
4795 empty_struct_type,4818 empty_struct_type,
4796 packed_struct_type,4819 struct_type,
4797 empty_packed_struct_type,4820 empty_packed_struct_type,
4798 union_type,4821 packed_struct_type,
4799 empty_union_type,4822 empty_union_type,
4823 union_type,
4800 empty_block,4824 empty_block,
4801 block,4825 block,
4802 empty_inlined_func,4826 empty_inlined_func,
...@@ -4818,7 +4842,12 @@ const AbbrevCode = enum {...@@ -4818,7 +4842,12 @@ const AbbrevCode = enum {
4818 comptime_value_elem_runtime_bits,4842 comptime_value_elem_runtime_bits,
4819 comptime_value_elem_comptime_state,4843 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
4823 const Attr = struct {4852 const Attr = struct {
4824 DeclValEnum(DW.AT),4853 DeclValEnum(DW.AT),
...@@ -4831,7 +4860,10 @@ const AbbrevCode = enum {...@@ -4831,7 +4860,10 @@ const AbbrevCode = enum {
4831 .{ .accessibility, .data1 },4860 .{ .accessibility, .data1 },
4832 .{ .name, .strp },4861 .{ .name, .strp },
4833 };4862 };
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{
4835 .{ .ZIG_parent, .ref_addr },4867 .{ .ZIG_parent, .ref_addr },
4836 .{ .abstract_origin, .ref_addr },4868 .{ .abstract_origin, .ref_addr },
4837 };4869 };
...@@ -4855,15 +4887,15 @@ const AbbrevCode = enum {...@@ -4855,15 +4887,15 @@ const AbbrevCode = enum {
4855 .{ .import, .ref_addr },4887 .{ .import, .ref_addr },
4856 },4888 },
4857 },4889 },
4858 .decl_enum = .{4890 .decl_empty_enum = .{
4859 .tag = .enumeration_type,4891 .tag = .enumeration_type,
4860 .children = true,
4861 .attrs = decl_abbrev_common_attrs ++ .{4892 .attrs = decl_abbrev_common_attrs ++ .{
4862 .{ .type, .ref_addr },4893 .{ .type, .ref_addr },
4863 },4894 },
4864 },4895 },
4865 .decl_empty_enum = .{4896 .decl_enum = .{
4866 .tag = .enumeration_type,4897 .tag = .enumeration_type,
4898 .children = true,
4867 .attrs = decl_abbrev_common_attrs ++ .{4899 .attrs = decl_abbrev_common_attrs ++ .{
4868 .{ .type, .ref_addr },4900 .{ .type, .ref_addr },
4869 },4901 },
...@@ -4947,9 +4979,8 @@ const AbbrevCode = enum {...@@ -4947,9 +4979,8 @@ const AbbrevCode = enum {
4947 .{ .ZIG_comptime_value, .ref_addr },4979 .{ .ZIG_comptime_value, .ref_addr },
4948 },4980 },
4949 },4981 },
4950 .decl_func = .{4982 .decl_empty_func = .{
4951 .tag = .subprogram,4983 .tag = .subprogram,
4952 .children = true,
4953 .attrs = decl_abbrev_common_attrs ++ .{4984 .attrs = decl_abbrev_common_attrs ++ .{
4954 .{ .linkage_name, .strp },4985 .{ .linkage_name, .strp },
4955 .{ .type, .ref_addr },4986 .{ .type, .ref_addr },
...@@ -4960,8 +4991,9 @@ const AbbrevCode = enum {...@@ -4960,8 +4991,9 @@ const AbbrevCode = enum {
4960 .{ .noreturn, .flag },4991 .{ .noreturn, .flag },
4961 },4992 },
4962 },4993 },
4963 .decl_empty_func = .{4994 .decl_func = .{
4964 .tag = .subprogram,4995 .tag = .subprogram,
4996 .children = true,
4965 .attrs = decl_abbrev_common_attrs ++ .{4997 .attrs = decl_abbrev_common_attrs ++ .{
4966 .{ .linkage_name, .strp },4998 .{ .linkage_name, .strp },
4967 .{ .type, .ref_addr },4999 .{ .type, .ref_addr },
...@@ -4972,112 +5004,82 @@ const AbbrevCode = enum {...@@ -4972,112 +5004,82 @@ const AbbrevCode = enum {
4972 .{ .noreturn, .flag },5004 .{ .noreturn, .flag },
4973 },5005 },
4974 },5006 },
4975 .decl_func_generic = .{5007 .decl_empty_func_generic = .{
4976 .tag = .subprogram,5008 .tag = .subprogram,
4977 .children = true,
4978 .attrs = decl_abbrev_common_attrs ++ .{5009 .attrs = decl_abbrev_common_attrs ++ .{
4979 .{ .type, .ref_addr },5010 .{ .type, .ref_addr },
4980 },5011 },
4981 },5012 },
4982 .decl_empty_func_generic = .{5013 .decl_func_generic = .{
4983 .tag = .subprogram,5014 .tag = .subprogram,
5015 .children = true,
4984 .attrs = decl_abbrev_common_attrs ++ .{5016 .attrs = decl_abbrev_common_attrs ++ .{
4985 .{ .type, .ref_addr },5017 .{ .type, .ref_addr },
4986 },5018 },
4987 },5019 },
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 },
5012 .generic_decl_var = .{5020 .generic_decl_var = .{
5013 .tag = .variable,5021 .tag = .variable,
5014 .attrs = decl_abbrev_common_attrs ++ .{5022 .attrs = generic_decl_abbrev_common_attrs,
5015 .{ .declaration, .flag_present },
5016 },
5017 },5023 },
5018 .generic_decl_const = .{5024 .generic_decl_const = .{
5019 .tag = .constant,5025 .tag = .constant,
5020 .attrs = decl_abbrev_common_attrs ++ .{5026 .attrs = generic_decl_abbrev_common_attrs,
5021 .{ .declaration, .flag_present },
5022 },
5023 },5027 },
5024 .generic_decl_func = .{5028 .generic_decl_func = .{
5025 .tag = .subprogram,5029 .tag = .subprogram,
5026 .attrs = decl_abbrev_common_attrs ++ .{5030 .attrs = generic_decl_abbrev_common_attrs,
5027 .{ .declaration, .flag_present },
5028 },
5029 },5031 },
5030 .instance_alias = .{5032 .decl_instance_alias = .{
5031 .tag = .imported_declaration,5033 .tag = .imported_declaration,
5032 .attrs = instance_abbrev_common_attrs ++ .{5034 .attrs = decl_instance_abbrev_common_attrs ++ .{
5033 .{ .import, .ref_addr },5035 .{ .import, .ref_addr },
5034 },5036 },
5035 },5037 },
5036 .instance_enum = .{5038 .decl_instance_empty_enum = .{
5037 .tag = .enumeration_type,5039 .tag = .enumeration_type,
5038 .children = true,5040 .attrs = decl_instance_abbrev_common_attrs ++ .{
5039 .attrs = instance_abbrev_common_attrs ++ .{
5040 .{ .type, .ref_addr },5041 .{ .type, .ref_addr },
5041 },5042 },
5042 },5043 },
5043 .instance_empty_enum = .{5044 .decl_instance_enum = .{
5044 .tag = .enumeration_type,5045 .tag = .enumeration_type,
5045 .attrs = instance_abbrev_common_attrs ++ .{5046 .children = true,
5047 .attrs = decl_instance_abbrev_common_attrs ++ .{
5046 .{ .type, .ref_addr },5048 .{ .type, .ref_addr },
5047 },5049 },
5048 },5050 },
5049 .instance_namespace_struct = .{5051 .decl_instance_namespace_struct = .{
5050 .tag = .structure_type,5052 .tag = .structure_type,
5051 .attrs = instance_abbrev_common_attrs ++ .{5053 .attrs = decl_instance_abbrev_common_attrs ++ .{
5052 .{ .declaration, .flag },5054 .{ .declaration, .flag },
5053 },5055 },
5054 },5056 },
5055 .instance_struct = .{5057 .decl_instance_struct = .{
5056 .tag = .structure_type,5058 .tag = .structure_type,
5057 .children = true,5059 .children = true,
5058 .attrs = instance_abbrev_common_attrs ++ .{5060 .attrs = decl_instance_abbrev_common_attrs ++ .{
5059 .{ .byte_size, .udata },5061 .{ .byte_size, .udata },
5060 .{ .alignment, .udata },5062 .{ .alignment, .udata },
5061 },5063 },
5062 },5064 },
5063 .instance_packed_struct = .{5065 .decl_instance_packed_struct = .{
5064 .tag = .structure_type,5066 .tag = .structure_type,
5065 .children = true,5067 .children = true,
5066 .attrs = instance_abbrev_common_attrs ++ .{5068 .attrs = decl_instance_abbrev_common_attrs ++ .{
5067 .{ .type, .ref_addr },5069 .{ .type, .ref_addr },
5068 },5070 },
5069 },5071 },
5070 .instance_union = .{5072 .decl_instance_union = .{
5071 .tag = .union_type,5073 .tag = .union_type,
5072 .children = true,5074 .children = true,
5073 .attrs = instance_abbrev_common_attrs ++ .{5075 .attrs = decl_instance_abbrev_common_attrs ++ .{
5074 .{ .byte_size, .udata },5076 .{ .byte_size, .udata },
5075 .{ .alignment, .udata },5077 .{ .alignment, .udata },
5076 },5078 },
5077 },5079 },
5078 .instance_var = .{5080 .decl_instance_var = .{
5079 .tag = .variable,5081 .tag = .variable,
5080 .attrs = instance_abbrev_common_attrs ++ .{5082 .attrs = decl_instance_abbrev_common_attrs ++ .{
5081 .{ .linkage_name, .strp },5083 .{ .linkage_name, .strp },
5082 .{ .type, .ref_addr },5084 .{ .type, .ref_addr },
5083 .{ .location, .exprloc },5085 .{ .location, .exprloc },
...@@ -5085,18 +5087,18 @@ const AbbrevCode = enum {...@@ -5085,18 +5087,18 @@ const AbbrevCode = enum {
5085 .{ .external, .flag },5087 .{ .external, .flag },
5086 },5088 },
5087 },5089 },
5088 .instance_const = .{5090 .decl_instance_const = .{
5089 .tag = .constant,5091 .tag = .constant,
5090 .attrs = instance_abbrev_common_attrs ++ .{5092 .attrs = decl_instance_abbrev_common_attrs ++ .{
5091 .{ .linkage_name, .strp },5093 .{ .linkage_name, .strp },
5092 .{ .type, .ref_addr },5094 .{ .type, .ref_addr },
5093 .{ .alignment, .udata },5095 .{ .alignment, .udata },
5094 .{ .external, .flag },5096 .{ .external, .flag },
5095 },5097 },
5096 },5098 },
5097 .instance_const_runtime_bits = .{5099 .decl_instance_const_runtime_bits = .{
5098 .tag = .constant,5100 .tag = .constant,
5099 .attrs = instance_abbrev_common_attrs ++ .{5101 .attrs = decl_instance_abbrev_common_attrs ++ .{
5100 .{ .linkage_name, .strp },5102 .{ .linkage_name, .strp },
5101 .{ .type, .ref_addr },5103 .{ .type, .ref_addr },
5102 .{ .alignment, .udata },5104 .{ .alignment, .udata },
...@@ -5104,9 +5106,9 @@ const AbbrevCode = enum {...@@ -5104,9 +5106,9 @@ const AbbrevCode = enum {
5104 .{ .const_value, .block },5106 .{ .const_value, .block },
5105 },5107 },
5106 },5108 },
5107 .instance_const_comptime_state = .{5109 .decl_instance_const_comptime_state = .{
5108 .tag = .constant,5110 .tag = .constant,
5109 .attrs = instance_abbrev_common_attrs ++ .{5111 .attrs = decl_instance_abbrev_common_attrs ++ .{
5110 .{ .linkage_name, .strp },5112 .{ .linkage_name, .strp },
5111 .{ .type, .ref_addr },5113 .{ .type, .ref_addr },
5112 .{ .alignment, .udata },5114 .{ .alignment, .udata },
...@@ -5114,9 +5116,9 @@ const AbbrevCode = enum {...@@ -5114,9 +5116,9 @@ const AbbrevCode = enum {
5114 .{ .ZIG_comptime_value, .ref_addr },5116 .{ .ZIG_comptime_value, .ref_addr },
5115 },5117 },
5116 },5118 },
5117 .instance_const_runtime_bits_comptime_state = .{5119 .decl_instance_const_runtime_bits_comptime_state = .{
5118 .tag = .constant,5120 .tag = .constant,
5119 .attrs = instance_abbrev_common_attrs ++ .{5121 .attrs = decl_instance_abbrev_common_attrs ++ .{
5120 .{ .linkage_name, .strp },5122 .{ .linkage_name, .strp },
5121 .{ .type, .ref_addr },5123 .{ .type, .ref_addr },
5122 .{ .alignment, .udata },5124 .{ .alignment, .udata },
...@@ -5125,10 +5127,9 @@ const AbbrevCode = enum {...@@ -5125,10 +5127,9 @@ const AbbrevCode = enum {
5125 .{ .ZIG_comptime_value, .ref_addr },5127 .{ .ZIG_comptime_value, .ref_addr },
5126 },5128 },
5127 },5129 },
5128 .instance_func = .{5130 .decl_instance_empty_func = .{
5129 .tag = .subprogram,5131 .tag = .subprogram,
5130 .children = true,5132 .attrs = decl_instance_abbrev_common_attrs ++ .{
5131 .attrs = instance_abbrev_common_attrs ++ .{
5132 .{ .linkage_name, .strp },5133 .{ .linkage_name, .strp },
5133 .{ .type, .ref_addr },5134 .{ .type, .ref_addr },
5134 .{ .low_pc, .addr },5135 .{ .low_pc, .addr },
...@@ -5138,9 +5139,10 @@ const AbbrevCode = enum {...@@ -5138,9 +5139,10 @@ const AbbrevCode = enum {
5138 .{ .noreturn, .flag },5139 .{ .noreturn, .flag },
5139 },5140 },
5140 },5141 },
5141 .instance_empty_func = .{5142 .decl_instance_func = .{
5142 .tag = .subprogram,5143 .tag = .subprogram,
5143 .attrs = instance_abbrev_common_attrs ++ .{5144 .children = true,
5145 .attrs = decl_instance_abbrev_common_attrs ++ .{
5144 .{ .linkage_name, .strp },5146 .{ .linkage_name, .strp },
5145 .{ .type, .ref_addr },5147 .{ .type, .ref_addr },
5146 .{ .low_pc, .addr },5148 .{ .low_pc, .addr },
...@@ -5150,16 +5152,16 @@ const AbbrevCode = enum {...@@ -5150,16 +5152,16 @@ const AbbrevCode = enum {
5150 .{ .noreturn, .flag },5152 .{ .noreturn, .flag },
5151 },5153 },
5152 },5154 },
5153 .instance_func_generic = .{5155 .decl_instance_empty_func_generic = .{
5154 .tag = .subprogram,5156 .tag = .subprogram,
5155 .children = true,5157 .attrs = decl_instance_abbrev_common_attrs ++ .{
5156 .attrs = instance_abbrev_common_attrs ++ .{
5157 .{ .type, .ref_addr },5158 .{ .type, .ref_addr },
5158 },5159 },
5159 },5160 },
5160 .instance_empty_func_generic = .{5161 .decl_instance_func_generic = .{
5161 .tag = .subprogram,5162 .tag = .subprogram,
5162 .attrs = instance_abbrev_common_attrs ++ .{5163 .children = true,
5164 .attrs = decl_instance_abbrev_common_attrs ++ .{
5163 .{ .type, .ref_addr },5165 .{ .type, .ref_addr },
5164 },5166 },
5165 },5167 },
...@@ -5185,21 +5187,21 @@ const AbbrevCode = enum {...@@ -5185,21 +5187,21 @@ const AbbrevCode = enum {
5185 .{ .ranges, .rnglistx },5187 .{ .ranges, .rnglistx },
5186 },5188 },
5187 },5189 },
5188 .file = .{5190 .empty_file = .{
5189 .tag = .structure_type,5191 .tag = .structure_type,
5190 .children = true,
5191 .attrs = &.{5192 .attrs = &.{
5192 .{ .decl_file, .udata },5193 .{ .decl_file, .udata },
5193 .{ .name, .strp },5194 .{ .name, .strp },
5194 .{ .byte_size, .udata },
5195 .{ .alignment, .udata },
5196 },5195 },
5197 },5196 },
5198 .empty_file = .{5197 .file = .{
5199 .tag = .structure_type,5198 .tag = .structure_type,
5199 .children = true,
5200 .attrs = &.{5200 .attrs = &.{
5201 .{ .decl_file, .udata },5201 .{ .decl_file, .udata },
5202 .{ .name, .strp },5202 .{ .name, .strp },
5203 .{ .byte_size, .udata },
5204 .{ .alignment, .udata },
5203 },5205 },
5204 },5206 },
5205 .signed_enum_field = .{5207 .signed_enum_field = .{
...@@ -5449,35 +5451,35 @@ const AbbrevCode = enum {...@@ -5449,35 +5451,35 @@ const AbbrevCode = enum {
5449 .is_var_args = .{5451 .is_var_args = .{
5450 .tag = .unspecified_parameters,5452 .tag = .unspecified_parameters,
5451 },5453 },
5452 .generated_enum_type = .{5454 .generated_empty_enum_type = .{
5453 .tag = .enumeration_type,5455 .tag = .enumeration_type,
5454 .children = true,
5455 .attrs = &.{5456 .attrs = &.{
5456 .{ .name, .strp },5457 .{ .name, .strp },
5457 .{ .type, .ref_addr },5458 .{ .type, .ref_addr },
5458 },5459 },
5459 },5460 },
5460 .generated_empty_enum_type = .{5461 .generated_enum_type = .{
5461 .tag = .enumeration_type,5462 .tag = .enumeration_type,
5463 .children = true,
5462 .attrs = &.{5464 .attrs = &.{
5463 .{ .name, .strp },5465 .{ .name, .strp },
5464 .{ .type, .ref_addr },5466 .{ .type, .ref_addr },
5465 },5467 },
5466 },5468 },
5467 .generated_struct_type = .{5469 .generated_empty_struct_type = .{
5468 .tag = .structure_type,5470 .tag = .structure_type,
5469 .children = true,
5470 .attrs = &.{5471 .attrs = &.{
5471 .{ .name, .strp },5472 .{ .name, .strp },
5472 .{ .byte_size, .udata },5473 .{ .declaration, .flag },
5473 .{ .alignment, .udata },
5474 },5474 },
5475 },5475 },
5476 .generated_empty_struct_type = .{5476 .generated_struct_type = .{
5477 .tag = .structure_type,5477 .tag = .structure_type,
5478 .children = true,
5478 .attrs = &.{5479 .attrs = &.{
5479 .{ .name, .strp },5480 .{ .name, .strp },
5480 .{ .declaration, .flag },5481 .{ .byte_size, .udata },
5482 .{ .alignment, .udata },
5481 },5483 },
5482 },5484 },
5483 .generated_union_type = .{5485 .generated_union_type = .{
...@@ -5489,61 +5491,60 @@ const AbbrevCode = enum {...@@ -5489,61 +5491,60 @@ const AbbrevCode = enum {
5489 .{ .alignment, .udata },5491 .{ .alignment, .udata },
5490 },5492 },
5491 },5493 },
5492 .enum_type = .{5494 .empty_enum_type = .{
5493 .tag = .enumeration_type,5495 .tag = .enumeration_type,
5494 .children = true,
5495 .attrs = &.{5496 .attrs = &.{
5496 .{ .decl_file, .udata },5497 .{ .decl_file, .udata },
5497 .{ .name, .strp },5498 .{ .name, .strp },
5498 .{ .type, .ref_addr },5499 .{ .type, .ref_addr },
5499 },5500 },
5500 },5501 },
5501 .empty_enum_type = .{5502 .enum_type = .{
5502 .tag = .enumeration_type,5503 .tag = .enumeration_type,
5504 .children = true,
5503 .attrs = &.{5505 .attrs = &.{
5504 .{ .decl_file, .udata },5506 .{ .decl_file, .udata },
5505 .{ .name, .strp },5507 .{ .name, .strp },
5506 .{ .type, .ref_addr },5508 .{ .type, .ref_addr },
5507 },5509 },
5508 },5510 },
5509 .struct_type = .{5511 .empty_struct_type = .{
5510 .tag = .structure_type,5512 .tag = .structure_type,
5511 .children = true,
5512 .attrs = &.{5513 .attrs = &.{
5513 .{ .decl_file, .udata },5514 .{ .decl_file, .udata },
5514 .{ .name, .strp },5515 .{ .name, .strp },
5515 .{ .byte_size, .udata },5516 .{ .declaration, .flag },
5516 .{ .alignment, .udata },
5517 },5517 },
5518 },5518 },
5519 .empty_struct_type = .{5519 .struct_type = .{
5520 .tag = .structure_type,5520 .tag = .structure_type,
5521 .children = true,
5521 .attrs = &.{5522 .attrs = &.{
5522 .{ .decl_file, .udata },5523 .{ .decl_file, .udata },
5523 .{ .name, .strp },5524 .{ .name, .strp },
5524 .{ .declaration, .flag },5525 .{ .byte_size, .udata },
5526 .{ .alignment, .udata },
5525 },5527 },
5526 },5528 },
5527 .packed_struct_type = .{5529 .empty_packed_struct_type = .{
5528 .tag = .structure_type,5530 .tag = .structure_type,
5529 .children = true,
5530 .attrs = &.{5531 .attrs = &.{
5531 .{ .decl_file, .udata },5532 .{ .decl_file, .udata },
5532 .{ .name, .strp },5533 .{ .name, .strp },
5533 .{ .type, .ref_addr },5534 .{ .type, .ref_addr },
5534 },5535 },
5535 },5536 },
5536 .empty_packed_struct_type = .{5537 .packed_struct_type = .{
5537 .tag = .structure_type,5538 .tag = .structure_type,
5539 .children = true,
5538 .attrs = &.{5540 .attrs = &.{
5539 .{ .decl_file, .udata },5541 .{ .decl_file, .udata },
5540 .{ .name, .strp },5542 .{ .name, .strp },
5541 .{ .type, .ref_addr },5543 .{ .type, .ref_addr },
5542 },5544 },
5543 },5545 },
5544 .union_type = .{5546 .empty_union_type = .{
5545 .tag = .union_type,5547 .tag = .union_type,
5546 .children = true,
5547 .attrs = &.{5548 .attrs = &.{
5548 .{ .decl_file, .udata },5549 .{ .decl_file, .udata },
5549 .{ .name, .strp },5550 .{ .name, .strp },
...@@ -5551,8 +5552,9 @@ const AbbrevCode = enum {...@@ -5551,8 +5552,9 @@ const AbbrevCode = enum {
5551 .{ .alignment, .udata },5552 .{ .alignment, .udata },
5552 },5553 },
5553 },5554 },
5554 .empty_union_type = .{5555 .union_type = .{
5555 .tag = .union_type,5556 .tag = .union_type,
5557 .children = true,
5556 .attrs = &.{5558 .attrs = &.{
5557 .{ .decl_file, .udata },5559 .{ .decl_file, .udata },
5558 .{ .name, .strp },5560 .{ .name, .strp },