authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-12-24 21:51:11-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-01-01 17:51:21-07:00
log98dd4f7847c0d50c3367a3bf12a80d5bf7b1fed2
tree56f48736f2245f42f727c921d4fa024757f5bd41
parent4f8a44cd0f636f3ffe008b2cedafa1e51a4a3796

frontend: skip astgen for builtin.zig

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

2 files changed, 5 insertions(+), 4 deletions(-)

src/Compilation.zig+3-4
...@@ -2131,11 +2131,10 @@ pub fn update(comp: *Compilation, main_progress_node: *std.Progress.Node) !void...@@ -2131,11 +2131,10 @@ pub fn update(comp: *Compilation, main_progress_node: *std.Progress.Node) !void
2131 // Put a work item in for every known source file to detect if2131 // Put a work item in for every known source file to detect if
2132 // it changed, and, if so, re-compute ZIR and then queue the job2132 // it changed, and, if so, re-compute ZIR and then queue the job
2133 // to update it.2133 // to update it.
2134 // We still want AstGen work items for stage1 so that we expose compile errors
2135 // that are implemented in stage2 but not stage1.
2136 try comp.astgen_work_queue.ensureUnusedCapacity(module.import_table.count());2134 try comp.astgen_work_queue.ensureUnusedCapacity(module.import_table.count());
2137 for (module.import_table.values()) |value| {2135 for (module.import_table.values()) |file| {
2138 comp.astgen_work_queue.writeItemAssumeCapacity(value);2136 if (file.mod.isBuiltin()) continue;
2137 comp.astgen_work_queue.writeItemAssumeCapacity(file);
2139 }2138 }
21402139
2141 // Put a work item in for checking if any files used with `@embedFile` changed.2140 // Put a work item in for checking if any files used with `@embedFile` changed.
src/Module.zig+2
...@@ -2637,6 +2637,8 @@ comptime {...@@ -2637,6 +2637,8 @@ comptime {
2637}2637}
26382638
2639pub fn astGenFile(mod: *Module, file: *File) !void {2639pub fn astGenFile(mod: *Module, file: *File) !void {
2640 assert(!file.mod.isBuiltin());
2641
2640 const tracy = trace(@src());2642 const tracy = trace(@src());
2641 defer tracy.end();2643 defer tracy.end();
26422644