diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2025-02-05 12:23:53 +0000 |
|---|---|---|
| committer | Matthew Lugg <mlugg@mlugg.co.uk> | 2025-02-06 08:21:19 +0000 |
| commit | 62e251dcaa366c15e1e591d859738bb0d735dc9a (patch) | |
| tree | 0871ec81bb2c9f781672e334edaba2f4d20a50a0 /src/Zcu/PerThread.zig | |
| parent | 1a1389c513119c344d2eafefd3b6353b2c6cd343 (diff) | |
| download | zig-62e251dcaa366c15e1e591d859738bb0d735dc9a.tar.gz zig-62e251dcaa366c15e1e591d859738bb0d735dc9a.zip | |
incremental: codegen types which are recreated
Unfortunately, I can't easily add a test for this, because the repro
depends on some details of DWARF layout; but I've confirmed that it
fixes a bug repro on another branch.
Diffstat (limited to 'src/Zcu/PerThread.zig')
| -rw-r--r-- | src/Zcu/PerThread.zig | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Zcu/PerThread.zig b/src/Zcu/PerThread.zig index 32372bf597..da031609a8 100644 --- a/src/Zcu/PerThread.zig +++ b/src/Zcu/PerThread.zig @@ -3810,6 +3810,13 @@ fn recreateStructType( // No need to re-scan the namespace -- `zirStructDecl` will ultimately do that if the type is still alive. try zcu.comp.queueJob(.{ .resolve_type_fully = wip_ty.index }); + codegen_type: { + if (zcu.comp.config.use_llvm) break :codegen_type; + if (file.mod.strip) break :codegen_type; + // This job depends on any resolve_type_fully jobs queued up before it. + try zcu.comp.queueJob(.{ .codegen_type = wip_ty.index }); + } + const new_ty = wip_ty.finish(ip, struct_obj.namespace); if (inst_info.inst == .main_struct_inst) { // This is the root type of a file! Update the reference. @@ -3898,6 +3905,14 @@ fn recreateUnionType( zcu.namespacePtr(namespace_index).owner_type = wip_ty.index; // No need to re-scan the namespace -- `zirUnionDecl` will ultimately do that if the type is still alive. try zcu.comp.queueJob(.{ .resolve_type_fully = wip_ty.index }); + + codegen_type: { + if (zcu.comp.config.use_llvm) break :codegen_type; + if (file.mod.strip) break :codegen_type; + // This job depends on any resolve_type_fully jobs queued up before it. + try zcu.comp.queueJob(.{ .codegen_type = wip_ty.index }); + } + return wip_ty.finish(ip, namespace_index); } |
