diff options
| -rw-r--r-- | src/Compilation.zig | 6 | ||||
| -rw-r--r-- | src/Sema.zig | 8 |
2 files changed, 12 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); diff --git a/src/Sema.zig b/src/Sema.zig index ab73c55369..7fdf384904 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -89,6 +89,7 @@ const RangeSet = @import("RangeSet.zig"); const target_util = @import("target.zig"); const Package = @import("Package.zig"); const crash_report = @import("crash_report.zig"); +const build_options = @import("build_options"); pub const InstMap = std.AutoHashMapUnmanaged(Zir.Inst.Index, Air.Inst.Ref); @@ -20808,6 +20809,9 @@ pub fn resolveTypeLayout( src: LazySrcLoc, ty: Type, ) CompileError!void { + if (build_options.omit_stage2) + @panic("sadly stage2 is omitted from this build to save memory on the CI server"); + switch (ty.zigTypeTag()) { .Struct => return sema.resolveStructLayout(block, src, ty), .Union => return sema.resolveUnionLayout(block, src, ty), @@ -20974,6 +20978,8 @@ fn resolveUnionFully( } pub fn resolveTypeFields(sema: *Sema, block: *Block, src: LazySrcLoc, ty: Type) CompileError!Type { + if (build_options.omit_stage2) + @panic("sadly stage2 is omitted from this build to save memory on the CI server"); switch (ty.tag()) { .@"struct" => { const struct_obj = ty.castTag(.@"struct").?.data; @@ -22256,6 +22262,8 @@ fn typePtrOrOptionalPtrTy( /// TODO merge these implementations together with the "advanced"/sema_kit pattern seen /// elsewhere in value.zig pub fn typeRequiresComptime(sema: *Sema, block: *Block, src: LazySrcLoc, ty: Type) CompileError!bool { + if (build_options.omit_stage2) + @panic("sadly stage2 is omitted from this build to save memory on the CI server"); return switch (ty.tag()) { .u1, .u8, |
