diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2025-02-04 12:00:34 +0000 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2025-02-04 16:20:29 +0000 |
| commit | 0907432fffd2d9f5319022332a60fc88d3aacf4e (patch) | |
| tree | 2f7972c6df3344599e01d99c72b82e75e1a990aa | |
| parent | a8e53801d0bfe2132831b8286c4a237788aea8fa (diff) | |
| download | zig-0907432fffd2d9f5319022332a60fc88d3aacf4e.tar.gz zig-0907432fffd2d9f5319022332a60fc88d3aacf4e.zip | |
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.
| -rw-r--r-- | src/Compilation.zig | 12 | ||||
| -rw-r--r-- | src/Sema.zig | 2 | ||||
| -rw-r--r-- | src/Zcu.zig | 2 | ||||
| -rw-r--r-- | src/Zcu/PerThread.zig | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 28017eeed9..f585fd7e98 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -3779,7 +3779,7 @@ fn performAllTheWorkInner( // will be needed by the worker threads. const path_digest = zcu.filePathDigest(file_index); const file = zcu.fileByIndex(file_index); - comp.thread_pool.spawnWgId(&astgen_wait_group, workerAstGenFile, .{ + comp.thread_pool.spawnWgId(&astgen_wait_group, workerUpdateFile, .{ comp, file, file_index, path_digest, zir_prog_node, &astgen_wait_group, .root, }); } @@ -3787,7 +3787,7 @@ fn performAllTheWorkInner( for (0.., zcu.embed_table.values()) |ef_index_usize, ef| { const ef_index: Zcu.EmbedFile.Index = @enumFromInt(ef_index_usize); - comp.thread_pool.spawnWgId(&astgen_wait_group, workerCheckEmbedFile, .{ + comp.thread_pool.spawnWgId(&astgen_wait_group, workerUpdateEmbedFile, .{ comp, ef_index, ef, }); } @@ -4280,7 +4280,7 @@ fn workerDocsWasmFallible(comp: *Compilation, prog_node: std.Progress.Node) anye }; } -fn workerAstGenFile( +fn workerUpdateFile( tid: usize, comp: *Compilation, file: *Zcu.File, @@ -4296,7 +4296,7 @@ fn workerAstGenFile( const pt: Zcu.PerThread = .activate(comp.zcu.?, @enumFromInt(tid)); defer pt.deactivate(); - pt.astGenFile(file, path_digest) catch |err| switch (err) { + pt.updateFile(file, path_digest) catch |err| switch (err) { error.AnalysisFail => return, else => { pt.reportRetryableAstGenError(src, file_index, err) catch |oom| switch (oom) { @@ -4352,7 +4352,7 @@ fn workerAstGenFile( .importing_file = file_index, .import_tok = item.data.token, } }; - comp.thread_pool.spawnWgId(wg, workerAstGenFile, .{ + comp.thread_pool.spawnWgId(wg, workerUpdateFile, .{ comp, import_result.file, import_result.file_index, imported_path_digest, prog_node, wg, sub_src, }); } @@ -4375,7 +4375,7 @@ fn workerUpdateBuiltinZigFile( }; } -fn workerCheckEmbedFile(tid: usize, comp: *Compilation, ef_index: Zcu.EmbedFile.Index, ef: *Zcu.EmbedFile) void { +fn workerUpdateEmbedFile(tid: usize, comp: *Compilation, ef_index: Zcu.EmbedFile.Index, ef: *Zcu.EmbedFile) void { comp.detectEmbedFileUpdate(@enumFromInt(tid), ef_index, ef) catch |err| switch (err) { error.OutOfMemory => { comp.mutex.lock(); diff --git a/src/Sema.zig b/src/Sema.zig index 19252600f0..97b9fbbaf9 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -6140,7 +6140,7 @@ fn zirCImport(sema: *Sema, parent_block: *Block, inst: Zir.Inst.Index) CompileEr return sema.fail(&child_block, src, "C import failed: {s}", .{@errorName(err)}); const path_digest = zcu.filePathDigest(result.file_index); - pt.astGenFile(result.file, path_digest) catch |err| + pt.updateFile(result.file, path_digest) catch |err| return sema.fail(&child_block, src, "C import failed: {s}", .{@errorName(err)}); try sema.declareDependency(.{ .file = result.file_index }); diff --git a/src/Zcu.zig b/src/Zcu.zig index 0ce43ce78d..f0262a1462 100644 --- a/src/Zcu.zig +++ b/src/Zcu.zig @@ -785,7 +785,7 @@ pub const File = struct { // Here we do not modify stat fields because this function is the one // used for error reporting. We need to keep the stat fields stale so that - // astGenFile can know to regenerate ZIR. + // updateFile can know to regenerate ZIR. file.source = source; errdefer comptime unreachable; // don't error after populating `source` diff --git a/src/Zcu/PerThread.zig b/src/Zcu/PerThread.zig index cc323c4ac0..d45092ad7d 100644 --- a/src/Zcu/PerThread.zig +++ b/src/Zcu/PerThread.zig @@ -73,7 +73,7 @@ pub fn destroyFile(pt: Zcu.PerThread, file_index: Zcu.File.Index) void { if (!is_builtin) gpa.destroy(file); } -pub fn astGenFile( +pub fn updateFile( pt: Zcu.PerThread, file: *Zcu.File, path_digest: Cache.BinDigest, |
