motiejus/zig

fork of https://codeberg.org/ziglang/zig
git clone https://git.jakstys.lt/motiejus/zig.git
Log | Tree | Refs | README | LICENSE

commit 98dd4f7847c0d50c3367a3bf12a80d5bf7b1fed2 (tree)
parent 4f8a44cd0f636f3ffe008b2cedafa1e51a4a3796
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Sun, 24 Dec 2023 21:51:11 -0700

frontend: skip astgen for builtin.zig

since it's already done ahead of time and always unchanging

Diffstat:
Msrc/Compilation.zig | 7+++----
Msrc/Module.zig | 2++
2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/Compilation.zig b/src/Compilation.zig @@ -2131,11 +2131,10 @@ pub fn update(comp: *Compilation, main_progress_node: *std.Progress.Node) !void // Put a work item in for every known source file to detect if // it changed, and, if so, re-compute ZIR and then queue the job // to update it. - // We still want AstGen work items for stage1 so that we expose compile errors - // that are implemented in stage2 but not stage1. try comp.astgen_work_queue.ensureUnusedCapacity(module.import_table.count()); - for (module.import_table.values()) |value| { - comp.astgen_work_queue.writeItemAssumeCapacity(value); + for (module.import_table.values()) |file| { + if (file.mod.isBuiltin()) continue; + comp.astgen_work_queue.writeItemAssumeCapacity(file); } // Put a work item in for checking if any files used with `@embedFile` changed. diff --git a/src/Module.zig b/src/Module.zig @@ -2637,6 +2637,8 @@ comptime { } pub fn astGenFile(mod: *Module, file: *File) !void { + assert(!file.mod.isBuiltin()); + const tracy = trace(@src()); defer tracy.end();