Skip to content

Commit e5041ea

Browse files
committed
frontend: remove deprecated field from Compilation
1 parent 3384749 commit e5041ea

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

src/Compilation.zig

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ const c_codegen = @import("codegen/c.zig");
3535
const libtsan = @import("libtsan.zig");
3636
const Zir = @import("Zir.zig");
3737
const Autodoc = @import("Autodoc.zig");
38-
const Color = @import("main.zig").Color;
3938
const resinator = @import("resinator.zig");
4039
const Builtin = @import("Builtin.zig");
4140

@@ -197,10 +196,6 @@ glibc_so_files: ?glibc.BuiltSharedObjects = null,
197196
/// The key is the basename, and the value is the absolute path to the completed build artifact.
198197
crt_files: std.StringHashMapUnmanaged(CRTFile) = .{},
199198

200-
/// This is for stage1 and should be deleted upon completion of self-hosting.
201-
/// Don't use this for anything other than stage1 compatibility.
202-
color: Color = .auto,
203-
204199
/// How many lines of reference trace should be included per compile error.
205200
/// Null means only show snippet on first error.
206201
reference_trace: ?u32 = null,
@@ -1077,8 +1072,6 @@ pub const InitOptions = struct {
10771072
libc_installation: ?*const LibCInstallation = null,
10781073
native_system_include_paths: []const []const u8 = &.{},
10791074
clang_preprocessor_mode: ClangPreprocessorMode = .no,
1080-
/// This is for stage1 and should be deleted upon completion of self-hosting.
1081-
color: Color = .auto,
10821075
reference_trace: ?u32 = null,
10831076
test_filter: ?[]const u8 = null,
10841077
test_name_prefix: ?[]const u8 = null,
@@ -1490,7 +1483,6 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
14901483
.verbose_llvm_cpu_features = options.verbose_llvm_cpu_features,
14911484
.verbose_link = options.verbose_link,
14921485
.disable_c_depfile = options.disable_c_depfile,
1493-
.color = options.color,
14941486
.reference_trace = options.reference_trace,
14951487
.formatted_panics = formatted_panics,
14961488
.time_report = options.time_report,

src/main.zig

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3220,7 +3220,6 @@ fn buildOutputType(
32203220
.verbose_llvm_bc = verbose_llvm_bc,
32213221
.verbose_cimport = verbose_cimport,
32223222
.verbose_llvm_cpu_features = verbose_llvm_cpu_features,
3223-
.color = color,
32243223
.time_report = time_report,
32253224
.stack_report = stack_report,
32263225
.each_lib_rpath = each_lib_rpath,
@@ -3323,7 +3322,7 @@ fn buildOutputType(
33233322
return cmdTranslateC(comp, arena, null);
33243323
}
33253324

3326-
updateModule(comp) catch |err| switch (err) {
3325+
updateModule(comp, color) catch |err| switch (err) {
33273326
error.SemanticAnalyzeFail => {
33283327
assert(listen == .none);
33293328
saveState(comp, debug_incremental);
@@ -4436,13 +4435,13 @@ fn runOrTestHotSwap(
44364435
}
44374436
}
44384437

4439-
fn updateModule(comp: *Compilation) !void {
4438+
fn updateModule(comp: *Compilation, color: Color) !void {
44404439
{
44414440
// If the terminal is dumb, we dont want to show the user all the output.
44424441
var progress: std.Progress = .{ .dont_print_on_dumb = true };
44434442
const main_progress_node = progress.start("", 0);
44444443
defer main_progress_node.end();
4445-
switch (comp.color) {
4444+
switch (color) {
44464445
.off => {
44474446
progress.terminal = null;
44484447
},
@@ -4460,13 +4459,14 @@ fn updateModule(comp: *Compilation) !void {
44604459
defer errors.deinit(comp.gpa);
44614460

44624461
if (errors.errorMessageCount() > 0) {
4463-
errors.renderToStdErr(renderOptions(comp.color));
4462+
errors.renderToStdErr(renderOptions(color));
44644463
return error.SemanticAnalyzeFail;
44654464
}
44664465
}
44674466

44684467
fn cmdTranslateC(comp: *Compilation, arena: Allocator, fancy_output: ?*Compilation.CImportResult) !void {
44694468
if (build_options.only_core_functionality) @panic("@translate-c is not available in a zig2.c build");
4469+
const color: Color = .auto;
44704470
assert(comp.c_source_files.len == 1);
44714471
const c_source_file = comp.c_source_files[0];
44724472

@@ -4559,7 +4559,7 @@ fn cmdTranslateC(comp: *Compilation, arena: Allocator, fancy_output: ?*Compilati
45594559
p.errors = errors;
45604560
return;
45614561
} else {
4562-
errors.renderToStdErr(renderOptions(comp.color));
4562+
errors.renderToStdErr(renderOptions(color));
45634563
process.exit(1);
45644564
}
45654565
},
@@ -5534,7 +5534,7 @@ pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi
55345534
};
55355535
defer comp.destroy();
55365536

5537-
updateModule(comp) catch |err| switch (err) {
5537+
updateModule(comp, color) catch |err| switch (err) {
55385538
error.SemanticAnalyzeFail => process.exit(2),
55395539
else => |e| return e,
55405540
};

0 commit comments

Comments
 (0)