authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-02-04 12:00:34+00:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-02-04 16:20:29+00:00
log0907432fffd2d9f5319022332a60fc88d3aacf4e
tree2f7972c6df3344599e01d99c72b82e75e1a990aa
parenta8e53801d0bfe2132831b8286c4a237788aea8fa
signaturelock-open Commit is signed but in an unrecognized format.

compiler: a few renames

This is mainly in preparation for integrating ZonGen into the pipeline properly, although these names are better because `astGenFile` isn't *necessarily* running AstGen; it may determine that the current ZIR is up-to-date, or load cached ZIR.

4 files changed, 9 insertions(+), 9 deletions(-)

src/Compilation.zig+6-6
......@@ -3779,7 +3779,7 @@ fn performAllTheWorkInner(
37793779 // will be needed by the worker threads.
37803780 const path_digest = zcu.filePathDigest(file_index);
37813781 const file = zcu.fileByIndex(file_index);
3782 comp.thread_pool.spawnWgId(&astgen_wait_group, workerAstGenFile, .{
3782 comp.thread_pool.spawnWgId(&astgen_wait_group, workerUpdateFile, .{
37833783 comp, file, file_index, path_digest, zir_prog_node, &astgen_wait_group, .root,
37843784 });
37853785 }
......@@ -3787,7 +3787,7 @@ fn performAllTheWorkInner(
37873787
37883788 for (0.., zcu.embed_table.values()) |ef_index_usize, ef| {
37893789 const ef_index: Zcu.EmbedFile.Index = @enumFromInt(ef_index_usize);
3790 comp.thread_pool.spawnWgId(&astgen_wait_group, workerCheckEmbedFile, .{
3790 comp.thread_pool.spawnWgId(&astgen_wait_group, workerUpdateEmbedFile, .{
37913791 comp, ef_index, ef,
37923792 });
37933793 }
......@@ -4280,7 +4280,7 @@ fn workerDocsWasmFallible(comp: *Compilation, prog_node: std.Progress.Node) anye
42804280 };
42814281}
42824282
4283fn workerAstGenFile(
4283fn workerUpdateFile(
42844284 tid: usize,
42854285 comp: *Compilation,
42864286 file: *Zcu.File,
......@@ -4296,7 +4296,7 @@ fn workerAstGenFile(
42964296
42974297 const pt: Zcu.PerThread = .activate(comp.zcu.?, @enumFromInt(tid));
42984298 defer pt.deactivate();
4299 pt.astGenFile(file, path_digest) catch |err| switch (err) {
4299 pt.updateFile(file, path_digest) catch |err| switch (err) {
43004300 error.AnalysisFail => return,
43014301 else => {
43024302 pt.reportRetryableAstGenError(src, file_index, err) catch |oom| switch (oom) {
......@@ -4352,7 +4352,7 @@ fn workerAstGenFile(
43524352 .importing_file = file_index,
43534353 .import_tok = item.data.token,
43544354 } };
4355 comp.thread_pool.spawnWgId(wg, workerAstGenFile, .{
4355 comp.thread_pool.spawnWgId(wg, workerUpdateFile, .{
43564356 comp, import_result.file, import_result.file_index, imported_path_digest, prog_node, wg, sub_src,
43574357 });
43584358 }
......@@ -4375,7 +4375,7 @@ fn workerUpdateBuiltinZigFile(
43754375 };
43764376}
43774377
4378fn workerCheckEmbedFile(tid: usize, comp: *Compilation, ef_index: Zcu.EmbedFile.Index, ef: *Zcu.EmbedFile) void {
4378fn workerUpdateEmbedFile(tid: usize, comp: *Compilation, ef_index: Zcu.EmbedFile.Index, ef: *Zcu.EmbedFile) void {
43794379 comp.detectEmbedFileUpdate(@enumFromInt(tid), ef_index, ef) catch |err| switch (err) {
43804380 error.OutOfMemory => {
43814381 comp.mutex.lock();
src/Sema.zig+1-1
......@@ -6140,7 +6140,7 @@ fn zirCImport(sema: *Sema, parent_block: *Block, inst: Zir.Inst.Index) CompileEr
61406140 return sema.fail(&child_block, src, "C import failed: {s}", .{@errorName(err)});
61416141
61426142 const path_digest = zcu.filePathDigest(result.file_index);
6143 pt.astGenFile(result.file, path_digest) catch |err|
6143 pt.updateFile(result.file, path_digest) catch |err|
61446144 return sema.fail(&child_block, src, "C import failed: {s}", .{@errorName(err)});
61456145
61466146 try sema.declareDependency(.{ .file = result.file_index });
src/Zcu.zig+1-1
......@@ -785,7 +785,7 @@ pub const File = struct {
785785
786786 // Here we do not modify stat fields because this function is the one
787787 // used for error reporting. We need to keep the stat fields stale so that
788 // astGenFile can know to regenerate ZIR.
788 // updateFile can know to regenerate ZIR.
789789
790790 file.source = source;
791791 errdefer comptime unreachable; // don't error after populating `source`
src/Zcu/PerThread.zig+1-1
......@@ -73,7 +73,7 @@ pub fn destroyFile(pt: Zcu.PerThread, file_index: Zcu.File.Index) void {
7373 if (!is_builtin) gpa.destroy(file);
7474}
7575
76pub fn astGenFile(
76pub fn updateFile(
7777 pt: Zcu.PerThread,
7878 file: *Zcu.File,
7979 path_digest: Cache.BinDigest,