diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2025-02-03 20:10:44 +0000 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2025-02-04 16:20:29 +0000 |
| commit | d3ca10d5d8bc92280a14f9e40dc41d6accc1b4c2 (patch) | |
| tree | 20306667045b1136e12399d5fe13612925f0677c /src/link.zig | |
| parent | 3a4bb47fedbb890dc149622e31c75101b14c3b16 (diff) | |
| download | zig-d3ca10d5d8bc92280a14f9e40dc41d6accc1b4c2.tar.gz zig-d3ca10d5d8bc92280a14f9e40dc41d6accc1b4c2.zip | |
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.
Diffstat (limited to 'src/link.zig')
| -rw-r--r-- | src/link.zig | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/link.zig b/src/link.zig index e6ee788095..d2e841ffb6 100644 --- a/src/link.zig +++ b/src/link.zig @@ -750,8 +750,7 @@ pub const File = struct { { const ti = ti_id.resolveFull(&pt.zcu.intern_pool).?; const file = pt.zcu.fileByIndex(ti.file); - assert(file.zir_loaded); - const inst = file.zir.instructions.get(@intFromEnum(ti.inst)); + const inst = file.zir.?.instructions.get(@intFromEnum(ti.inst)); assert(inst.tag == .declaration); } |
