diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2024-08-17 01:15:04 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-17 01:15:04 -0400 |
| commit | bb70501060a8bfff25818cf1d80491d724f8a634 (patch) | |
| tree | 546c8d93fcbdf4e2f3e2656d5d4f45bc79e9d483 /src/Zcu | |
| parent | 90989be0e31a91335f8d1c1eafb84c3b34792a8c (diff) | |
| parent | ed19ecd115beedfbf496c6f20995e74fbcd8ccb4 (diff) | |
| download | zig-bb70501060a8bfff25818cf1d80491d724f8a634.tar.gz zig-bb70501060a8bfff25818cf1d80491d724f8a634.zip | |
Merge pull request #21078 from jacobly0/new-dwarf
Dwarf: rework self-hosted debug info from scratch
Diffstat (limited to 'src/Zcu')
| -rw-r--r-- | src/Zcu/PerThread.zig | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/Zcu/PerThread.zig b/src/Zcu/PerThread.zig index 1074062d55..b353331d95 100644 --- a/src/Zcu/PerThread.zig +++ b/src/Zcu/PerThread.zig @@ -911,6 +911,11 @@ fn createFileRootStruct( try pt.scanNamespace(namespace_index, decls); 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; + try zcu.comp.queueJob(.{ .codegen_type = wip_ty.index }); + } zcu.setFileRootType(file_index, wip_ty.index); return wip_ty.finish(ip, new_cau_index.toOptional(), namespace_index); } @@ -1332,7 +1337,10 @@ fn semaCau(pt: Zcu.PerThread, cau_index: InternPool.Cau.Index) !SemaCauResult { // to the `codegen_nav` job. try decl_ty.resolveFully(pt); - if (!decl_ty.isFnOrHasRuntimeBits(pt)) break :queue_codegen; + if (!decl_ty.isFnOrHasRuntimeBits(pt)) { + if (zcu.comp.config.use_llvm) break :queue_codegen; + if (file.mod.strip) break :queue_codegen; + } try zcu.comp.queueJob(.{ .codegen_nav = nav_index }); } @@ -2588,6 +2596,22 @@ pub fn linkerUpdateNav(pt: Zcu.PerThread, nav_index: InternPool.Nav.Index) !void } } +pub fn linkerUpdateContainerType(pt: Zcu.PerThread, ty: InternPool.Index) !void { + const zcu = pt.zcu; + const comp = zcu.comp; + const ip = &zcu.intern_pool; + + const codegen_prog_node = zcu.codegen_prog_node.start(Type.fromInterned(ty).containerTypeName(ip).toSlice(ip), 0); + defer codegen_prog_node.end(); + + if (comp.bin_file) |lf| { + lf.updateContainerType(pt, ty) catch |err| switch (err) { + error.OutOfMemory => return error.OutOfMemory, + else => |e| log.err("codegen type failed: {s}", .{@errorName(e)}), + }; + } +} + pub fn reportRetryableAstGenError( pt: Zcu.PerThread, src: Zcu.AstGenSrc, |
