stage2: hook up Sema to the progress bar

This commit is contained in:
Andrew Kelley
2022-03-31 19:07:05 -07:00
parent b45c6c757c
commit 87179d91a7
2 changed files with 49 additions and 53 deletions

View File

@@ -42,6 +42,7 @@ root_pkg: *Package,
/// Normally, `main_pkg` and `root_pkg` are the same. The exception is `zig test`, in which
/// `root_pkg` is the test runner, and `main_pkg` is the user's source file which has the tests.
main_pkg: *Package,
sema_prog_node: std.Progress.Node = undefined,
/// Used by AstGen worker to load and store ZIR cache.
global_zir_cache: Compilation.Directory,
@@ -3517,6 +3518,10 @@ pub fn ensureDeclAnalyzed(mod: *Module, decl: *Decl) SemaError!void {
.unreferenced => false,
};
var decl_prog_node = mod.sema_prog_node.start(mem.sliceTo(decl.name, 0), 0);
decl_prog_node.activate();
defer decl_prog_node.end();
const type_changed = mod.semaDecl(decl) catch |err| switch (err) {
error.AnalysisFail => {
if (decl.analysis == .in_progress) {