diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2025-06-12 13:53:41 +0100 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2025-06-12 17:51:31 +0100 |
| commit | 71baa5e769b3b82468736a60e0725a94da9be4e9 (patch) | |
| tree | 34831cde53f7e9908877f3dbcf926185eb0f1a70 /src/Zcu/PerThread.zig | |
| parent | 5bb5aaf932b8ed30aebfbb0036e1532abfc6af46 (diff) | |
| download | zig-71baa5e769b3b82468736a60e0725a94da9be4e9.tar.gz zig-71baa5e769b3b82468736a60e0725a94da9be4e9.zip | |
compiler: improve progress output
Update the estimated total items for the codegen and link progress nodes
earlier. Rather than waiting for the main thread to dispatch the tasks,
we can add the item to the estimated total as soon as we queue the main
task. The only difference is we need to complete it even in error cases.
Diffstat (limited to 'src/Zcu/PerThread.zig')
| -rw-r--r-- | src/Zcu/PerThread.zig | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Zcu/PerThread.zig b/src/Zcu/PerThread.zig index 4ec6eebc46..4d90878420 100644 --- a/src/Zcu/PerThread.zig +++ b/src/Zcu/PerThread.zig @@ -1321,6 +1321,7 @@ fn analyzeNavVal(pt: Zcu.PerThread, nav_id: InternPool.Nav.Index) Zcu.CompileErr } // This job depends on any resolve_type_fully jobs queued up before it. + zcu.comp.link_prog_node.increaseEstimatedTotalItems(1); try zcu.comp.queueJob(.{ .link_nav = nav_id }); } @@ -1717,6 +1718,8 @@ fn analyzeFuncBody( } // This job depends on any resolve_type_fully jobs queued up before it. + zcu.codegen_prog_node.increaseEstimatedTotalItems(1); + comp.link_prog_node.increaseEstimatedTotalItems(1); try comp.queueJob(.{ .codegen_func = .{ .func = func_index, .air = air, @@ -1799,6 +1802,7 @@ fn createFileRootStruct( codegen_type: { if (file.mod.?.strip) break :codegen_type; // This job depends on any resolve_type_fully jobs queued up before it. + zcu.comp.link_prog_node.increaseEstimatedTotalItems(1); try zcu.comp.queueJob(.{ .link_type = wip_ty.index }); } zcu.setFileRootType(file_index, wip_ty.index); @@ -3827,6 +3831,7 @@ pub fn getExtern(pt: Zcu.PerThread, key: InternPool.Key.Extern) Allocator.Error! const result = try pt.zcu.intern_pool.getExtern(pt.zcu.gpa, pt.tid, key); if (result.new_nav.unwrap()) |nav| { // This job depends on any resolve_type_fully jobs queued up before it. + pt.zcu.comp.link_prog_node.increaseEstimatedTotalItems(1); try pt.zcu.comp.queueJob(.{ .link_nav = nav }); if (pt.zcu.comp.debugIncremental()) try pt.zcu.incremental_debug_state.newNav(pt.zcu, nav); } @@ -3974,6 +3979,7 @@ fn recreateStructType( codegen_type: { if (file.mod.?.strip) break :codegen_type; // This job depends on any resolve_type_fully jobs queued up before it. + zcu.comp.link_prog_node.increaseEstimatedTotalItems(1); try zcu.comp.queueJob(.{ .link_type = wip_ty.index }); } @@ -4066,6 +4072,7 @@ fn recreateUnionType( codegen_type: { if (file.mod.?.strip) break :codegen_type; // This job depends on any resolve_type_fully jobs queued up before it. + zcu.comp.link_prog_node.increaseEstimatedTotalItems(1); try zcu.comp.queueJob(.{ .link_type = wip_ty.index }); } |
