aboutsummaryrefslogtreecommitdiff
path: root/src/Zcu
diff options
context:
space:
mode:
Diffstat (limited to 'src/Zcu')
-rw-r--r--src/Zcu/PerThread.zig26
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,