| ... | ... | @@ -1395,8 +1395,7 @@ pub fn getConst(dwarf: *Dwarf, pt: Zcu.PerThread, val: Value) link.Error!link.Co |
| 1395 | 1395 | |
| 1396 | 1396 | pub fn getGlobal(dwarf: *Dwarf, nav: InternPool.Nav.Index) link.Error!Global.Index { |
| 1397 | 1397 | const comp = dwarf.lf.comp; |
| 1398 | | const gpa = comp.gpa; |
| 1399 | | const global_gop = try dwarf.globals.getOrPut(gpa, nav); |
| 1398 | const global_gop = try dwarf.globals.getOrPut(comp.gpa, nav); |
| 1400 | 1399 | if (!global_gop.found_existing) global_gop.value_ptr.* = .{ |
| 1401 | 1400 | .debug_info_ni = .none, |
| 1402 | 1401 | }; |
| ... | ... | @@ -1405,15 +1404,15 @@ pub fn getGlobal(dwarf: *Dwarf, nav: InternPool.Nav.Index) link.Error!Global.Ind |
| 1405 | 1404 | const mod = comp.zcu.?.navFileScope(nav).mod.?; |
| 1406 | 1405 | assert(!mod.strip); |
| 1407 | 1406 | if (dwarf.lf.cast(.elf2)) |elf| { |
| 1408 | | try elf.nodes.ensureUnusedCapacity(gpa, 1); |
| 1409 | | try elf.dwarf_globals.append(gpa, .{ |
| 1407 | try elf.nodes.ensureUnusedCapacity(comp.gpa, 1); |
| 1408 | try elf.dwarf_globals.append(comp.gpa, .{ |
| 1410 | 1409 | .debug_info_first_target_reloc = .none, |
| 1411 | 1410 | .debug_info_first_node_reloc = .none, |
| 1412 | 1411 | .debug_info_first_symbol_reloc = .none, |
| 1413 | 1412 | }); |
| 1414 | 1413 | const unit = dwarf.getUnit(mod).get(dwarf); |
| 1415 | 1414 | global_gop.value_ptr.debug_info_ni = .wrap(elf.addNodeAssumeCapacity( |
| 1416 | | unit.debug_info_ni.unwrap().?.addFloatingChild(gpa, &elf.mf, .{ |
| 1415 | unit.debug_info_ni.unwrap().?.addFloatingChild(comp.gpa, &elf.mf, .{ |
| 1417 | 1416 | .enable_next_moved = true, |
| 1418 | 1417 | }) catch |err| switch (err) { |
| 1419 | 1418 | else => |e| return e, |
| ... | ... | @@ -1983,7 +1982,7 @@ pub fn updateComptimeGlobal( |
| 1983 | 1982 | .unnamed_test, .@"test", .decltest => return, |
| 1984 | 1983 | .@"comptime", .@"const", .@"var" => {}, |
| 1985 | 1984 | } |
| 1986 | | done: switch (ip.indexToKey(nav_val.toIntern())) { |
| 1985 | switch (ip.indexToKey(nav_val.toIntern())) { |
| 1987 | 1986 | .int_type, |
| 1988 | 1987 | .ptr_type, |
| 1989 | 1988 | .array_type, |
| ... | ... | @@ -1997,35 +1996,6 @@ pub fn updateComptimeGlobal( |
| 1997 | 1996 | .error_set_type, |
| 1998 | 1997 | .inferred_error_set_type, |
| 1999 | 1998 | .spirv_type, |
| 2000 | | => try dwarf.genDeclType(pt, global, &decl), |
| 2001 | | .struct_type => { |
| 2002 | | const loaded_struct = ip.loadStructType(nav_val.toIntern()); |
| 2003 | | if (global.toOptional() == loaded_struct.name_nav) |
| 2004 | | _ = try dwarf.const_pool.get(pt, dwarf.constPoolUser(), nav_val.toIntern()) |
| 2005 | | else |
| 2006 | | try dwarf.genDeclType(pt, global, &decl); |
| 2007 | | }, |
| 2008 | | .enum_type => { |
| 2009 | | const loaded_enum = ip.loadEnumType(nav_val.toIntern()); |
| 2010 | | if (global.toOptional() == loaded_enum.name_nav) |
| 2011 | | _ = try dwarf.const_pool.get(pt, dwarf.constPoolUser(), nav_val.toIntern()) |
| 2012 | | else |
| 2013 | | try dwarf.genDeclType(pt, global, &decl); |
| 2014 | | }, |
| 2015 | | .union_type => { |
| 2016 | | const loaded_union = ip.loadUnionType(nav_val.toIntern()); |
| 2017 | | if (global.toOptional() == loaded_union.name_nav) |
| 2018 | | _ = try dwarf.const_pool.get(pt, dwarf.constPoolUser(), nav_val.toIntern()) |
| 2019 | | else |
| 2020 | | try dwarf.genDeclType(pt, global, &decl); |
| 2021 | | }, |
| 2022 | | .opaque_type => { |
| 2023 | | const loaded_opaque = ip.loadOpaqueType(nav_val.toIntern()); |
| 2024 | | if (global.toOptional() == loaded_opaque.name_nav) |
| 2025 | | _ = try dwarf.const_pool.get(pt, dwarf.constPoolUser(), nav_val.toIntern()) |
| 2026 | | else |
| 2027 | | try dwarf.genDeclType(pt, global, &decl); |
| 2028 | | }, |
| 2029 | 1999 | .undef, |
| 2030 | 2000 | .simple_value, |
| 2031 | 2001 | .int, |
| ... | ... | @@ -2040,18 +2010,39 @@ pub fn updateComptimeGlobal( |
| 2040 | 2010 | .aggregate, |
| 2041 | 2011 | .un, |
| 2042 | 2012 | .bitpack, |
| 2043 | | => try dwarf.genDeclGlobal(pt, global, &decl), |
| 2013 | => try dwarf.genGlobal(pt, global, &decl), |
| 2014 | .struct_type => { |
| 2015 | const loaded_struct = ip.loadStructType(nav_val.toIntern()); |
| 2016 | if (global.toOptional() == loaded_struct.name_nav) { |
| 2017 | _ = try dwarf.const_pool.get(pt, dwarf.constPoolUser(), nav_val.toIntern()); |
| 2018 | } else try dwarf.genGlobal(pt, global, &decl); |
| 2019 | }, |
| 2020 | .enum_type => { |
| 2021 | const loaded_enum = ip.loadEnumType(nav_val.toIntern()); |
| 2022 | if (global.toOptional() == loaded_enum.name_nav) { |
| 2023 | _ = try dwarf.const_pool.get(pt, dwarf.constPoolUser(), nav_val.toIntern()); |
| 2024 | } else try dwarf.genGlobal(pt, global, &decl); |
| 2025 | }, |
| 2026 | .union_type => { |
| 2027 | const loaded_union = ip.loadUnionType(nav_val.toIntern()); |
| 2028 | if (global.toOptional() == loaded_union.name_nav) { |
| 2029 | _ = try dwarf.const_pool.get(pt, dwarf.constPoolUser(), nav_val.toIntern()); |
| 2030 | } else try dwarf.genGlobal(pt, global, &decl); |
| 2031 | }, |
| 2032 | .opaque_type => { |
| 2033 | const loaded_opaque = ip.loadOpaqueType(nav_val.toIntern()); |
| 2034 | if (global.toOptional() == loaded_opaque.name_nav) { |
| 2035 | _ = try dwarf.const_pool.get(pt, dwarf.constPoolUser(), nav_val.toIntern()); |
| 2036 | } else try dwarf.genGlobal(pt, global, &decl); |
| 2037 | }, |
| 2044 | 2038 | .@"extern" => unreachable, |
| 2045 | 2039 | .func => |func| if (func.owner_nav == global and func.generic_owner == .none) { |
| 2046 | 2040 | _ = try dwarf.const_pool.get(pt, dwarf.constPoolUser(), nav_val.toIntern()); |
| 2047 | | break :done; |
| 2048 | 2041 | } else return, |
| 2049 | | // memoization, not values |
| 2050 | | .memoized_call => unreachable, |
| 2042 | .memoized_call => unreachable, // not a value |
| 2051 | 2043 | } |
| 2052 | 2044 | } |
| 2053 | | |
| 2054 | | fn genDeclType( |
| 2045 | fn genGlobal( |
| 2055 | 2046 | dwarf: *Dwarf, |
| 2056 | 2047 | pt: Zcu.PerThread, |
| 2057 | 2048 | global: InternPool.Nav.Index, |
| ... | ... | @@ -2065,12 +2056,12 @@ fn genDeclType( |
| 2065 | 2056 | elf.resetNodeRelocs(debug_info_ni); |
| 2066 | 2057 | } else unreachable; |
| 2067 | 2058 | defer di_nw.deinit(); |
| 2068 | | dwarf.genDeclTypeInner(pt, &di_nw, global, decl) catch |err| switch (err) { |
| 2059 | dwarf.genGlobalInner(pt, &di_nw, global, decl) catch |err| switch (err) { |
| 2069 | 2060 | error.WriteFailed => return dwarf.reportWriteError(&di_nw), |
| 2070 | 2061 | else => |e| return e, |
| 2071 | 2062 | }; |
| 2072 | 2063 | } |
| 2073 | | fn genDeclTypeInner( |
| 2064 | fn genGlobalInner( |
| 2074 | 2065 | dwarf: *Dwarf, |
| 2075 | 2066 | pt: Zcu.PerThread, |
| 2076 | 2067 | di_nw: *link.MappedFile.Node.Writer, |
| ... | ... | @@ -2080,94 +2071,70 @@ fn genDeclTypeInner( |
| 2080 | 2071 | const zcu = pt.zcu; |
| 2081 | 2072 | const ip = &zcu.intern_pool; |
| 2082 | 2073 | const nav = ip.getNav(global); |
| 2074 | const nav_const, const nav_ty: Type, const nav_align, const nav_val: Value = nav_resolved: { |
| 2075 | const nav_resolved = nav.resolved.?; |
| 2076 | break :nav_resolved .{ |
| 2077 | nav_resolved.@"const", |
| 2078 | .fromInterned(nav_resolved.type), |
| 2079 | nav_resolved.@"align", |
| 2080 | .fromInterned(nav_resolved.value), |
| 2081 | }; |
| 2082 | }; |
| 2083 | const nav_class = nav_ty.classify(zcu); |
| 2083 | 2084 | const parent_ty = ip.namespacePtr(nav.analysis.?.namespace).owner_type; |
| 2084 | 2085 | const di_w = &di_nw.interface; |
| 2085 | 2086 | if (Type.fromInterned(parent_ty).getCaptures(zcu).len > 0) { |
| 2086 | | try dwarf.abbrevCode(di_nw, .decl_instance_type); |
| 2087 | try dwarf.abbrevCode(di_nw, switch (nav_ty.toIntern()) { |
| 2088 | .type_type => .decl_instance_type, |
| 2089 | else => if (nav_const) switch (nav_class) { |
| 2090 | .no_possible_value, .one_possible_value => .decl_instance_const, |
| 2091 | .runtime => .decl_instance_const_fully_runtime, |
| 2092 | .partially_comptime => .decl_instance_const_partially_comptime, |
| 2093 | .fully_comptime => .decl_instance_const_fully_comptime, |
| 2094 | } else .decl_instance_var, |
| 2095 | }); |
| 2087 | 2096 | try dwarf.refType(pt, di_nw, .fromInterned(parent_ty)); |
| 2088 | 2097 | try dwarf.secOffset(di_nw, try dwarf.getGlobalDecl(pt, global), 0); |
| 2089 | 2098 | } else { |
| 2090 | 2099 | const parent_ni = try dwarf.getConstDecl(pt, parent_ty); |
| 2091 | | try dwarf.abbrevCode(di_nw, .decl_type); |
| 2100 | try dwarf.abbrevCode(di_nw, switch (nav_ty.toIntern()) { |
| 2101 | .type_type => .decl_type, |
| 2102 | else => if (nav_const) switch (nav_class) { |
| 2103 | .no_possible_value, .one_possible_value => .decl_const, |
| 2104 | .runtime => .decl_const_fully_runtime, |
| 2105 | .partially_comptime => .decl_const_partially_comptime, |
| 2106 | .fully_comptime => .decl_const_fully_comptime, |
| 2107 | } else .decl_var, |
| 2108 | }); |
| 2092 | 2109 | try dwarf.secOffset(di_nw, parent_ni, 0); |
| 2093 | 2110 | try di_w.writeInt(u32, decl.src_line + 1, dwarf.endian); |
| 2094 | 2111 | try di_w.writeUleb128(decl.src_column + 1); |
| 2095 | 2112 | try di_w.writeByte(if (decl.is_pub) DW.ACCESS.public else DW.ACCESS.private); |
| 2096 | 2113 | try dwarf.strp(&dwarf.debug_str, di_nw, nav.name.toSlice(ip)); |
| 2097 | 2114 | } |
| 2098 | | try dwarf.refConst(pt, di_nw, .fromInterned(nav.resolved.?.value)); |
| 2099 | | try dwarf.genDebugInfoPadding(di_w, di_w.unusedCapacityLen()); |
| 2100 | | } |
| 2101 | | |
| 2102 | | fn genDeclGlobal( |
| 2103 | | dwarf: *Dwarf, |
| 2104 | | pt: Zcu.PerThread, |
| 2105 | | global: InternPool.Nav.Index, |
| 2106 | | decl: *const std.zig.Zir.Inst.Declaration.Unwrapped, |
| 2107 | | ) link.Error!void { |
| 2108 | | const gi = try dwarf.getGlobal(global); |
| 2109 | | const debug_info_ni = gi.get(dwarf).debug_info_ni.unwrap().?; |
| 2110 | | var di_nw: link.MappedFile.Node.Writer = undefined; |
| 2111 | | if (dwarf.lf.cast(.elf2)) |elf| { |
| 2112 | | debug_info_ni.writer(pt.zcu.gpa, &elf.mf, &di_nw); |
| 2113 | | elf.resetNodeRelocs(debug_info_ni); |
| 2114 | | } else unreachable; |
| 2115 | | defer di_nw.deinit(); |
| 2116 | | dwarf.genDeclGlobalInner(pt, &di_nw, global, decl) catch |err| switch (err) { |
| 2117 | | error.WriteFailed => return dwarf.reportWriteError(&di_nw), |
| 2118 | | else => |e| return e, |
| 2119 | | }; |
| 2120 | | } |
| 2121 | | fn genDeclGlobalInner( |
| 2122 | | dwarf: *Dwarf, |
| 2123 | | pt: Zcu.PerThread, |
| 2124 | | di_nw: *link.MappedFile.Node.Writer, |
| 2125 | | global: InternPool.Nav.Index, |
| 2126 | | decl: *const std.zig.Zir.Inst.Declaration.Unwrapped, |
| 2127 | | ) link.EmitError!void { |
| 2128 | | const zcu = pt.zcu; |
| 2129 | | const ip = &zcu.intern_pool; |
| 2130 | | const nav = ip.getNav(global); |
| 2131 | | const nav_const, const nav_ty: Type, const nav_align, const nav_val: Value = resolved: { |
| 2132 | | const resolved = nav.resolved.?; |
| 2133 | | break :resolved .{ |
| 2134 | | resolved.@"const", |
| 2135 | | .fromInterned(resolved.type), |
| 2136 | | resolved.@"align", |
| 2137 | | .fromInterned(resolved.value), |
| 2138 | | }; |
| 2139 | | }; |
| 2140 | | const nav_class = nav_ty.classify(zcu); |
| 2141 | | const parent_ni = try dwarf.getConstDecl(pt, ip.namespacePtr(nav.analysis.?.namespace).owner_type); |
| 2142 | | const di_w = &di_nw.interface; |
| 2143 | | try dwarf.abbrevCode(di_nw, if (nav_const) switch (nav_class) { |
| 2144 | | .no_possible_value, .one_possible_value => .decl_const, |
| 2145 | | .runtime => .decl_const_fully_runtime, |
| 2146 | | .partially_comptime => .decl_const_partially_comptime, |
| 2147 | | .fully_comptime => .decl_const_fully_comptime, |
| 2148 | | } else .decl_var); |
| 2149 | | try dwarf.secOffset(di_nw, parent_ni, 0); |
| 2150 | | try di_w.writeInt(u32, decl.src_line + 1, dwarf.endian); |
| 2151 | | try di_w.writeUleb128(decl.src_column + 1); |
| 2152 | | try di_w.writeByte(if (decl.is_pub) DW.ACCESS.public else DW.ACCESS.private); |
| 2153 | | try dwarf.strp(&dwarf.debug_str, di_nw, nav.name.toSlice(ip)); |
| 2154 | | try dwarf.strp(&dwarf.debug_str, di_nw, switch (decl.linkage) { |
| 2155 | | .normal => nav.fqn, |
| 2156 | | .@"extern", .@"export" => nav.name, |
| 2157 | | }.toSlice(ip)); |
| 2158 | | const type_offset = di_w.end; |
| 2159 | | if (nav_const) try dwarf.secOffsetPlaceholder(di_w) else { |
| 2160 | | try dwarf.refType(pt, di_nw, nav_ty); |
| 2161 | | try dwarf.blockConst(pt, di_nw, nav_val); |
| 2162 | | } |
| 2163 | | try di_w.writeUleb128(nav_align.toByteUnits() orelse nav_ty.abiAlignment(zcu).toByteUnits().?); |
| 2164 | | try di_w.writeByte(@intFromBool(decl.linkage != .normal)); |
| 2165 | | if (nav_const) { |
| 2166 | | if (nav_class.hasRuntimeBits()) try dwarf.blockConst(pt, di_nw, nav_val); |
| 2167 | | if (nav_class.comptimeOnly()) try dwarf.refConst(pt, di_nw, nav_val); |
| 2168 | | try dwarf.secOffsetFinish(di_nw, type_offset, di_nw.ni, di_w.end); |
| 2169 | | try dwarf.abbrevCode(di_nw, .is_const); |
| 2170 | | try dwarf.refType(pt, di_nw, nav_ty); |
| 2115 | switch (nav_ty.toIntern()) { |
| 2116 | .type_type => try dwarf.refConst(pt, di_nw, nav_val), |
| 2117 | else => { |
| 2118 | try dwarf.strp(&dwarf.debug_str, di_nw, switch (decl.linkage) { |
| 2119 | .normal => nav.fqn, |
| 2120 | .@"extern", .@"export" => nav.name, |
| 2121 | }.toSlice(ip)); |
| 2122 | const type_offset = di_w.end; |
| 2123 | if (nav_const) try dwarf.secOffsetPlaceholder(di_w) else { |
| 2124 | try dwarf.refType(pt, di_nw, nav_ty); |
| 2125 | try dwarf.blockConst(pt, di_nw, nav_val); |
| 2126 | } |
| 2127 | try di_w.writeUleb128(nav_align.toByteUnits() orelse |
| 2128 | nav_ty.abiAlignment(zcu).toByteUnits().?); |
| 2129 | try di_w.writeByte(@intFromBool(decl.linkage != .normal)); |
| 2130 | if (nav_const) { |
| 2131 | if (nav_class.hasRuntimeBits()) try dwarf.blockConst(pt, di_nw, nav_val); |
| 2132 | if (nav_class.comptimeOnly()) try dwarf.refConst(pt, di_nw, nav_val); |
| 2133 | try dwarf.secOffsetFinish(di_nw, type_offset, di_nw.ni, di_w.end); |
| 2134 | try dwarf.abbrevCode(di_nw, .is_const); |
| 2135 | try dwarf.refType(pt, di_nw, nav_ty); |
| 2136 | } |
| 2137 | }, |
| 2171 | 2138 | } |
| 2172 | 2139 | try dwarf.genDebugInfoPadding(di_w, di_w.unusedCapacityLen()); |
| 2173 | 2140 | } |
| ... | ... | @@ -2617,6 +2584,9 @@ fn updateConstInner( |
| 2617 | 2584 | .auto, .@"extern" => .decl_instance_empty_struct, |
| 2618 | 2585 | .@"packed" => .decl_instance_empty_packed_struct, |
| 2619 | 2586 | }); |
| 2587 | try dwarf.refType(pt, di_nw, .fromInterned(ip.namespacePtr( |
| 2588 | ip.namespacePtr(loaded_struct.namespace).parent.unwrap().?, |
| 2589 | ).owner_type)); |
| 2620 | 2590 | try dwarf.secOffset(di_nw, try dwarf.getConstDecl(pt, val), 0); |
| 2621 | 2591 | } else if (loaded_struct.name_nav.unwrap()) |name_ni| { |
| 2622 | 2592 | const name_nav = ip.getNav(name_ni); |
| ... | ... | @@ -2750,6 +2720,9 @@ fn updateConstInner( |
| 2750 | 2720 | .auto, .@"extern" => .decl_instance_empty_union, |
| 2751 | 2721 | .@"packed" => .decl_instance_empty_packed_union, |
| 2752 | 2722 | }); |
| 2723 | try dwarf.refType(pt, di_nw, .fromInterned(ip.namespacePtr( |
| 2724 | ip.namespacePtr(loaded_union.namespace).parent.unwrap().?, |
| 2725 | ).owner_type)); |
| 2753 | 2726 | try dwarf.secOffset(di_nw, try dwarf.getConstDecl(pt, val), 0); |
| 2754 | 2727 | } else if (loaded_union.name_nav.unwrap()) |name_ni| { |
| 2755 | 2728 | const name_nav = ip.getNav(name_ni); |
| ... | ... | @@ -2883,6 +2856,9 @@ fn updateConstInner( |
| 2883 | 2856 | .decl_instance_enum |
| 2884 | 2857 | else |
| 2885 | 2858 | .decl_instance_empty_enum); |
| 2859 | try dwarf.refType(pt, di_nw, .fromInterned(ip.namespacePtr( |
| 2860 | ip.namespacePtr(loaded_enum.namespace).parent.unwrap().?, |
| 2861 | ).owner_type)); |
| 2886 | 2862 | try dwarf.secOffset(di_nw, try dwarf.getConstDecl(pt, val), 0); |
| 2887 | 2863 | } else if (loaded_enum.name_nav.unwrap()) |name_ni| { |
| 2888 | 2864 | const name_nav = ip.getNav(name_ni); |
| ... | ... | @@ -3297,6 +3273,9 @@ fn updateConstIncompleteInner( |
| 3297 | 3273 | .@"union" => .decl_instance_empty_incomplete_union, |
| 3298 | 3274 | .@"enum" => .decl_instance_empty_incomplete_enum, |
| 3299 | 3275 | }); |
| 3276 | try dwarf.refType(pt, di_nw, .fromInterned(ip.namespacePtr( |
| 3277 | ip.namespacePtr(namespace).parent.unwrap().?, |
| 3278 | ).owner_type)); |
| 3300 | 3279 | try dwarf.secOffset(di_nw, try dwarf.getConstDecl(pt, val), 0); |
| 3301 | 3280 | } else if (maybe_name_nav.unwrap()) |name_ni| { |
| 3302 | 3281 | const name_nav = ip.getNav(name_ni); |
| ... | ... | @@ -3625,15 +3604,19 @@ fn genDeclInner( |
| 3625 | 3604 | }, |
| 3626 | 3605 | .global => |global| { |
| 3627 | 3606 | const nav = ip.getNav(global); |
| 3607 | const nav_const, const nav_ty = nav_resolved: { |
| 3608 | const nav_resolved = nav.resolved.?; |
| 3609 | break :nav_resolved .{ nav_resolved.@"const", nav_resolved.type }; |
| 3610 | }; |
| 3628 | 3611 | const src_inst = nav.srcInst(ip).resolveFull(ip).?; |
| 3629 | 3612 | const decl = zcu.fileByIndex(src_inst.file).zir.?.getDeclaration(src_inst.inst); |
| 3630 | 3613 | const parent_ni = try dwarf.getConstDecl(pt, ip.namespacePtr( |
| 3631 | 3614 | nav.analysis.?.namespace, |
| 3632 | 3615 | ).owner_type); |
| 3633 | | try dwarf.abbrevCode(di_nw, if (nav.resolved.?.@"const") switch (nav.resolved.?.type) { |
| 3616 | try dwarf.abbrevCode(di_nw, switch (nav_ty) { |
| 3634 | 3617 | .type_type => .decl_specification_type, |
| 3635 | | else => .decl_specification_const, |
| 3636 | | } else .decl_specification_var); |
| 3618 | else => if (nav_const) .decl_specification_const else .decl_specification_var, |
| 3619 | }); |
| 3637 | 3620 | try dwarf.secOffset(di_nw, parent_ni, 0); |
| 3638 | 3621 | try di_w.writeInt(u32, decl.src_line + 1, dwarf.endian); |
| 3639 | 3622 | try di_w.writeUleb128(decl.src_column + 1); |
| ... | ... | @@ -4003,7 +3986,6 @@ pub const AbbrevCode = enum { |
| 4003 | 3986 | decl_specification_const, |
| 4004 | 3987 | decl_specification_var, |
| 4005 | 3988 | decl_specification_func, |
| 4006 | | decl_instance_type, |
| 4007 | 3989 | decl_instance_empty_incomplete_enum, |
| 4008 | 3990 | decl_instance_incomplete_enum, |
| 4009 | 3991 | decl_instance_empty_enum, |
| ... | ... | @@ -4020,11 +4002,12 @@ pub const AbbrevCode = enum { |
| 4020 | 4002 | decl_instance_union, |
| 4021 | 4003 | decl_instance_empty_packed_union, |
| 4022 | 4004 | decl_instance_packed_union, |
| 4023 | | decl_instance_var, |
| 4005 | decl_instance_type, |
| 4024 | 4006 | decl_instance_const, |
| 4025 | | decl_instance_const_runtime_bits, |
| 4026 | | decl_instance_const_comptime_state, |
| 4027 | | decl_instance_const_runtime_bits_comptime_state, |
| 4007 | decl_instance_const_fully_runtime, |
| 4008 | decl_instance_const_partially_comptime, |
| 4009 | decl_instance_const_fully_comptime, |
| 4010 | decl_instance_var, |
| 4028 | 4011 | decl_instance_empty_func, |
| 4029 | 4012 | decl_instance_func, |
| 4030 | 4013 | decl_instance_empty_func_generic, |
| ... | ... | @@ -4149,6 +4132,7 @@ pub const AbbrevCode = enum { |
| 4149 | 4132 | .{ .declaration, .flag_present }, |
| 4150 | 4133 | }; |
| 4151 | 4134 | const decl_instance_attrs = &[_]Attr{ |
| 4135 | .{ .ZIG_parent, .ref_addr }, |
| 4152 | 4136 | .{ .specification, .ref_addr }, |
| 4153 | 4137 | }; |
| 4154 | 4138 | |
| ... | ... | @@ -4368,16 +4352,6 @@ pub const AbbrevCode = enum { |
| 4368 | 4352 | .{ .import, .ref_addr }, |
| 4369 | 4353 | }, |
| 4370 | 4354 | }, |
| 4371 | | .decl_var = .{ |
| 4372 | | .tag = .variable, |
| 4373 | | .attrs = decl_attrs ++ .{ |
| 4374 | | .{ .linkage_name, .strp }, |
| 4375 | | .{ .type, .ref_addr }, |
| 4376 | | .{ .location, .exprloc }, |
| 4377 | | .{ .alignment, .udata }, |
| 4378 | | .{ .external, .flag }, |
| 4379 | | }, |
| 4380 | | }, |
| 4381 | 4355 | .decl_const = .{ |
| 4382 | 4356 | .tag = .constant, |
| 4383 | 4357 | .attrs = decl_attrs ++ .{ |
| ... | ... | @@ -4418,6 +4392,16 @@ pub const AbbrevCode = enum { |
| 4418 | 4392 | .{ .ZIG_comptime_value, .ref_addr }, |
| 4419 | 4393 | }, |
| 4420 | 4394 | }, |
| 4395 | .decl_var = .{ |
| 4396 | .tag = .variable, |
| 4397 | .attrs = decl_attrs ++ .{ |
| 4398 | .{ .linkage_name, .strp }, |
| 4399 | .{ .type, .ref_addr }, |
| 4400 | .{ .location, .exprloc }, |
| 4401 | .{ .alignment, .udata }, |
| 4402 | .{ .external, .flag }, |
| 4403 | }, |
| 4404 | }, |
| 4421 | 4405 | .decl_empty_func = .{ |
| 4422 | 4406 | .tag = .subprogram, |
| 4423 | 4407 | .attrs = decl_attrs ++ .{ |
| ... | ... | @@ -4547,14 +4531,6 @@ pub const AbbrevCode = enum { |
| 4547 | 4531 | .tag = .subprogram, |
| 4548 | 4532 | .attrs = decl_specification_attrs, |
| 4549 | 4533 | }, |
| 4550 | | .decl_instance_type = .{ |
| 4551 | | .tag = .imported_declaration, |
| 4552 | | .attrs = .{ |
| 4553 | | .{ .ZIG_parent, .ref_addr }, |
| 4554 | | } ++ decl_instance_attrs ++ .{ |
| 4555 | | .{ .import, .ref_addr }, |
| 4556 | | }, |
| 4557 | | }, |
| 4558 | 4534 | .decl_instance_empty_incomplete_enum = .{ |
| 4559 | 4535 | .tag = .enumeration_type, |
| 4560 | 4536 | .attrs = decl_instance_attrs, |
| ... | ... | @@ -4651,26 +4627,32 @@ pub const AbbrevCode = enum { |
| 4651 | 4627 | .{ .type, .ref_addr }, |
| 4652 | 4628 | }, |
| 4653 | 4629 | }, |
| 4654 | | .decl_instance_var = .{ |
| 4655 | | .tag = .variable, |
| 4630 | .decl_instance_type = .{ |
| 4631 | .tag = .imported_declaration, |
| 4632 | .attrs = decl_instance_attrs ++ .{ |
| 4633 | .{ .import, .ref_addr }, |
| 4634 | }, |
| 4635 | }, |
| 4636 | .decl_instance_const = .{ |
| 4637 | .tag = .constant, |
| 4656 | 4638 | .attrs = decl_instance_attrs ++ .{ |
| 4657 | 4639 | .{ .linkage_name, .strp }, |
| 4658 | 4640 | .{ .type, .ref_addr }, |
| 4659 | | .{ .location, .exprloc }, |
| 4660 | 4641 | .{ .alignment, .udata }, |
| 4661 | 4642 | .{ .external, .flag }, |
| 4662 | 4643 | }, |
| 4663 | 4644 | }, |
| 4664 | | .decl_instance_const = .{ |
| 4645 | .decl_instance_const_fully_runtime = .{ |
| 4665 | 4646 | .tag = .constant, |
| 4666 | 4647 | .attrs = decl_instance_attrs ++ .{ |
| 4667 | 4648 | .{ .linkage_name, .strp }, |
| 4668 | 4649 | .{ .type, .ref_addr }, |
| 4669 | 4650 | .{ .alignment, .udata }, |
| 4670 | 4651 | .{ .external, .flag }, |
| 4652 | .{ .const_value, .block }, |
| 4671 | 4653 | }, |
| 4672 | 4654 | }, |
| 4673 | | .decl_instance_const_runtime_bits = .{ |
| 4655 | .decl_instance_const_partially_comptime = .{ |
| 4674 | 4656 | .tag = .constant, |
| 4675 | 4657 | .attrs = decl_instance_attrs ++ .{ |
| 4676 | 4658 | .{ .linkage_name, .strp }, |
| ... | ... | @@ -4678,9 +4660,10 @@ pub const AbbrevCode = enum { |
| 4678 | 4660 | .{ .alignment, .udata }, |
| 4679 | 4661 | .{ .external, .flag }, |
| 4680 | 4662 | .{ .const_value, .block }, |
| 4663 | .{ .ZIG_comptime_value, .ref_addr }, |
| 4681 | 4664 | }, |
| 4682 | 4665 | }, |
| 4683 | | .decl_instance_const_comptime_state = .{ |
| 4666 | .decl_instance_const_fully_comptime = .{ |
| 4684 | 4667 | .tag = .constant, |
| 4685 | 4668 | .attrs = decl_instance_attrs ++ .{ |
| 4686 | 4669 | .{ .linkage_name, .strp }, |
| ... | ... | @@ -4690,15 +4673,14 @@ pub const AbbrevCode = enum { |
| 4690 | 4673 | .{ .ZIG_comptime_value, .ref_addr }, |
| 4691 | 4674 | }, |
| 4692 | 4675 | }, |
| 4693 | | .decl_instance_const_runtime_bits_comptime_state = .{ |
| 4694 | | .tag = .constant, |
| 4676 | .decl_instance_var = .{ |
| 4677 | .tag = .variable, |
| 4695 | 4678 | .attrs = decl_instance_attrs ++ .{ |
| 4696 | 4679 | .{ .linkage_name, .strp }, |
| 4697 | 4680 | .{ .type, .ref_addr }, |
| 4681 | .{ .location, .exprloc }, |
| 4698 | 4682 | .{ .alignment, .udata }, |
| 4699 | 4683 | .{ .external, .flag }, |
| 4700 | | .{ .const_value, .block }, |
| 4701 | | .{ .ZIG_comptime_value, .ref_addr }, |
| 4702 | 4684 | }, |
| 4703 | 4685 | }, |
| 4704 | 4686 | .decl_instance_empty_func = .{ |