diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2024-03-09 13:43:01 +0000 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2024-03-14 07:40:08 +0000 |
| commit | 075c103332effdac80d2c00e59f06ee0fea95b49 (patch) | |
| tree | 198f342622d63b78ab319c2f4c6465052b4f1d6e /src/InternPool.zig | |
| parent | 1421d329a3bbe4891eda8f234139be787fefcd2f (diff) | |
| download | zig-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/InternPool.zig')
| -rw-r--r-- | src/InternPool.zig | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/InternPool.zig b/src/InternPool.zig index b1acb0f9b0..2367edff45 100644 --- a/src/InternPool.zig +++ b/src/InternPool.zig @@ -67,6 +67,9 @@ src_hash_deps: std.AutoArrayHashMapUnmanaged(TrackedInst.Index, DepEntry.Index) /// Dependencies on the value of a Decl. /// Value is index into `dep_entries` of the first dependency on this Decl value. decl_val_deps: std.AutoArrayHashMapUnmanaged(DeclIndex, DepEntry.Index) = .{}, +/// Dependencies on the IES of a runtime function. +/// Value is index into `dep_entries` of the first dependency on this Decl value. +func_ies_deps: std.AutoArrayHashMapUnmanaged(Index, DepEntry.Index) = .{}, /// Dependencies on the full set of names in a ZIR namespace. /// Key refers to a `struct_decl`, `union_decl`, etc. /// Value is index into `dep_entries` of the first dependency on this namespace. @@ -167,6 +170,7 @@ pub const Depender = enum(u32) { pub const Dependee = union(enum) { src_hash: TrackedInst.Index, decl_val: DeclIndex, + func_ies: Index, namespace: TrackedInst.Index, namespace_name: NamespaceNameKey, }; @@ -212,6 +216,7 @@ pub fn dependencyIterator(ip: *const InternPool, dependee: Dependee) DependencyI const first_entry = switch (dependee) { .src_hash => |x| ip.src_hash_deps.get(x), .decl_val => |x| ip.decl_val_deps.get(x), + .func_ies => |x| ip.func_ies_deps.get(x), .namespace => |x| ip.namespace_deps.get(x), .namespace_name => |x| ip.namespace_name_deps.get(x), } orelse return .{ @@ -251,6 +256,7 @@ pub fn addDependency(ip: *InternPool, gpa: Allocator, depender: Depender, depend const gop = try switch (tag) { .src_hash => ip.src_hash_deps, .decl_val => ip.decl_val_deps, + .func_ies => ip.func_ies_deps, .namespace => ip.namespace_deps, .namespace_name => ip.namespace_name_deps, }.getOrPut(gpa, dependee_payload); @@ -4324,6 +4330,7 @@ pub fn deinit(ip: *InternPool, gpa: Allocator) void { ip.src_hash_deps.deinit(gpa); ip.decl_val_deps.deinit(gpa); + ip.func_ies_deps.deinit(gpa); ip.namespace_deps.deinit(gpa); ip.namespace_name_deps.deinit(gpa); |
