aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-03-23 13:02:42 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-03-23 13:24:55 -0700
commit2f9264d8dcedba3a75dcf9d6a31b82447dfc57e8 (patch)
treee99e6840d2b53f7bbbc20480eac2ec4bec0afe9e /src/Compilation.zig
parent2e0de0b4e20794c07fad76c657ad2c33f1928562 (diff)
downloadzig-2f9264d8dcedba3a75dcf9d6a31b82447dfc57e8.tar.gz
zig-2f9264d8dcedba3a75dcf9d6a31b82447dfc57e8.zip
stage2: fix -Domit-stage2 regression
This flag is used when building stage1 to omit the stage2 backends from the compiler to save memory on the CI server. It regressed with the merging of e8813b296bc55a13b534bd9b2a03e1f6af366915 because Value functions started calling into Sema functions. The end goal for this build option is to eliminate it.
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index e8b1ebb145..6487273e1f 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -2042,7 +2042,8 @@ pub fn update(comp: *Compilation) !void {
comp.c_object_work_queue.writeItemAssumeCapacity(key);
}
- const use_stage1 = build_options.is_stage1 and comp.bin_file.options.use_stage1;
+ const use_stage1 = build_options.omit_stage2 or
+ (build_options.is_stage1 and comp.bin_file.options.use_stage1);
if (comp.bin_file.options.module) |module| {
module.compile_log_text.shrinkAndFree(module.gpa, 0);
module.generation += 1;
@@ -2198,7 +2199,8 @@ fn flush(comp: *Compilation) !void {
try comp.bin_file.flush(comp); // This is needed before reading the error flags.
comp.link_error_flags = comp.bin_file.errorFlags();
- const use_stage1 = build_options.is_stage1 and comp.bin_file.options.use_stage1;
+ const use_stage1 = build_options.omit_stage2 or
+ (build_options.is_stage1 and comp.bin_file.options.use_stage1);
if (!use_stage1) {
if (comp.bin_file.options.module) |module| {
try link.File.C.flushEmitH(module);