Zcu: remove *_loaded fields on File

Instead, `source`, `tree`, and `zir` should all be optional. This is
precisely what we're actually trying to model here; and `File` isn't
optimized for memory consumption or serializability anyway, so it's fine
to use a couple of extra bytes on actual optionals here.
This commit is contained in:
mlugg
2025-02-03 20:10:44 +00:00
parent 3a4bb47fed
commit d3ca10d5d8
11 changed files with 191 additions and 240 deletions

View File

@@ -482,13 +482,11 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Package.Module {
};
new_file.* = .{
.sub_file_path = "builtin.zig",
.source = generated_builtin_source,
.source_loaded = true,
.tree_loaded = false,
.zir_loaded = false,
.stat = undefined,
.tree = undefined,
.zir = undefined,
.source = generated_builtin_source,
.tree = null,
.zir = null,
.zoir = null,
.status = .never_loaded,
.prev_status = .never_loaded,
.mod = new,