diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2024-10-16 15:56:48 +0100 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2024-10-16 16:30:36 +0100 |
| commit | 22539783ad15be3028ed07983eb8e23910171f11 (patch) | |
| tree | 0ace6676df00397e4ca4df098013220f95e85bf7 /src/Compilation.zig | |
| parent | c6842b58d488c236aca74dea82082eec365eb117 (diff) | |
| download | zig-22539783ad15be3028ed07983eb8e23910171f11.tar.gz zig-22539783ad15be3028ed07983eb8e23910171f11.zip | |
incremental: introduce `file` dependencies to handle AstGen failures
The re-analysis here is a little coarse; it'd be nice in the future to
have a way for an AstGen failure to preserve *all* analysis which
depends on the last success, and just hide the compile errors which
depend on it somehow. But I'm not sure how we'd achieve that, so this
works fine for now.
Resolves: #21223
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index a61bc215e1..c8ade90438 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -2901,6 +2901,7 @@ pub fn makeBinFileWritable(comp: *Compilation) !void { const Header = extern struct { intern_pool: extern struct { thread_count: u32, + file_deps_len: u32, src_hash_deps_len: u32, nav_val_deps_len: u32, namespace_deps_len: u32, @@ -2943,6 +2944,7 @@ pub fn saveState(comp: *Compilation) !void { const header: Header = .{ .intern_pool = .{ .thread_count = @intCast(ip.locals.len), + .file_deps_len = @intCast(ip.file_deps.count()), .src_hash_deps_len = @intCast(ip.src_hash_deps.count()), .nav_val_deps_len = @intCast(ip.nav_val_deps.count()), .namespace_deps_len = @intCast(ip.namespace_deps.count()), @@ -2969,6 +2971,8 @@ pub fn saveState(comp: *Compilation) !void { addBuf(&bufs, mem.asBytes(&header)); addBuf(&bufs, mem.sliceAsBytes(pt_headers.items)); + addBuf(&bufs, mem.sliceAsBytes(ip.file_deps.keys())); + addBuf(&bufs, mem.sliceAsBytes(ip.file_deps.values())); addBuf(&bufs, mem.sliceAsBytes(ip.src_hash_deps.keys())); addBuf(&bufs, mem.sliceAsBytes(ip.src_hash_deps.values())); addBuf(&bufs, mem.sliceAsBytes(ip.nav_val_deps.keys())); |
