diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-07-04 14:16:42 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-07-04 17:51:35 -0700 |
| commit | 30ec43a6c78d9c8803becbea5a02edb8fae08af6 (patch) | |
| tree | fd827ce826b593a18c128d019eb9adffb3c2ca26 /src/codegen/c.zig | |
| parent | 7ed2fbd7559ceb69ab03a8985fd7e5b591e22ab7 (diff) | |
| download | zig-30ec43a6c78d9c8803becbea5a02edb8fae08af6.tar.gz zig-30ec43a6c78d9c8803becbea5a02edb8fae08af6.zip | |
Zcu: extract permanent state from File
Primarily, this commit removes 2 fields from File, relying on the data
being stored in the `files` field, with the key as the path digest, and
the value as the struct decl corresponding to the File. This table is
serialized into the compiler state that survives between incremental
updates.
Meanwhile, the File struct remains ephemeral data that can be
reconstructed the first time it is needed by the compiler process, as
well as operated on by independent worker threads.
A key outcome of this commit is that there is now a stable index that
can be used to refer to a File. This will be needed when serializing
error messages to survive incremental compilation updates.
Diffstat (limited to 'src/codegen/c.zig')
| -rw-r--r-- | src/codegen/c.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig index 92e9edb433..2fd3d2b164 100644 --- a/src/codegen/c.zig +++ b/src/codegen/c.zig @@ -2581,7 +2581,7 @@ pub fn genTypeDecl( _ = try renderTypePrefix(.flush, global_ctype_pool, zcu, writer, global_ctype, .suffix, .{}); try writer.writeByte(';'); const owner_decl = zcu.declPtr(owner_decl_index); - const owner_mod = zcu.namespacePtr(owner_decl.src_namespace).file_scope.mod; + const owner_mod = zcu.namespacePtr(owner_decl.src_namespace).fileScope(zcu).mod; if (!owner_mod.strip) { try writer.writeAll(" /* "); try owner_decl.renderFullyQualifiedName(zcu, writer); |
