diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2025-02-04 14:03:40 +0000 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2025-02-04 16:20:29 +0000 |
| commit | 55a2e535fdb663793b84769cb6c3a261bda3fc66 (patch) | |
| tree | f13faecbc0fc66c49791165cce0189382026f428 /src/Sema | |
| parent | 0907432fffd2d9f5319022332a60fc88d3aacf4e (diff) | |
| download | zig-55a2e535fdb663793b84769cb6c3a261bda3fc66.tar.gz zig-55a2e535fdb663793b84769cb6c3a261bda3fc66.zip | |
compiler: integrate ZON with the ZIR caching system
This came with a big cleanup to `Zcu.PerThread.updateFile` (formerly
`astGenFile`).
Also, change how the cache manifest works for files in the import table.
Instead of being added to the manifest when we call `semaFile` on them,
we iterate the import table after running the AstGen workers and add all
the files to the cache manifest then.
The downside is that this is a bit more eager to include files in the
manifest; in particular, files which are imported but not actually
referenced are now included in analysis. So, for instance, modifying any
standard library file will invalidate all Zig compilations using that
standard library, even if they don't use that file.
The original motivation here was simply that the old logic in `semaFile`
didn't translate nicely to ZON. However, it turns out to actually be
necessary for correctness. Because `@import("foo.zig")` is an
AstGen-level error if `foo.zig` does not exist, we need to invalidate
the cache when an imported but unreferenced file is removed to make sure
this error is triggered when it needs to be.
Resolves: #22746
Diffstat (limited to 'src/Sema')
| -rw-r--r-- | src/Sema/LowerZon.zig | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/Sema/LowerZon.zig b/src/Sema/LowerZon.zig index 2b2d16b90a..f30879090b 100644 --- a/src/Sema/LowerZon.zig +++ b/src/Sema/LowerZon.zig @@ -39,8 +39,6 @@ pub fn run( ) CompileError!InternPool.Index { const pt = sema.pt; - _ = try file.getZoir(pt.zcu); - const tracked_inst = try pt.zcu.intern_pool.trackZir(pt.zcu.gpa, pt.tid, .{ .file = file_index, .inst = .main_struct_inst, // this is the only trackable instruction in a ZON file |
