authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-11-21 17:07:18-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-11-21 17:07:18-07:00
log96e5f661bd34d98bba89bcb70c9db059aaf38641
treea33fe1d585b30e430175ae108c9e355d983cbc6b
parentceeb230c23e0665811956657157561170be54519

zig cc: add -fcolor-diagnostics and -fcaret-diagnostics integration

Closes #6290

3 files changed, 54 insertions(+), 6 deletions(-)

src/clang_options_data.zig+32-4
......@@ -2569,12 +2569,26 @@ flagpd1("fcall-saved-x18"),
25692569flagpd1("fcall-saved-x8"),
25702570flagpd1("fcall-saved-x9"),
25712571flagpd1("fcaller-saves"),
2572flagpd1("fcaret-diagnostics"),
2572.{
2573 .name = "fcaret-diagnostics",
2574 .syntax = .flag,
2575 .zig_equivalent = .color_diagnostics,
2576 .pd1 = true,
2577 .pd2 = false,
2578 .psl = false,
2579},
25732580sepd1("fcaret-diagnostics-max-lines"),
25742581flagpd1("fcf-protection"),
25752582flagpd1("fchar8_t"),
25762583flagpd1("fcheck-array-temporaries"),
2577flagpd1("fcolor-diagnostics"),
2584.{
2585 .name = "fcolor-diagnostics",
2586 .syntax = .flag,
2587 .zig_equivalent = .color_diagnostics,
2588 .pd1 = true,
2589 .pd2 = false,
2590 .psl = false,
2591},
25782592flagpd1("fcommon"),
25792593flagpd1("fcompatibility-qualified-id-block-type-checking"),
25802594flagpd1("fcomplete-member-pointers"),
......@@ -2937,10 +2951,24 @@ flagpd1("fno-bounds-check"),
29372951flagpd1("fno-branch-count-reg"),
29382952flagpd1("fno-builtin"),
29392953flagpd1("fno-caller-saves"),
2940flagpd1("fno-caret-diagnostics"),
2954.{
2955 .name = "fno-caret-diagnostics",
2956 .syntax = .flag,
2957 .zig_equivalent = .no_color_diagnostics,
2958 .pd1 = true,
2959 .pd2 = false,
2960 .psl = false,
2961},
29412962flagpd1("fno-char8_t"),
29422963flagpd1("fno-check-array-temporaries"),
2943flagpd1("fno-color-diagnostics"),
2964.{
2965 .name = "fno-color-diagnostics",
2966 .syntax = .flag,
2967 .zig_equivalent = .no_color_diagnostics,
2968 .pd1 = true,
2969 .pd2 = false,
2970 .psl = false,
2971},
29442972flagpd1("fno-common"),
29452973flagpd1("fno-complete-member-pointers"),
29462974flagpd1("fno-concept-satisfaction-caching"),
src/main.zig+6-2
......@@ -1292,6 +1292,8 @@ fn buildOutputType(
12921292 .no_omit_frame_pointer => omit_frame_pointer = false,
12931293 .function_sections => function_sections = true,
12941294 .no_function_sections => function_sections = false,
1295 .color_diagnostics => color = .on,
1296 .no_color_diagnostics => color = .off,
12951297 .unwind_tables => want_unwind_tables = true,
12961298 .no_unwind_tables => want_unwind_tables = false,
12971299 .nostdlib => ensure_libc_on_non_freestanding = false,
......@@ -3820,11 +3822,13 @@ pub const ClangArgIterator = struct {
38203822 no_red_zone,
38213823 omit_frame_pointer,
38223824 no_omit_frame_pointer,
3825 function_sections,
3826 no_function_sections,
3827 color_diagnostics,
3828 no_color_diagnostics,
38233829 strip,
38243830 exec_model,
38253831 emit_llvm,
3826 function_sections,
3827 no_function_sections,
38283832 };
38293833
38303834 const Args = struct {
tools/update_clang_options.zig+16
......@@ -316,6 +316,22 @@ const known_options = [_]KnownOpt{
316316 .name = "fno-function-sections",
317317 .ident = "no_function_sections",
318318 },
319 .{
320 .name = "fcolor-diagnostics",
321 .ident = "color_diagnostics",
322 },
323 .{
324 .name = "fno-color-diagnostics",
325 .ident = "no_color_diagnostics",
326 },
327 .{
328 .name = "fcaret-diagnostics",
329 .ident = "color_diagnostics",
330 },
331 .{
332 .name = "fno-caret-diagnostics",
333 .ident = "no_color_diagnostics",
334 },
319335 .{
320336 .name = "MD",
321337 .ident = "dep_file",