aboutsummaryrefslogtreecommitdiff
path: root/src/Zcu/PerThread.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2024-08-20 18:41:26 -0400
committerGitHub <noreply@github.com>2024-08-20 18:41:26 -0400
commit16d74809d44d6bb8db1a32923ef8db43d956e24d (patch)
tree78344089f8c4cc2bdc07ea74f0a47b8f500d2fcb /src/Zcu/PerThread.zig
parent0a70455095a19a4c18497e6786ca6139c1cc2892 (diff)
parent55864e98e08c9d44ee2ea6fc1f3a3c2a98042310 (diff)
downloadzig-16d74809d44d6bb8db1a32923ef8db43d956e24d.tar.gz
zig-16d74809d44d6bb8db1a32923ef8db43d956e24d.zip
Merge pull request #21140 from jacobly0/self-dwarf
Dwarf: inline calls progress
Diffstat (limited to 'src/Zcu/PerThread.zig')
-rw-r--r--src/Zcu/PerThread.zig28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/Zcu/PerThread.zig b/src/Zcu/PerThread.zig
index 0db30bfdbd..291518f5f0 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 = switch (ip.indexToKey(decl_val.toIntern())) {
- .func => |f| .{ f.owner_nav == nav_index, false },
- .variable => |v| .{ false, v.owner_nav == nav_index },
- .@"extern" => .{ false, false },
- else => .{ false, true },
+ 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 },
};
if (nav_already_populated) {
@@ -1317,14 +1317,16 @@ fn semaCau(pt: Zcu.PerThread, cau_index: InternPool.Cau.Index) !SemaCauResult {
queue_codegen: {
if (!queue_linker_work) break :queue_codegen;
- // 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) {
+ // 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 (!decl_ty.isFnOrHasRuntimeBits(pt)) {
+ if (!resolve_type or !decl_ty.hasRuntimeBits(pt)) {
if (zcu.comp.config.use_llvm) break :queue_codegen;
if (file.mod.strip) break :queue_codegen;
}
@@ -2158,7 +2160,7 @@ fn analyzeFnBody(pt: Zcu.PerThread, func_index: InternPool.Index) Zcu.SemaError!
.name = if (inner_block.ownerModule().strip)
.none
else
- @enumFromInt(try sema.appendAirString(sema.code.nullTerminatedString(param_name))),
+ try sema.appendAirString(sema.code.nullTerminatedString(param_name)),
} },
});
}