aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2024-02-03 03:03:17 +0000
committermlugg <mlugg@mlugg.co.uk>2024-02-04 18:38:39 +0000
commita0004cebc255405764e889effb25a42fe07d8463 (patch)
tree9579c85d052b4520c0b40602add0bc797d9ceec8 /src/Compilation.zig
parent1e91ee1e05f08013e3a4edec5d9f0aef978f3f0b (diff)
downloadzig-a0004cebc255405764e889effb25a42fe07d8463.tar.gz
zig-a0004cebc255405764e889effb25a42fe07d8463.zip
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.
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig11
1 files changed, 11 insertions, 0 deletions
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;
}