authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2024-08-17 11:38:19+01:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2024-08-17 18:50:10-04:00
log9c3324173de2d8de80e95fb6be23eb63dfbc5169
treeba2d5666174670795280879f64ccfabf024429be
parentd63d9b99185c080c6ed7a6be3dc43c897f2aeadc

compiler: merge conflicts and typos


3 files changed, 15 insertions(+), 15 deletions(-)

src/Sema.zig+3-3
...@@ -2504,12 +2504,12 @@ pub fn failWithOwnedErrorMsg(sema: *Sema, block: ?*Block, err_msg: *Module.Error...@@ -2504,12 +2504,12 @@ pub fn failWithOwnedErrorMsg(sema: *Sema, block: ?*Block, err_msg: *Module.Error
2504 const mod = sema.pt.zcu;2504 const mod = sema.pt.zcu;
25052505
2506 if (build_options.enable_debug_extensions and mod.comp.debug_compile_errors) {2506 if (build_options.enable_debug_extensions and mod.comp.debug_compile_errors) {
2507 var all_references = mod.resolveReferences() catch @panic("out of memory");2507 var all_references: ?std.AutoHashMapUnmanaged(AnalUnit, ?Zcu.ResolvedReference) = null;
2508 var wip_errors: std.zig.ErrorBundle.Wip = undefined;2508 var wip_errors: std.zig.ErrorBundle.Wip = undefined;
2509 wip_errors.init(gpa) catch @panic("out of memory");2509 wip_errors.init(gpa) catch @panic("out of memory");
2510 Compilation.addModuleErrorMsg(mod, &wip_errors, err_msg.*, &all_references) catch unreachable;2510 Compilation.addModuleErrorMsg(mod, &wip_errors, err_msg.*, &all_references) catch @panic("out of memory");
2511 std.debug.print("compile error during Sema:\n", .{});2511 std.debug.print("compile error during Sema:\n", .{});
2512 var error_bundle = wip_errors.toOwnedBundle("") catch unreachable;2512 var error_bundle = wip_errors.toOwnedBundle("") catch @panic("out of memory");
2513 error_bundle.renderToStdErr(.{ .ttyconf = .no_color });2513 error_bundle.renderToStdErr(.{ .ttyconf = .no_color });
2514 crash_report.compilerPanic("unexpected compile error occurred", null, null);2514 crash_report.compilerPanic("unexpected compile error occurred", null, null);
2515 }2515 }
src/Zcu.zig+1-1
...@@ -2433,7 +2433,7 @@ pub fn findOutdatedToAnalyze(zcu: *Zcu) Allocator.Error!?AnalUnit {...@@ -2433,7 +2433,7 @@ pub fn findOutdatedToAnalyze(zcu: *Zcu) Allocator.Error!?AnalUnit {
2433 // Any units in `potentially_outdated` must just be stuck in loops with one another: none of those2433 // Any units in `potentially_outdated` must just be stuck in loops with one another: none of those
2434 // units have had any outdated dependencies so far, and all of their remaining PO deps are triggered2434 // units have had any outdated dependencies so far, and all of their remaining PO deps are triggered
2435 // by other units in `potentially_outdated`. So, we can safety assume those units up-to-date.2435 // by other units in `potentially_outdated`. So, we can safety assume those units up-to-date.
2436 zcu.potentially_outdated.clear();2436 zcu.potentially_outdated.clearRetainingCapacity();
2437 log.debug("findOutdatedToAnalyze: no outdated depender", .{});2437 log.debug("findOutdatedToAnalyze: no outdated depender", .{});
2438 return null;2438 return null;
2439 }2439 }
src/link/Dwarf.zig+11-11
...@@ -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 unreachable789 dwarf.getUnit(zcu.fileByIndex(inst_index.resolveFile(ip)).mod) catch unreachable
790 else790 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 else1205 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)});
15411541
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);
15441544
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)});
18761876
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;
19421942
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;
20582058
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;
21322132
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;
22452245
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) });
27062706
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;
29232923
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);
29282928