aboutsummaryrefslogtreecommitdiff
path: root/src/Sema.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2024-03-09 13:43:01 +0000
committermlugg <mlugg@mlugg.co.uk>2024-03-14 07:40:08 +0000
commit075c103332effdac80d2c00e59f06ee0fea95b49 (patch)
tree198f342622d63b78ab319c2f4c6465052b4f1d6e /src/Sema.zig
parent1421d329a3bbe4891eda8f234139be787fefcd2f (diff)
downloadzig-075c103332effdac80d2c00e59f06ee0fea95b49.tar.gz
zig-075c103332effdac80d2c00e59f06ee0fea95b49.zip
compiler: add `func_ies` incremental dependencies
This was an oversight in my original design. This new form of dependency is invalidated when the resolved IES for a runtime function changes.
Diffstat (limited to 'src/Sema.zig')
-rw-r--r--src/Sema.zig6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index c8246605aa..54d5e6df7d 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -36462,8 +36462,14 @@ fn resolveInferredErrorSet(
const ip = &mod.intern_pool;
const func_index = ip.iesFuncIndex(ies_index);
const func = mod.funcInfo(func_index);
+
+ try sema.declareDependency(.{ .func_ies = func_index });
+
+ // TODO: during an incremental update this might not be `.none`, but the
+ // function might be out-of-date!
const resolved_ty = func.resolvedErrorSet(ip).*;
if (resolved_ty != .none) return resolved_ty;
+
if (func.analysis(ip).state == .in_progress)
return sema.fail(block, src, "unable to resolve inferred error set", .{});