From a0004cebc255405764e889effb25a42fe07d8463 Mon Sep 17 00:00:00 2001 From: mlugg Date: Sat, 3 Feb 2024 03:03:17 +0000 Subject: Zcu: more dependency tracking logic * Invalidate `decl_val` dependencies * Recursively mark and un-mark all dependencies correctly * Queue analysis of outdated dependers in `Compilation.performAllTheWork` Introduces logic to invalidate `decl_val` dependencies after `Zcu.semaDecl` completes. Also, recursively un-mark dependencies as PO where needed. With this, all dependency invalidation logic is in place. The next step is analyzing outdated dependencies and triggering appropriate re-analysis. --- src/Compilation.zig | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/Compilation.zig') diff --git a/src/Compilation.zig b/src/Compilation.zig index 5ee62692fe..5615808ee2 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -3514,6 +3514,17 @@ pub fn performAllTheWork( try processOneJob(comp, work_item, main_progress_node); continue; } + if (comp.module) |zcu| { + // If there's no work queued, check if there's anything outdated + // which we need to work on, and queue it if so. + if (try zcu.findOutdatedToAnalyze()) |outdated| { + switch (outdated.unwrap()) { + .decl => |decl| try comp.work_queue.writeItem(.{ .analyze_decl = decl }), + .func => |func| try comp.work_queue.writeItem(.{ .codegen_func = func }), + } + continue; + } + } break; } -- cgit v1.2.3