diff options
| author | Matthew Lugg <mlugg@mlugg.co.uk> | 2025-05-20 03:25:19 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-20 03:25:19 +0100 |
| commit | 23c817548bbd3988a5fd224b590a4f6102dbe5db (patch) | |
| tree | 5448478794cb493b456de356c2e29fb100e81cfb /src/codegen.zig | |
| parent | f2077f57ae03ef21f1bfee6e4e041c5f466fc3be (diff) | |
| parent | 37a9a4e0f16c1df8de3a4add3a9566b24f024a95 (diff) | |
| download | zig-23c817548bbd3988a5fd224b590a4f6102dbe5db.tar.gz zig-23c817548bbd3988a5fd224b590a4f6102dbe5db.zip | |
Merge pull request #23836 from mlugg/incr-fixes
Incremental fixes, refactor `Zcu.File`
Diffstat (limited to 'src/codegen.zig')
| -rw-r--r-- | src/codegen.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/codegen.zig b/src/codegen.zig index 3e37a3dbb3..fb06d7a240 100644 --- a/src/codegen.zig +++ b/src/codegen.zig @@ -56,7 +56,7 @@ pub fn generateFunction( ) CodeGenError!void { const zcu = pt.zcu; const func = zcu.funcInfo(func_index); - const target = zcu.navFileScope(func.owner_nav).mod.resolved_target.result; + const target = zcu.navFileScope(func.owner_nav).mod.?.resolved_target.result; switch (target_util.zigBackend(target, false)) { else => unreachable, inline .stage2_aarch64, @@ -81,7 +81,7 @@ pub fn generateLazyFunction( ) CodeGenError!void { const zcu = pt.zcu; const target = if (Type.fromInterned(lazy_sym.ty).typeDeclInstAllowGeneratedTag(zcu)) |inst_index| - zcu.fileByIndex(inst_index.resolveFile(&zcu.intern_pool)).mod.resolved_target.result + zcu.fileByIndex(inst_index.resolveFile(&zcu.intern_pool)).mod.?.resolved_target.result else zcu.getTarget(); switch (target_util.zigBackend(target, false)) { @@ -722,7 +722,7 @@ fn lowerNavRef( const zcu = pt.zcu; const gpa = zcu.gpa; const ip = &zcu.intern_pool; - const target = zcu.navFileScope(nav_index).mod.resolved_target.result; + const target = zcu.navFileScope(nav_index).mod.?.resolved_target.result; const ptr_width_bytes = @divExact(target.ptrBitWidth(), 8); const is_obj = lf.comp.config.output_mode == .Obj; const nav_ty = Type.fromInterned(ip.getNav(nav_index).typeOf(ip)); @@ -884,7 +884,7 @@ fn genNavRef( else .{ false, .none, nav.isThreadlocal(ip) }; - const single_threaded = zcu.navFileScope(nav_index).mod.single_threaded; + const single_threaded = zcu.navFileScope(nav_index).mod.?.single_threaded; const name = nav.name; if (lf.cast(.elf)) |elf_file| { const zo = elf_file.zigObjectPtr().?; |
