aboutsummaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-12-26 20:32:40 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-01-01 17:51:21 -0700
commitc9fe43679f8d8f0db6250cc881b59cc68daaf128 (patch)
tree9bb9762bd3330f8da870efeaa53a5a544ad7274e /src/main.zig
parent6beae6c061a650ea2d695e6902683641df920aa8 (diff)
downloadzig-c9fe43679f8d8f0db6250cc881b59cc68daaf128.tar.gz
zig-c9fe43679f8d8f0db6250cc881b59cc68daaf128.zip
frontend: remove deprecated field from Compilation
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main.zig b/src/main.zig
index 16bd32b45e..0822557158 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -3220,7 +3220,6 @@ fn buildOutputType(
.verbose_llvm_bc = verbose_llvm_bc,
.verbose_cimport = verbose_cimport,
.verbose_llvm_cpu_features = verbose_llvm_cpu_features,
- .color = color,
.time_report = time_report,
.stack_report = stack_report,
.each_lib_rpath = each_lib_rpath,
@@ -3323,7 +3322,7 @@ fn buildOutputType(
return cmdTranslateC(comp, arena, null);
}
- updateModule(comp) catch |err| switch (err) {
+ updateModule(comp, color) catch |err| switch (err) {
error.SemanticAnalyzeFail => {
assert(listen == .none);
saveState(comp, debug_incremental);
@@ -4436,13 +4435,13 @@ fn runOrTestHotSwap(
}
}
-fn updateModule(comp: *Compilation) !void {
+fn updateModule(comp: *Compilation, color: Color) !void {
{
// If the terminal is dumb, we dont want to show the user all the output.
var progress: std.Progress = .{ .dont_print_on_dumb = true };
const main_progress_node = progress.start("", 0);
defer main_progress_node.end();
- switch (comp.color) {
+ switch (color) {
.off => {
progress.terminal = null;
},
@@ -4460,13 +4459,14 @@ fn updateModule(comp: *Compilation) !void {
defer errors.deinit(comp.gpa);
if (errors.errorMessageCount() > 0) {
- errors.renderToStdErr(renderOptions(comp.color));
+ errors.renderToStdErr(renderOptions(color));
return error.SemanticAnalyzeFail;
}
}
fn cmdTranslateC(comp: *Compilation, arena: Allocator, fancy_output: ?*Compilation.CImportResult) !void {
if (build_options.only_core_functionality) @panic("@translate-c is not available in a zig2.c build");
+ const color: Color = .auto;
assert(comp.c_source_files.len == 1);
const c_source_file = comp.c_source_files[0];
@@ -4559,7 +4559,7 @@ fn cmdTranslateC(comp: *Compilation, arena: Allocator, fancy_output: ?*Compilati
p.errors = errors;
return;
} else {
- errors.renderToStdErr(renderOptions(comp.color));
+ errors.renderToStdErr(renderOptions(color));
process.exit(1);
}
},
@@ -5533,7 +5533,7 @@ pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi
};
defer comp.destroy();
- updateModule(comp) catch |err| switch (err) {
+ updateModule(comp, color) catch |err| switch (err) {
error.SemanticAnalyzeFail => process.exit(2),
else => |e| return e,
};