diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-08-07 18:17:31 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-08-19 16:45:15 -0700 |
| commit | 73bbd1069a993a0e663033ea3b8cd4ed1a123566 (patch) | |
| tree | 1e2b148425da2359d720d6d5048ad94151788bb9 /src | |
| parent | 39f43fea8d0f6aa1c69cb7c3209f57f5ce00b273 (diff) | |
| download | zig-73bbd1069a993a0e663033ea3b8cd4ed1a123566.tar.gz zig-73bbd1069a993a0e663033ea3b8cd4ed1a123566.zip | |
build: remove the option to omit stage2
Diffstat (limited to 'src')
| -rw-r--r-- | src/Compilation.zig | 29 | ||||
| -rw-r--r-- | src/Sema.zig | 7 | ||||
| -rw-r--r-- | src/config.zig.in | 1 |
3 files changed, 2 insertions, 35 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 060afba694..6d778b955a 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1044,8 +1044,6 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { // Even though we may have no Zig code to compile (depending on `options.main_pkg`), // we may need to use stage1 for building compiler-rt and other dependencies. - if (build_options.omit_stage2) - break :blk true; if (options.use_llvm) |use_llvm| { if (!use_llvm) { break :blk false; @@ -2213,8 +2211,7 @@ pub fn update(comp: *Compilation) !void { comp.c_object_work_queue.writeItemAssumeCapacity(key); } - const use_stage1 = build_options.omit_stage2 or - (build_options.is_stage1 and comp.bin_file.options.use_stage1); + const use_stage1 = 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; @@ -2390,8 +2387,7 @@ fn flush(comp: *Compilation, prog_node: *std.Progress.Node) !void { }; comp.link_error_flags = comp.bin_file.errorFlags(); - const use_stage1 = build_options.omit_stage2 or - (build_options.is_stage1 and comp.bin_file.options.use_stage1); + const use_stage1 = 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); @@ -2952,9 +2948,6 @@ pub fn performAllTheWork( fn processOneJob(comp: *Compilation, job: Job) !void { switch (job) { .codegen_decl => |decl_index| { - if (build_options.omit_stage2) - @panic("sadly stage2 is omitted from this build to save memory on the CI server"); - const module = comp.bin_file.options.module.?; const decl = module.declPtr(decl_index); @@ -2989,9 +2982,6 @@ fn processOneJob(comp: *Compilation, job: Job) !void { } }, .codegen_func => |func| { - if (build_options.omit_stage2) - @panic("sadly stage2 is omitted from this build to save memory on the CI server"); - const named_frame = tracy.namedFrame("codegen_func"); defer named_frame.end(); @@ -3002,9 +2992,6 @@ fn processOneJob(comp: *Compilation, job: Job) !void { }; }, .emit_h_decl => |decl_index| { - if (build_options.omit_stage2) - @panic("sadly stage2 is omitted from this build to save memory on the CI server"); - const module = comp.bin_file.options.module.?; const decl = module.declPtr(decl_index); @@ -3063,9 +3050,6 @@ fn processOneJob(comp: *Compilation, job: Job) !void { } }, .analyze_decl => |decl_index| { - if (build_options.omit_stage2) - @panic("sadly stage2 is omitted from this build to save memory on the CI server"); - const module = comp.bin_file.options.module.?; module.ensureDeclAnalyzed(decl_index) catch |err| switch (err) { error.OutOfMemory => return error.OutOfMemory, @@ -3073,9 +3057,6 @@ fn processOneJob(comp: *Compilation, job: Job) !void { }; }, .update_embed_file => |embed_file| { - if (build_options.omit_stage2) - @panic("sadly stage2 is omitted from this build to save memory on the CI server"); - const named_frame = tracy.namedFrame("update_embed_file"); defer named_frame.end(); @@ -3086,9 +3067,6 @@ fn processOneJob(comp: *Compilation, job: Job) !void { }; }, .update_line_number => |decl_index| { - if (build_options.omit_stage2) - @panic("sadly stage2 is omitted from this build to save memory on the CI server"); - const named_frame = tracy.namedFrame("update_line_number"); defer named_frame.end(); @@ -3107,9 +3085,6 @@ fn processOneJob(comp: *Compilation, job: Job) !void { }; }, .analyze_pkg => |pkg| { - if (build_options.omit_stage2) - @panic("sadly stage2 is omitted from this build to save memory on the CI server"); - const named_frame = tracy.namedFrame("analyze_pkg"); defer named_frame.end(); diff --git a/src/Sema.zig b/src/Sema.zig index 091b88e719..aa02288df7 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -27358,9 +27358,6 @@ 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), @@ -27699,8 +27696,6 @@ 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; @@ -29323,8 +29318,6 @@ 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, diff --git a/src/config.zig.in b/src/config.zig.in index a886b2d28e..336a6c45ed 100644 --- a/src/config.zig.in +++ b/src/config.zig.in @@ -10,4 +10,3 @@ pub const enable_tracy = false; pub const value_tracing = false; pub const is_stage1 = true; pub const skip_non_native = false; -pub const omit_stage2: bool = @ZIG_OMIT_STAGE2_BOOL@; |
