aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2024-08-17 08:31:33 +0100
committerJacob Young <jacobly0@users.noreply.github.com>2024-08-17 18:50:10 -0400
commit04b13547e13e3410b911fdbb06cbb27b5051cfbf (patch)
tree2ddfd6d5debfaab1321d632484fa07b14f59976e /src
parent90116d92b08ff882715ca94ecc79934bc0a73762 (diff)
downloadzig-04b13547e13e3410b911fdbb06cbb27b5051cfbf.tar.gz
zig-04b13547e13e3410b911fdbb06cbb27b5051cfbf.zip
Zcu: avoid unnecessary re-analysis in some dependency loop situations
I'm like 80% sure this is correct
Diffstat (limited to 'src')
-rw-r--r--src/Zcu.zig6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Zcu.zig b/src/Zcu.zig
index f191f6a5f1..fc7978b15f 100644
--- a/src/Zcu.zig
+++ b/src/Zcu.zig
@@ -2429,7 +2429,11 @@ fn markTransitiveDependersPotentiallyOutdated(zcu: *Zcu, maybe_outdated: AnalUni
pub fn findOutdatedToAnalyze(zcu: *Zcu) Allocator.Error!?AnalUnit {
if (!zcu.comp.incremental) return null;
- if (zcu.outdated.count() == 0 and zcu.potentially_outdated.count() == 0) {
+ if (zcu.outdated.count() == 0) {
+ // Any units in `potentially_outdated` must just be stuck in loops with one another: none of those
+ // units have had any outdated dependencies so far, and all of their remaining PO deps are triggered
+ // by other units in `potentially_outdated`. So, we can safety assume those units up-to-date.
+ zcu.potentially_outdated.clear();
log.debug("findOutdatedToAnalyze: no outdated depender", .{});
return null;
}