diff options
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 929ed586f6..4a32b3c457 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -3158,16 +3158,19 @@ pub fn getAllErrorsAlloc(comp: *Compilation) !ErrorBundle { if (!refs.contains(anal_unit)) continue; } - const file_index = switch (anal_unit.unwrap()) { - .@"comptime" => |cu| ip.getComptimeUnit(cu).zir_index.resolveFile(ip), - .nav_val, .nav_ty => |nav| ip.getNav(nav).analysis.?.zir_index.resolveFile(ip), - .type => |ty| Type.fromInterned(ty).typeDeclInst(zcu).?.resolveFile(ip), - .func => |ip_index| zcu.funcInfo(ip_index).zir_body_inst.resolveFile(ip), - }; + report_ok: { + const file_index = switch (anal_unit.unwrap()) { + .@"comptime" => |cu| ip.getComptimeUnit(cu).zir_index.resolveFile(ip), + .nav_val, .nav_ty => |nav| ip.getNav(nav).analysis.?.zir_index.resolveFile(ip), + .type => |ty| Type.fromInterned(ty).typeDeclInst(zcu).?.resolveFile(ip), + .func => |ip_index| zcu.funcInfo(ip_index).zir_body_inst.resolveFile(ip), + .memoized_state => break :report_ok, // always report std.builtin errors + }; - // Skip errors for AnalUnits within files that had a parse failure. - // We'll try again once parsing succeeds. - if (!zcu.fileByIndex(file_index).okToReportErrors()) continue; + // Skip errors for AnalUnits within files that had a parse failure. + // We'll try again once parsing succeeds. + if (!zcu.fileByIndex(file_index).okToReportErrors()) continue; + } std.log.scoped(.zcu).debug("analysis error '{s}' reported from unit '{}'", .{ error_msg.msg, @@ -3391,7 +3394,7 @@ pub fn addModuleErrorMsg( const ref = maybe_ref orelse break; const gop = try seen.getOrPut(gpa, ref.referencer); if (gop.found_existing) break; - if (ref_traces.items.len < max_references) { + if (ref_traces.items.len < max_references) skip: { const src = ref.src.upgrade(zcu); const source = try src.file_scope.getSource(gpa); const span = try src.span(gpa); @@ -3403,6 +3406,7 @@ pub fn addModuleErrorMsg( .nav_val, .nav_ty => |nav| ip.getNav(nav).name.toSlice(ip), .type => |ty| Type.fromInterned(ty).containerTypeName(ip).toSlice(ip), .func => |f| ip.getNav(zcu.funcInfo(f).owner_nav).name.toSlice(ip), + .memoized_state => break :skip, }; try ref_traces.append(gpa, .{ .decl_name = try eb.addString(name), @@ -3670,6 +3674,7 @@ fn performAllTheWorkInner( if (try zcu.findOutdatedToAnalyze()) |outdated| { try comp.queueJob(switch (outdated.unwrap()) { .func => |f| .{ .analyze_func = f }, + .memoized_state, .@"comptime", .nav_ty, .nav_val, @@ -3737,6 +3742,7 @@ fn processOneJob(tid: usize, comp: *Compilation, job: Job, prog_node: std.Progre .nav_ty => |nav| pt.ensureNavTypeUpToDate(nav), .nav_val => |nav| pt.ensureNavValUpToDate(nav), .type => |ty| if (pt.ensureTypeUpToDate(ty)) |_| {} else |err| err, + .memoized_state => |stage| pt.ensureMemoizedStateUpToDate(stage), .func => unreachable, }; maybe_err catch |err| switch (err) { |
