| ... | @@ -786,7 +786,7 @@ const Entry = struct { | ... | @@ -786,7 +786,7 @@ const Entry = struct { |
| 786 | const ip = &zcu.intern_pool; | 786 | const ip = &zcu.intern_pool; |
| 787 | for (dwarf.types.keys(), dwarf.types.values()) |ty, other_entry| { | 787 | for (dwarf.types.keys(), dwarf.types.values()) |ty, other_entry| { |
| 788 | const ty_unit: Unit.Index = if (Type.fromInterned(ty).typeDeclInst(zcu)) |inst_index| | 788 | const ty_unit: Unit.Index = if (Type.fromInterned(ty).typeDeclInst(zcu)) |inst_index| |
| 789 | dwarf.getUnit(zcu.fileByIndex(inst_index.resolveFull(ip).file).mod) catch unreachable | 789 | dwarf.getUnit(zcu.fileByIndex(inst_index.resolveFile(ip)).mod) catch unreachable |
| 790 | else | 790 | else |
| 791 | .main; | 791 | .main; |
| 792 | if (sec.getUnit(ty_unit) == unit and unit.getEntry(other_entry) == entry) | 792 | if (sec.getUnit(ty_unit) == unit and unit.getEntry(other_entry) == entry) |
| ... | @@ -796,7 +796,7 @@ const Entry = struct { | ... | @@ -796,7 +796,7 @@ const Entry = struct { |
| 796 | }); | 796 | }); |
| 797 | } | 797 | } |
| 798 | for (dwarf.navs.keys(), dwarf.navs.values()) |nav, other_entry| { | 798 | for (dwarf.navs.keys(), dwarf.navs.values()) |nav, other_entry| { |
| 799 | const nav_unit = dwarf.getUnit(zcu.fileByIndex(ip.getNav(nav).srcInst(ip).resolveFull(ip).file).mod) catch unreachable; | 799 | const nav_unit = dwarf.getUnit(zcu.fileByIndex(ip.getNav(nav).srcInst(ip).resolveFile(ip)).mod) catch unreachable; |
| 800 | if (sec.getUnit(nav_unit) == unit and unit.getEntry(other_entry) == entry) | 800 | if (sec.getUnit(nav_unit) == unit and unit.getEntry(other_entry) == entry) |
| 801 | log.err("missing Nav({}({d}))", .{ ip.getNav(nav).fqn.fmt(ip), @intFromEnum(nav) }); | 801 | log.err("missing Nav({}({d}))", .{ ip.getNav(nav).fqn.fmt(ip), @intFromEnum(nav) }); |
| 802 | } | 802 | } |
| ... | @@ -1201,7 +1201,7 @@ pub const WipNav = struct { | ... | @@ -1201,7 +1201,7 @@ pub const WipNav = struct { |
| 1201 | const ip = &zcu.intern_pool; | 1201 | const ip = &zcu.intern_pool; |
| 1202 | const maybe_inst_index = ty.typeDeclInst(zcu); | 1202 | const maybe_inst_index = ty.typeDeclInst(zcu); |
| 1203 | const unit = if (maybe_inst_index) |inst_index| | 1203 | const unit = if (maybe_inst_index) |inst_index| |
| 1204 | try wip_nav.dwarf.getUnit(zcu.fileByIndex(inst_index.resolveFull(ip).file).mod) | 1204 | try wip_nav.dwarf.getUnit(zcu.fileByIndex(inst_index.resolveFile(ip)).mod) |
| 1205 | else | 1205 | else |
| 1206 | .main; | 1206 | .main; |
| 1207 | const gop = try wip_nav.dwarf.types.getOrPut(wip_nav.dwarf.gpa, ty.toIntern()); | 1207 | const gop = try wip_nav.dwarf.types.getOrPut(wip_nav.dwarf.gpa, ty.toIntern()); |
| ... | @@ -1539,7 +1539,7 @@ pub fn initWipNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool.Nav.In | ... | @@ -1539,7 +1539,7 @@ pub fn initWipNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool.Nav.In |
| 1539 | const nav = ip.getNav(nav_index); | 1539 | const nav = ip.getNav(nav_index); |
| 1540 | log.debug("initWipNav({})", .{nav.fqn.fmt(ip)}); | 1540 | log.debug("initWipNav({})", .{nav.fqn.fmt(ip)}); |
| 1541 | | 1541 | |
| 1542 | const inst_info = nav.srcInst(ip).resolveFull(ip); | 1542 | const inst_info = nav.srcInst(ip).resolveFull(ip).?; |
| 1543 | const file = zcu.fileByIndex(inst_info.file); | 1543 | const file = zcu.fileByIndex(inst_info.file); |
| 1544 | | 1544 | |
| 1545 | const unit = try dwarf.getUnit(file.mod); | 1545 | const unit = try dwarf.getUnit(file.mod); |
| ... | @@ -1874,7 +1874,7 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool | ... | @@ -1874,7 +1874,7 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool |
| 1874 | const nav = ip.getNav(nav_index); | 1874 | const nav = ip.getNav(nav_index); |
| 1875 | log.debug("updateComptimeNav({})", .{nav.fqn.fmt(ip)}); | 1875 | log.debug("updateComptimeNav({})", .{nav.fqn.fmt(ip)}); |
| 1876 | | 1876 | |
| 1877 | const inst_info = nav.srcInst(ip).resolveFull(ip); | 1877 | const inst_info = nav.srcInst(ip).resolveFull(ip).?; |
| 1878 | const file = zcu.fileByIndex(inst_info.file); | 1878 | const file = zcu.fileByIndex(inst_info.file); |
| 1879 | assert(file.zir_loaded); | 1879 | assert(file.zir_loaded); |
| 1880 | const decl_inst = file.zir.instructions.get(@intFromEnum(inst_info.inst)); | 1880 | const decl_inst = file.zir.instructions.get(@intFromEnum(inst_info.inst)); |
| ... | @@ -1937,7 +1937,7 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool | ... | @@ -1937,7 +1937,7 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool |
| 1937 | }; | 1937 | }; |
| 1938 | break :value_inst value_inst; | 1938 | break :value_inst value_inst; |
| 1939 | }; | 1939 | }; |
| 1940 | const type_inst_info = loaded_struct.zir_index.unwrap().?.resolveFull(ip); | 1940 | const type_inst_info = loaded_struct.zir_index.unwrap().?.resolveFull(ip).?; |
| 1941 | if (type_inst_info.inst != value_inst) break :decl_struct; | 1941 | if (type_inst_info.inst != value_inst) break :decl_struct; |
| 1942 | | 1942 | |
| 1943 | const type_gop = try dwarf.types.getOrPut(dwarf.gpa, nav_val.toIntern()); | 1943 | const type_gop = try dwarf.types.getOrPut(dwarf.gpa, nav_val.toIntern()); |
| ... | @@ -2053,7 +2053,7 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool | ... | @@ -2053,7 +2053,7 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool |
| 2053 | }; | 2053 | }; |
| 2054 | break :value_inst value_inst; | 2054 | break :value_inst value_inst; |
| 2055 | }; | 2055 | }; |
| 2056 | const type_inst_info = loaded_enum.zir_index.unwrap().?.resolveFull(ip); | 2056 | const type_inst_info = loaded_enum.zir_index.unwrap().?.resolveFull(ip).?; |
| 2057 | if (type_inst_info.inst != value_inst) break :decl_enum; | 2057 | if (type_inst_info.inst != value_inst) break :decl_enum; |
| 2058 | | 2058 | |
| 2059 | const type_gop = try dwarf.types.getOrPut(dwarf.gpa, nav_val.toIntern()); | 2059 | const type_gop = try dwarf.types.getOrPut(dwarf.gpa, nav_val.toIntern()); |
| ... | @@ -2127,7 +2127,7 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool | ... | @@ -2127,7 +2127,7 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool |
| 2127 | }; | 2127 | }; |
| 2128 | break :value_inst value_inst; | 2128 | break :value_inst value_inst; |
| 2129 | }; | 2129 | }; |
| 2130 | const type_inst_info = loaded_union.zir_index.resolveFull(ip); | 2130 | const type_inst_info = loaded_union.zir_index.resolveFull(ip).?; |
| 2131 | if (type_inst_info.inst != value_inst) break :decl_union; | 2131 | if (type_inst_info.inst != value_inst) break :decl_union; |
| 2132 | | 2132 | |
| 2133 | const type_gop = try dwarf.types.getOrPut(dwarf.gpa, nav_val.toIntern()); | 2133 | const type_gop = try dwarf.types.getOrPut(dwarf.gpa, nav_val.toIntern()); |
| ... | @@ -2240,7 +2240,7 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool | ... | @@ -2240,7 +2240,7 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool |
| 2240 | }; | 2240 | }; |
| 2241 | break :value_inst value_inst; | 2241 | break :value_inst value_inst; |
| 2242 | }; | 2242 | }; |
| 2243 | const type_inst_info = loaded_opaque.zir_index.resolveFull(ip); | 2243 | const type_inst_info = loaded_opaque.zir_index.resolveFull(ip).?; |
| 2244 | if (type_inst_info.inst != value_inst) break :decl_opaque; | 2244 | if (type_inst_info.inst != value_inst) break :decl_opaque; |
| 2245 | | 2245 | |
| 2246 | const type_gop = try dwarf.types.getOrPut(dwarf.gpa, nav_val.toIntern()); | 2246 | const type_gop = try dwarf.types.getOrPut(dwarf.gpa, nav_val.toIntern()); |
| ... | @@ -2704,7 +2704,7 @@ pub fn updateContainerType(dwarf: *Dwarf, pt: Zcu.PerThread, type_index: InternP | ... | @@ -2704,7 +2704,7 @@ pub fn updateContainerType(dwarf: *Dwarf, pt: Zcu.PerThread, type_index: InternP |
| 2704 | const ty = Type.fromInterned(type_index); | 2704 | const ty = Type.fromInterned(type_index); |
| 2705 | log.debug("updateContainerType({}({d}))", .{ ty.fmt(pt), @intFromEnum(type_index) }); | 2705 | log.debug("updateContainerType({}({d}))", .{ ty.fmt(pt), @intFromEnum(type_index) }); |
| 2706 | | 2706 | |
| 2707 | const inst_info = ty.typeDeclInst(zcu).?.resolveFull(ip); | 2707 | const inst_info = ty.typeDeclInst(zcu).?.resolveFull(ip).?; |
| 2708 | const file = zcu.fileByIndex(inst_info.file); | 2708 | const file = zcu.fileByIndex(inst_info.file); |
| 2709 | if (inst_info.inst == .main_struct_inst) { | 2709 | if (inst_info.inst == .main_struct_inst) { |
| 2710 | const unit = try dwarf.getUnit(file.mod); | 2710 | const unit = try dwarf.getUnit(file.mod); |
| ... | @@ -2922,7 +2922,7 @@ pub fn updateNavLineNumber(dwarf: *Dwarf, zcu: *Zcu, nav_index: InternPool.Nav.I | ... | @@ -2922,7 +2922,7 @@ pub fn updateNavLineNumber(dwarf: *Dwarf, zcu: *Zcu, nav_index: InternPool.Nav.I |
| 2922 | const ip = &zcu.intern_pool; | 2922 | const ip = &zcu.intern_pool; |
| 2923 | | 2923 | |
| 2924 | const zir_index = ip.getCau(ip.getNav(nav_index).analysis_owner.unwrap() orelse return).zir_index; | 2924 | const zir_index = ip.getCau(ip.getNav(nav_index).analysis_owner.unwrap() orelse return).zir_index; |
| 2925 | const inst_info = zir_index.resolveFull(ip); | 2925 | const inst_info = zir_index.resolveFull(ip).?; |
| 2926 | assert(inst_info.inst != .main_struct_inst); | 2926 | assert(inst_info.inst != .main_struct_inst); |
| 2927 | const file = zcu.fileByIndex(inst_info.file); | 2927 | const file = zcu.fileByIndex(inst_info.file); |
| 2928 | | 2928 | |