aboutsummaryrefslogtreecommitdiff
path: root/src/Zcu/PerThread.zig
diff options
context:
space:
mode:
authorMatthew Lugg <mlugg@mlugg.co.uk>2024-09-16 17:39:56 +0100
committerGitHub <noreply@github.com>2024-09-16 17:39:56 +0100
commitf3445f8f6935b4532aab3f339f5d86319d2dca72 (patch)
treecd564962eefa77c38a89b6958e86ebd3bf7fc784 /src/Zcu/PerThread.zig
parent5d7fa5513f92a43a418e3c5c4d27f0b61db313ff (diff)
parent8ff2f1057a9e9cc258f335e4a26101866be987a9 (diff)
downloadzig-f3445f8f6935b4532aab3f339f5d86319d2dca72.tar.gz
zig-f3445f8f6935b4532aab3f339f5d86319d2dca72.zip
Merge pull request #21423 from mlugg/field-init-resolution
compiler: always resolve field inits, remove unncecessary eager resolution
Diffstat (limited to 'src/Zcu/PerThread.zig')
-rw-r--r--src/Zcu/PerThread.zig21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/Zcu/PerThread.zig b/src/Zcu/PerThread.zig
index 837895f783..a11910302d 100644
--- a/src/Zcu/PerThread.zig
+++ b/src/Zcu/PerThread.zig
@@ -1240,11 +1240,11 @@ fn semaCau(pt: Zcu.PerThread, cau_index: InternPool.Cau.Index) !SemaCauResult {
};
}
- const nav_already_populated, const queue_linker_work, const resolve_type = switch (ip.indexToKey(decl_val.toIntern())) {
- .func => |f| .{ f.owner_nav == nav_index, true, false },
- .variable => |v| .{ false, v.owner_nav == nav_index, true },
- .@"extern" => .{ false, false, false },
- else => .{ false, true, true },
+ const nav_already_populated, const queue_linker_work = switch (ip.indexToKey(decl_val.toIntern())) {
+ .func => |f| .{ f.owner_nav == nav_index, true },
+ .variable => |v| .{ false, v.owner_nav == nav_index },
+ .@"extern" => .{ false, false },
+ else => .{ false, true },
};
if (nav_already_populated) {
@@ -1317,16 +1317,7 @@ fn semaCau(pt: Zcu.PerThread, cau_index: InternPool.Cau.Index) !SemaCauResult {
queue_codegen: {
if (!queue_linker_work) break :queue_codegen;
- if (resolve_type) {
- // Needed for codegen_nav which will call updateDecl and then the
- // codegen backend wants full access to the Decl Type.
- // We also need this for the `isFnOrHasRuntimeBits` check below.
- // TODO: we could make the language more lenient by deferring this work
- // to the `codegen_nav` job.
- try decl_ty.resolveFully(pt);
- }
-
- if (!resolve_type or !decl_ty.hasRuntimeBits(zcu)) {
+ if (!try decl_ty.hasRuntimeBitsSema(pt)) {
if (zcu.comp.config.use_llvm) break :queue_codegen;
if (file.mod.strip) break :queue_codegen;
}