| ... | ... | @@ -2576,7 +2576,7 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool |
| 2576 | 2576 | const nav_gop = try dwarf.navs.getOrPut(dwarf.gpa, nav_index); |
| 2577 | 2577 | errdefer _ = dwarf.navs.pop(); |
| 2578 | 2578 | |
| 2579 | | const tag: enum { done, decl_alias, decl_const } = switch (ip.indexToKey(nav_val.toIntern())) { |
| 2579 | const tag: enum { done, decl_alias, decl_var, decl_const } = switch (ip.indexToKey(nav_val.toIntern())) { |
| 2580 | 2580 | .int_type, |
| 2581 | 2581 | .ptr_type, |
| 2582 | 2582 | .array_type, |
| ... | ... | @@ -2895,7 +2895,7 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool |
| 2895 | 2895 | .aggregate, |
| 2896 | 2896 | .un, |
| 2897 | 2897 | => .decl_const, |
| 2898 | | .variable => unreachable, |
| 2898 | .variable => .decl_var, |
| 2899 | 2899 | .func => |func| tag: { |
| 2900 | 2900 | if (nav_gop.found_existing) { |
| 2901 | 2901 | const unit_ptr = dwarf.debug_info.section.getUnit(wip_nav.unit); |
| ... | ... | @@ -2966,6 +2966,23 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool |
| 2966 | 2966 | try wip_nav.strp(nav.name.toSlice(ip)); |
| 2967 | 2967 | try wip_nav.refType(nav_val.toType()); |
| 2968 | 2968 | }, |
| 2969 | .decl_var => { |
| 2970 | const diw = wip_nav.debug_info.writer(dwarf.gpa); |
| 2971 | try wip_nav.abbrevCode(.decl_var); |
| 2972 | try wip_nav.refType(Type.fromInterned(parent_type)); |
| 2973 | assert(wip_nav.debug_info.items.len == DebugInfo.declEntryLineOff(dwarf)); |
| 2974 | try diw.writeInt(u32, @intCast(loc.line + 1), dwarf.endian); |
| 2975 | try uleb128(diw, loc.column + 1); |
| 2976 | try diw.writeByte(accessibility); |
| 2977 | try wip_nav.strp(nav.name.toSlice(ip)); |
| 2978 | try wip_nav.strp(nav.fqn.toSlice(ip)); |
| 2979 | const nav_ty = nav_val.typeOf(zcu); |
| 2980 | try wip_nav.refType(nav_ty); |
| 2981 | try wip_nav.blockValue(nav_src_loc, nav_val); |
| 2982 | try uleb128(diw, nav.status.resolved.alignment.toByteUnits() orelse |
| 2983 | nav_ty.abiAlignment(zcu).toByteUnits().?); |
| 2984 | try diw.writeByte(@intFromBool(false)); |
| 2985 | }, |
| 2969 | 2986 | .decl_const => { |
| 2970 | 2987 | const diw = wip_nav.debug_info.writer(dwarf.gpa); |
| 2971 | 2988 | try wip_nav.abbrevCode(.decl_const); |