From a4eaeee72011a2f7866a18420812178991feaf8d Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 21 Mar 2020 10:12:28 -0400 Subject: [PATCH 1/6] ability to use `zig cc` as a drop-in C compiler The basics are working --- src-self-hosted/clang_options.zig | 126 + src-self-hosted/clang_options_data.zig | 5632 ++++++++++++++++++++++++ src-self-hosted/stage2.zig | 155 + src/codegen.cpp | 2 +- src/error.cpp | 1 + src/link.cpp | 2 +- src/main.cpp | 56 +- src/stage2.cpp | 12 + src/stage2.h | 31 + tools/process_headers.zig | 22 +- tools/update_clang_options.zig | 274 ++ 11 files changed, 6295 insertions(+), 18 deletions(-) create mode 100644 src-self-hosted/clang_options.zig create mode 100644 src-self-hosted/clang_options_data.zig create mode 100644 tools/update_clang_options.zig diff --git a/src-self-hosted/clang_options.zig b/src-self-hosted/clang_options.zig new file mode 100644 index 0000000000..9fa35b8f9a --- /dev/null +++ b/src-self-hosted/clang_options.zig @@ -0,0 +1,126 @@ +const std = @import("std"); +const mem = std.mem; + +pub const list = @import("clang_options_data.zig").data; + +pub const CliArg = struct { + name: []const u8, + syntax: Syntax, + + /// TODO we're going to want to change this when we start shipping self-hosted because this causes + /// all the functions in stage2.zig to get exported. + zig_equivalent: @import("stage2.zig").ClangArgIterator.ZigEquivalent, + + /// Prefixed by "-" + pd1: bool = false, + + /// Prefixed by "--" + pd2: bool = false, + + /// Prefixed by "/" + psl: bool = false, + + const Syntax = union(enum) { + /// A flag with no values. + flag, + + /// An option which prefixes its (single) value. + joined, + + /// An option which is followed by its value. + separate, + + /// An option which is either joined to its (non-empty) value, or followed by its value. + joined_or_separate, + + /// An option which is both joined to its (first) value, and followed by its (second) value. + joined_and_separate, + + /// An option followed by its values, which are separated by commas. + comma_joined, + + /// An option which consumes an optional joined argument and any other remaining arguments. + remaining_args_joined, + + /// An option which is which takes multiple (separate) arguments. + multi_arg: u8, + }; + + fn matchEql(self: CliArg, arg: []const u8) bool { + if (self.pd1 and arg.len >= self.name.len + 1 and + mem.startsWith(u8, arg, "-") and mem.eql(u8, arg[1..], self.name)) + { + return true; + } + if (self.pd2 and arg.len >= self.name.len + 2 and + mem.startsWith(u8, arg, "--") and mem.eql(u8, arg[2..], self.name)) + { + return true; + } + if (self.psl and arg.len >= self.name.len + 1 and + mem.startsWith(u8, arg, "/") and mem.eql(u8, arg[1..], self.name)) + { + return true; + } + return false; + } + + fn matchStartsWith(self: CliArg, arg: []const u8) usize { + if (self.pd1 and arg.len >= self.name.len + 1 and + mem.startsWith(u8, arg, "-") and mem.startsWith(u8, arg[1..], self.name)) + { + return self.name.len + 1; + } + if (self.pd2 and arg.len >= self.name.len + 2 and + mem.startsWith(u8, arg, "--") and mem.startsWith(u8, arg[2..], self.name)) + { + return self.name.len + 2; + } + if (self.psl and arg.len >= self.name.len + 1 and + mem.startsWith(u8, arg, "/") and mem.startsWith(u8, arg[1..], self.name)) + { + return self.name.len + 1; + } + return 0; + } +}; + +/// Shortcut function for initializing a `CliArg` +pub fn flagpd1(name: []const u8) CliArg { + return .{ + .name = name, + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + }; +} + +/// Shortcut function for initializing a `CliArg` +pub fn joinpd1(name: []const u8) CliArg { + return .{ + .name = name, + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + }; +} + +/// Shortcut function for initializing a `CliArg` +pub fn jspd1(name: []const u8) CliArg { + return .{ + .name = name, + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + }; +} + +/// Shortcut function for initializing a `CliArg` +pub fn sepd1(name: []const u8) CliArg { + return .{ + .name = name, + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = true, + }; +} diff --git a/src-self-hosted/clang_options_data.zig b/src-self-hosted/clang_options_data.zig new file mode 100644 index 0000000000..a88f3583c9 --- /dev/null +++ b/src-self-hosted/clang_options_data.zig @@ -0,0 +1,5632 @@ +// This file is generated by tools/update_clang_options.zig. +// zig fmt: off +usingnamespace @import("clang_options.zig"); +pub const data = blk: { @setEvalBranchQuota(6000); break :blk &[_]CliArg{ +jspd1("A"), +joinpd1("A-"), +jspd1("B"), +flagpd1("C"), +flagpd1("CC"), +jspd1("D"), +flagpd1("E"), +flagpd1("EB"), +flagpd1("EL"), +flagpd1("Eonly"), +jspd1("F"), +jspd1("G"), +joinpd1("G="), +flagpd1("H"), +jspd1("I"), +.{ + .name = "", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = false, + .psl = false, +}, +flagpd1("I-"), +jspd1("J"), +jspd1("L"), +flagpd1("M"), +flagpd1("MD"), +jspd1("MF"), +flagpd1("MG"), +jspd1("MJ"), +flagpd1("MM"), +flagpd1("MMD"), +flagpd1("MP"), +jspd1("MQ"), +jspd1("MT"), +flagpd1("MV"), +flagpd1("Mach"), +joinpd1("O"), +flagpd1("O0"), +flagpd1("O4"), +flagpd1("O"), +flagpd1("ObjC"), +flagpd1("ObjC++"), +joinpd1("Ofast"), +flagpd1("P"), +flagpd1("Q"), +flagpd1("Qn"), +flagpd1("Qunused-arguments"), +flagpd1("Qy"), +joinpd1("R"), +joinpd1("Rpass="), +joinpd1("Rpass-analysis="), +joinpd1("Rpass-missed="), +flagpd1("S"), +jspd1("T"), +jspd1("Tbss"), +jspd1("Tdata"), +jspd1("Ttext"), +jspd1("U"), +.{ + .name = "", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = false, + .psl = false, +}, +jspd1("V"), +flagpd1("WCL4"), +joinpd1("W"), +.{ + .name = "Wa,", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +flagpd1("Wall"), +flagpd1("Wdeprecated"), +joinpd1("Wframe-larger-than="), +.{ + .name = "Wl,", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +joinpd1("Wlarge-by-value-copy="), +flagpd1("Wlarge-by-value-copy"), +joinpd1("Wlarger-than-"), +joinpd1("Wlarger-than="), +flagpd1("Wno-deprecated"), +joinpd1("Wno-nonportable-cfstrings"), +flagpd1("Wno-rewrite-macros"), +flagpd1("Wno-write-strings"), +joinpd1("Wnonportable-cfstrings"), +.{ + .name = "Wp,", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +flagpd1("Wwrite-strings"), +flagpd1("X"), +joinpd1("X"), +sepd1("Xanalyzer"), +.{ + .name = "Xarch_", + .syntax = .joined_and_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +sepd1("Xassembler"), +sepd1("Xclang"), +sepd1("Xcuda-fatbinary"), +sepd1("Xcuda-ptxas"), +sepd1("Xlinker"), +sepd1("Xopenmp-target"), +.{ + .name = "Xopenmp-target=", + .syntax = .joined_and_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +sepd1("Xpreprocessor"), +flagpd1("Z"), +joinpd1("Z"), +flagpd1("Z-Xlinker-no-demangle"), +flagpd1("Z-reserved-lib-cckext"), +flagpd1("Z-reserved-lib-stdc++"), +sepd1("Zlinker-input"), +.{ + .name = "CLASSPATH", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "CLASSPATH=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +flagpd1("###"), +.{ + .name = "AI", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Brepro", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Brepro-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Bt", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Bt+", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "C", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "D", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "E", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "EH", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "EP", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "F", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "FA", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "FA", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "FC", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "FI", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "FR", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "FS", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "FU", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Fa", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Fd", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Fe", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Fi", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Fm", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Fo", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Fp", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Fr", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Fx", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "G1", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "G2", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "GA", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "GF", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "GF-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "GH", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "GL", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "GL-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "GR", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "GR-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "GS", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "GS-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "GT", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "GX", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "GX-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "GZ", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Gd", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Ge", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Gh", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Gm", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Gm-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Gr", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Gregcall", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Gs", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Gv", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Gw", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Gw-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Gy", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Gy-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Gz", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "H", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "HELP", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "I", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "J", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "JMC", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "LD", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "LDd", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "LN", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "MD", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "MDd", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "MP", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "MT", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "MTd", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "O", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "P", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "QIfist", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "?", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Qfast_transcendentals", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Qimprecise_fwaits", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Qpar", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Qpar-report", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Qsafe_fp_loads", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Qspectre", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Qvec", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Qvec-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Qvec-report", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "RTC", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "TC", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "TP", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Tc", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Tp", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "U", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "V", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "W0", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "W1", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "W2", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "W3", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "W4", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "WL", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "WX", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "WX-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Wall", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Wp64", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "X", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Y-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Yc", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Yd", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Yl", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Yu", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Z7", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "ZH:MD5", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "ZH:SHA1", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "ZH:SHA_256", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "ZI", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "ZW", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Za", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:__cplusplus", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:alignedNew", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:alignedNew-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:auto", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:char8_t", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:char8_t-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:dllexportInlines", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:dllexportInlines-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:forScope", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:inline", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:rvalueCast", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:sizedDealloc", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:sizedDealloc-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:strictStrings", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:ternary", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:threadSafeInit", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:threadSafeInit-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:trigraphs", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:trigraphs-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:twoPhase", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:twoPhase-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:wchar_t", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zd", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Ze", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zg", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zi", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zl", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zm", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zo", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zo-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zp", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zp", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zs", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "analyze-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "arch:", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "await", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "bigobj", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "c", + .syntax = .flag, + .zig_equivalent = .c, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "cgthreads", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "clang:", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "clr", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "constexpr:", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "d1PP", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "d1reportAllClassLayout", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "d2", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "d2FastFail", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "d2Zi+", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "diagnostics:caret", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "diagnostics:classic", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "diagnostics:column", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "doc", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "errorReport", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "execution-charset:", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "fallback", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "favor", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "fp:except", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "fp:except-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "fp:fast", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "fp:precise", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "fp:strict", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "guard:", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "help", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "homeparams", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "hotpatch", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "imsvc", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "kernel", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "kernel-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "link", + .syntax = .remaining_args_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "nologo", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "o", + .syntax = .joined_or_separate, + .zig_equivalent = .o, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "openmp", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "openmp-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "openmp:experimental", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "permissive-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "sdl", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "sdl-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "showFilenames", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "showFilenames-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "showIncludes", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "source-charset:", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "std:", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "u", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "utf-8", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "validate-charset", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "validate-charset-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "vd", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "vmb", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "vmg", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "vmm", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "vms", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "vmv", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "volatile:iso", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "volatile:ms", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "w", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "w", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "wd4005", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "wd4018", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "wd4100", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "wd4910", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "wd4996", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "all-warnings", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "analyze", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "analyzer-no-default-checks", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "analyzer-output", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "assemble", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "assert", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "assert=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "bootclasspath", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "bootclasspath=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "classpath", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "classpath=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "comments", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "comments-in-macros", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "compile", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "constant-cfstrings", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "debug", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "debug=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "define-macro", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "define-macro=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "dependencies", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "dyld-prefix", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "dyld-prefix=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "encoding", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "encoding=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "entry", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "extdirs", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "extdirs=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "extra-warnings", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "for-linker", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "for-linker=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "force-link", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "force-link=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "help-hidden", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "imacros=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "include=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "include-barrier", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "include-directory", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "include-directory=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "include-directory-after", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "include-directory-after=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "include-prefix", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "include-prefix=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "include-with-prefix", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "include-with-prefix=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "include-with-prefix-after", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "include-with-prefix-after=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "include-with-prefix-before", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "include-with-prefix-before=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "language", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "language=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "library-directory", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "library-directory=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "mhwdiv", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "mhwdiv=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "migrate", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "no-line-commands", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "no-standard-includes", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "no-standard-libraries", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "no-undefined", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "no-warnings", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "optimize", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "optimize=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "output", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "output=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "output-class-directory", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "output-class-directory=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "param", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "param=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "precompile", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "prefix", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "prefix=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "preprocess", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "print-diagnostic-categories", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "print-file-name", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "print-missing-file-dependencies", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "print-prog-name", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "profile", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "profile-blocks", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "resource", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "resource=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "rtlib", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "serialize-diagnostics", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "signed-char", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "std", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "stdlib", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "sysroot", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "sysroot=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "target-help", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "trace-includes", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "undefine-macro", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "undefine-macro=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "unsigned-char", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "user-dependencies", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "verbose", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "version", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "warn-", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "warn-=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "write-dependencies", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "write-user-dependencies", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("a"), +sepd1("add-plugin"), +flagpd1("faggressive-function-elimination"), +flagpd1("fno-aggressive-function-elimination"), +flagpd1("falign-commons"), +flagpd1("fno-align-commons"), +flagpd1("falign-jumps"), +flagpd1("fno-align-jumps"), +flagpd1("falign-labels"), +flagpd1("fno-align-labels"), +flagpd1("falign-loops"), +flagpd1("fno-align-loops"), +flagpd1("faligned-alloc-unavailable"), +flagpd1("all_load"), +flagpd1("fall-intrinsics"), +flagpd1("fno-all-intrinsics"), +sepd1("allowable_client"), +flagpd1("cfg-add-implicit-dtors"), +flagpd1("unoptimized-cfg"), +flagpd1("analyze"), +sepd1("analyze-function"), +joinpd1("analyze-function="), +sepd1("analyzer-checker"), +joinpd1("analyzer-checker="), +flagpd1("analyzer-checker-help"), +flagpd1("analyzer-checker-help-alpha"), +flagpd1("analyzer-checker-help-developer"), +flagpd1("analyzer-checker-option-help"), +flagpd1("analyzer-checker-option-help-alpha"), +flagpd1("analyzer-checker-option-help-developer"), +sepd1("analyzer-config"), +sepd1("analyzer-config-compatibility-mode"), +joinpd1("analyzer-config-compatibility-mode="), +flagpd1("analyzer-config-help"), +sepd1("analyzer-constraints"), +joinpd1("analyzer-constraints="), +flagpd1("analyzer-disable-all-checks"), +sepd1("analyzer-disable-checker"), +joinpd1("analyzer-disable-checker="), +flagpd1("analyzer-disable-retry-exhausted"), +flagpd1("analyzer-display-progress"), +sepd1("analyzer-dump-egraph"), +joinpd1("analyzer-dump-egraph="), +sepd1("analyzer-inline-max-stack-depth"), +joinpd1("analyzer-inline-max-stack-depth="), +sepd1("analyzer-inlining-mode"), +joinpd1("analyzer-inlining-mode="), +flagpd1("analyzer-list-enabled-checkers"), +sepd1("analyzer-max-loop"), +flagpd1("analyzer-opt-analyze-headers"), +flagpd1("analyzer-opt-analyze-nested-blocks"), +sepd1("analyzer-output"), +joinpd1("analyzer-output="), +sepd1("analyzer-purge"), +joinpd1("analyzer-purge="), +flagpd1("analyzer-stats"), +sepd1("analyzer-store"), +joinpd1("analyzer-store="), +flagpd1("analyzer-viz-egraph-graphviz"), +flagpd1("analyzer-werror"), +flagpd1("fslp-vectorize-aggressive"), +flagpd1("fno-slp-vectorize-aggressive"), +flagpd1("fexpensive-optimizations"), +flagpd1("fno-expensive-optimizations"), +flagpd1("fdefer-pop"), +flagpd1("fno-defer-pop"), +flagpd1("fextended-identifiers"), +flagpd1("fno-extended-identifiers"), +flagpd1("fhonor-infinites"), +flagpd1("fno-honor-infinites"), +flagpd1("findirect-virtual-calls"), +sepd1("fnew-alignment"), +joinpd1("objcmt-white-list-dir-path="), +flagpd1("faligned-new"), +flagpd1("fno-aligned-new"), +flagpd1("fsched-interblock"), +flagpd1("ftree-vectorize"), +flagpd1("fno-tree-vectorize"), +flagpd1("ftree-slp-vectorize"), +flagpd1("fno-tree-slp-vectorize"), +flagpd1("fterminated-vtables"), +flagpd1("grecord-gcc-switches"), +flagpd1("gno-record-gcc-switches"), +flagpd1("fident"), +flagpd1("nocudalib"), +.{ + .name = "system-header-prefix", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "no-system-header-prefix", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +flagpd1("integrated-as"), +flagpd1("no-integrated-as"), +flagpd1("fkeep-inline-functions"), +flagpd1("fno-keep-inline-functions"), +flagpd1("fno-semantic-interposition"), +.{ + .name = "Gs", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "O1", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "O2", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +flagpd1("fno-ident"), +.{ + .name = "Ob0", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Ob1", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Ob2", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Od", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Og", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Oi", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Oi-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Os", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Ot", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Ox", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +flagpd1("fcuda-rdc"), +.{ + .name = "Oy", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Oy-", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +flagpd1("fno-cuda-rdc"), +flagpd1("shared-libasan"), +flagpd1("frecord-gcc-switches"), +flagpd1("fno-record-gcc-switches"), +.{ + .name = "ansi", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +sepd1("arch"), +flagpd1("arch_errors_fatal"), +sepd1("arch_only"), +flagpd1("arcmt-check"), +flagpd1("arcmt-migrate"), +flagpd1("arcmt-migrate-emit-errors"), +sepd1("arcmt-migrate-report-output"), +flagpd1("arcmt-modify"), +flagpd1("ast-dump"), +joinpd1("ast-dump="), +flagpd1("ast-dump-all"), +joinpd1("ast-dump-all="), +sepd1("ast-dump-filter"), +flagpd1("ast-dump-lookups"), +flagpd1("ast-list"), +sepd1("ast-merge"), +flagpd1("ast-print"), +flagpd1("ast-view"), +.{ + .name = "autocomplete=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +flagpd1("fautomatic"), +flagpd1("fno-automatic"), +sepd1("aux-triple"), +jspd1("b"), +flagpd1("fbackslash"), +flagpd1("fno-backslash"), +flagpd1("fbacktrace"), +flagpd1("fno-backtrace"), +flagpd1("bind_at_load"), +flagpd1("fbounds-check"), +flagpd1("fno-bounds-check"), +flagpd1("fbranch-count-reg"), +flagpd1("fno-branch-count-reg"), +flagpd1("building-pch-with-obj"), +flagpd1("bundle"), +sepd1("bundle_loader"), +.{ + .name = "c", + .syntax = .flag, + .zig_equivalent = .c, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +jspd1("c-isystem"), +flagpd1("fcaller-saves"), +flagpd1("fno-caller-saves"), +flagpd1("cc1"), +flagpd1("cc1as"), +joinpd1("ccc-"), +flagpd1("ccc-arcmt-check"), +sepd1("ccc-arcmt-migrate"), +flagpd1("ccc-arcmt-modify"), +sepd1("ccc-gcc-name"), +sepd1("ccc-install-dir"), +sepd1("ccc-objcmt-migrate"), +flagpd1("ccc-print-bindings"), +flagpd1("ccc-print-phases"), +flagpd1("cfguard"), +flagpd1("cfguard-no-checks"), +sepd1("chain-include"), +flagpd1("fcheck-array-temporaries"), +flagpd1("fno-check-array-temporaries"), +flagpd1("cl-denorms-are-zero"), +.{ + .name = "cl-ext=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +flagpd1("cl-fast-relaxed-math"), +flagpd1("cl-finite-math-only"), +flagpd1("cl-fp32-correctly-rounded-divide-sqrt"), +flagpd1("cl-kernel-arg-info"), +flagpd1("cl-mad-enable"), +flagpd1("cl-no-signed-zeros"), +flagpd1("cl-opt-disable"), +flagpd1("cl-single-precision-constant"), +joinpd1("cl-std="), +flagpd1("cl-strict-aliasing"), +flagpd1("cl-uniform-work-group-size"), +flagpd1("cl-unsafe-math-optimizations"), +jspd1("client_name"), +sepd1("code-completion-at"), +joinpd1("code-completion-at="), +flagpd1("code-completion-brief-comments"), +flagpd1("code-completion-macros"), +flagpd1("code-completion-patterns"), +flagpd1("code-completion-with-fixits"), +.{ + .name = "combine", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +jspd1("compatibility_version"), +flagpd1("compiler-options-dump"), +.{ + .name = "compress-debug-sections", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "compress-debug-sections=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "config", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "config-system-dir=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "config-user-dir=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "coverage", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +flagpd1("coverage-cfg-checksum"), +sepd1("coverage-data-file"), +joinpd1("coverage-data-file="), +flagpd1("coverage-exit-block-before-body"), +flagpd1("coverage-no-function-names-in-data"), +sepd1("coverage-notes-file"), +joinpd1("coverage-notes-file="), +joinpd1("coverage-version="), +flagpd1("cpp"), +flagpd1("cpp-precomp"), +flagpd1("fcray-pointer"), +flagpd1("fno-cray-pointer"), +.{ + .name = "cuda-compile-host-device", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "cuda-device-only", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "cuda-gpu-arch=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "cuda-host-only", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "cuda-include-ptx=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "cuda-noopt-device-debug", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "cuda-path=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "cuda-path-ignore-env", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +jspd1("current_version"), +jspd1("cxx-isystem"), +flagpd1("dA"), +flagpd1("dD"), +flagpd1("dI"), +flagpd1("dM"), +flagpd1("d"), +joinpd1("d"), +flagpd1("fd-lines-as-code"), +flagpd1("fno-d-lines-as-code"), +flagpd1("fd-lines-as-comments"), +flagpd1("fno-d-lines-as-comments"), +flagpd1("dead_strip"), +flagpd1("debug-forward-template-params"), +joinpd1("debug-info-kind="), +flagpd1("debug-info-macro"), +joinpd1("debugger-tuning="), +flagpd1("fdefault-double-8"), +flagpd1("fno-default-double-8"), +sepd1("default-function-attr"), +flagpd1("fdefault-inline"), +flagpd1("fno-default-inline"), +flagpd1("fdefault-integer-8"), +flagpd1("fno-default-integer-8"), +flagpd1("fdefault-real-8"), +flagpd1("fno-default-real-8"), +sepd1("defsym"), +sepd1("dependency-dot"), +sepd1("dependency-file"), +.{ + .name = "dependent-lib=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +flagpd1("detailed-preprocessing-record"), +flagpd1("fdevirtualize"), +flagpd1("fno-devirtualize"), +flagpd1("fdevirtualize-speculatively"), +flagpd1("fno-devirtualize-speculatively"), +sepd1("diagnostic-log-file"), +sepd1("serialize-diagnostic-file"), +flagpd1("disable-O0-optnone"), +flagpd1("disable-free"), +flagpd1("disable-lifetime-markers"), +flagpd1("disable-llvm-optzns"), +flagpd1("disable-llvm-passes"), +flagpd1("disable-llvm-verifier"), +flagpd1("disable-objc-default-synthesize-properties"), +flagpd1("disable-pragma-debug-crash"), +flagpd1("disable-red-zone"), +flagpd1("discard-value-names"), +flagpd1("fdollar-ok"), +flagpd1("fno-dollar-ok"), +.{ + .name = "driver-mode=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +flagpd1("dump-coverage-mapping"), +flagpd1("dump-deserialized-decls"), +flagpd1("fdump-fortran-optimized"), +flagpd1("fno-dump-fortran-optimized"), +flagpd1("fdump-fortran-original"), +flagpd1("fno-dump-fortran-original"), +flagpd1("fdump-parse-tree"), +flagpd1("fno-dump-parse-tree"), +flagpd1("dump-raw-tokens"), +flagpd1("dump-tokens"), +flagpd1("dumpmachine"), +flagpd1("dumpspecs"), +flagpd1("dumpversion"), +flagpd1("dwarf-column-info"), +sepd1("dwarf-debug-flags"), +sepd1("dwarf-debug-producer"), +flagpd1("dwarf-explicit-import"), +flagpd1("dwarf-ext-refs"), +joinpd1("dwarf-version="), +sepd1("dylib_file"), +flagpd1("dylinker"), +jspd1("dylinker_install_name"), +flagpd1("dynamic"), +flagpd1("dynamiclib"), +jspd1("e"), +flagpd1("feliminate-unused-debug-types"), +flagpd1("fno-eliminate-unused-debug-types"), +flagpd1("emit-ast"), +flagpd1("emit-codegen-only"), +flagpd1("emit-header-module"), +flagpd1("emit-html"), +flagpd1("emit-interface-stubs"), +flagpd1("emit-llvm"), +flagpd1("emit-llvm-bc"), +flagpd1("emit-llvm-only"), +flagpd1("emit-llvm-uselists"), +flagpd1("emit-merged-ifs"), +flagpd1("emit-module"), +flagpd1("emit-module-interface"), +flagpd1("emit-obj"), +flagpd1("emit-pch"), +flagpd1("enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang"), +sepd1("error-on-deserialized-decl"), +joinpd1("error-on-deserialized-decl="), +sepd1("exported_symbols_list"), +flagpd1("fexternal-blas"), +flagpd1("fno-external-blas"), +flagpd1("ff2c"), +flagpd1("fno-f2c"), +flagpd1("fPIC"), +flagpd1("fPIE"), +flagpd1("faccess-control"), +joinpd1("faddress-space-map-mangling="), +flagpd1("faddrsig"), +flagpd1("falign-functions"), +joinpd1("falign-functions="), +joinpd1("falign-jumps="), +joinpd1("falign-labels="), +joinpd1("falign-loops="), +flagpd1("faligned-allocation"), +joinpd1("faligned-new="), +flagpd1("fallow-editor-placeholders"), +flagpd1("fallow-half-arguments-and-returns"), +flagpd1("fallow-pch-with-compiler-errors"), +flagpd1("fallow-unsupported"), +flagpd1("faltivec"), +flagpd1("fansi-escape-codes"), +flagpd1("fapple-kext"), +flagpd1("fapple-link-rtlib"), +flagpd1("fapple-pragma-pack"), +flagpd1("fapplication-extension"), +flagpd1("fapply-global-visibility-to-externs"), +flagpd1("fasm"), +flagpd1("fasm-blocks"), +flagpd1("fassociative-math"), +flagpd1("fassume-sane-operator-new"), +flagpd1("fast"), +flagpd1("fastcp"), +flagpd1("fastf"), +flagpd1("fasynchronous-unwind-tables"), +flagpd1("ffat-lto-objects"), +flagpd1("fno-fat-lto-objects"), +flagpd1("fauto-profile"), +joinpd1("fauto-profile="), +flagpd1("fauto-profile-accurate"), +flagpd1("fautolink"), +joinpd1("fblas-matmul-limit="), +flagpd1("fblocks"), +flagpd1("fblocks-runtime-optional"), +joinpd1("fbootclasspath="), +flagpd1("fborland-extensions"), +sepd1("fbracket-depth"), +joinpd1("fbracket-depth="), +joinpd1("fbuild-session-file="), +joinpd1("fbuild-session-timestamp="), +flagpd1("fbuiltin"), +flagpd1("fbuiltin-module-map"), +flagpd1("fcall-saved-x10"), +flagpd1("fcall-saved-x11"), +flagpd1("fcall-saved-x12"), +flagpd1("fcall-saved-x13"), +flagpd1("fcall-saved-x14"), +flagpd1("fcall-saved-x15"), +flagpd1("fcall-saved-x18"), +flagpd1("fcall-saved-x8"), +flagpd1("fcall-saved-x9"), +flagpd1("fcaret-diagnostics"), +sepd1("fcaret-diagnostics-max-lines"), +flagpd1("fcf-protection"), +joinpd1("fcf-protection="), +joinpd1("fcf-runtime-abi="), +flagpd1("fchar8_t"), +joinpd1("fcheck="), +flagpd1("fcheck-new"), +flagpd1("fno-check-new"), +joinpd1("fclang-abi-compat="), +joinpd1("fclasspath="), +joinpd1("fcoarray="), +flagpd1("fcolor-diagnostics"), +.{ + .name = "fcomment-block-commands=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +flagpd1("fcommon"), +joinpd1("fcompile-resource="), +flagpd1("fcomplete-member-pointers"), +flagpd1("fconcepts-ts"), +flagpd1("fconst-strings"), +flagpd1("fconstant-cfstrings"), +sepd1("fconstant-string-class"), +joinpd1("fconstant-string-class="), +sepd1("fconstexpr-backtrace-limit"), +joinpd1("fconstexpr-backtrace-limit="), +sepd1("fconstexpr-depth"), +joinpd1("fconstexpr-depth="), +sepd1("fconstexpr-steps"), +joinpd1("fconstexpr-steps="), +flagpd1("fconvergent-functions"), +joinpd1("fconvert="), +flagpd1("fcoroutines-ts"), +flagpd1("fcoverage-mapping"), +joinpd1("fcrash-diagnostics-dir="), +flagpd1("fcreate-profile"), +flagpd1("fcs-profile-generate"), +joinpd1("fcs-profile-generate="), +flagpd1("fcuda-allow-variadic-functions"), +flagpd1("fcuda-approx-transcendentals"), +flagpd1("fcuda-flush-denormals-to-zero"), +sepd1("fcuda-include-gpubinary"), +flagpd1("fcuda-is-device"), +flagpd1("fcuda-short-ptr"), +flagpd1("fcxx-exceptions"), +flagpd1("fcxx-modules"), +flagpd1("fc++-static-destructors"), +flagpd1("fdata-sections"), +sepd1("fdebug-compilation-dir"), +joinpd1("fdebug-compilation-dir="), +joinpd1("fdebug-default-version="), +flagpd1("fdebug-info-for-profiling"), +flagpd1("fdebug-macro"), +flagpd1("fdebug-pass-arguments"), +flagpd1("fdebug-pass-manager"), +flagpd1("fdebug-pass-structure"), +joinpd1("fdebug-prefix-map="), +flagpd1("fdebug-ranges-base-address"), +flagpd1("fdebug-types-section"), +flagpd1("fdebugger-cast-result-to-id"), +flagpd1("fdebugger-objc-literal"), +flagpd1("fdebugger-support"), +flagpd1("fdeclare-opencl-builtins"), +flagpd1("fdeclspec"), +joinpd1("fdefault-calling-conv="), +flagpd1("fdelayed-template-parsing"), +flagpd1("fdelete-null-pointer-checks"), +joinpd1("fdenormal-fp-math="), +joinpd1("fdepfile-entry="), +flagpd1("fdeprecated-macro"), +flagpd1("fdiagnostics-absolute-paths"), +flagpd1("fdiagnostics-color"), +joinpd1("fdiagnostics-color="), +flagpd1("fdiagnostics-fixit-info"), +sepd1("fdiagnostics-format"), +joinpd1("fdiagnostics-format="), +joinpd1("fdiagnostics-hotness-threshold="), +flagpd1("fdiagnostics-parseable-fixits"), +flagpd1("fdiagnostics-print-source-range-info"), +sepd1("fdiagnostics-show-category"), +joinpd1("fdiagnostics-show-category="), +flagpd1("fdiagnostics-show-hotness"), +joinpd1("fdiagnostics-show-location="), +flagpd1("fdiagnostics-show-note-include-stack"), +flagpd1("fdiagnostics-show-option"), +flagpd1("fdiagnostics-show-template-tree"), +flagpd1("fdigraphs"), +flagpd1("fdisable-module-hash"), +flagpd1("fdiscard-value-names"), +flagpd1("fdollars-in-identifiers"), +flagpd1("fdouble-square-bracket-attributes"), +flagpd1("fdump-record-layouts"), +flagpd1("fdump-record-layouts-simple"), +flagpd1("fdump-vtable-layouts"), +flagpd1("fdwarf2-cfi-asm"), +flagpd1("fdwarf-directory-asm"), +flagpd1("fdwarf-exceptions"), +flagpd1("felide-constructors"), +flagpd1("feliminate-unused-debug-symbols"), +flagpd1("fembed-bitcode"), +joinpd1("fembed-bitcode="), +flagpd1("fembed-bitcode-marker"), +flagpd1("femit-all-decls"), +flagpd1("femit-coverage-data"), +flagpd1("femit-coverage-notes"), +flagpd1("femit-debug-entry-values"), +flagpd1("femulated-tls"), +flagpd1("fencode-extended-block-signature"), +joinpd1("fencoding="), +sepd1("ferror-limit"), +joinpd1("ferror-limit="), +flagpd1("fescaping-block-tail-calls"), +flagpd1("fexceptions"), +joinpd1("fexcess-precision="), +joinpd1("fexec-charset="), +flagpd1("fexperimental-isel"), +flagpd1("fexperimental-new-constant-interpreter"), +flagpd1("fexperimental-new-pass-manager"), +joinpd1("fextdirs="), +flagpd1("fexternc-nounwind"), +flagpd1("ffake-address-space-map"), +flagpd1("ffast-math"), +joinpd1("ffile-prefix-map="), +flagpd1("ffine-grained-bitfield-accesses"), +flagpd1("ffinite-math-only"), +joinpd1("ffixed-line-length-"), +flagpd1("ffixed-point"), +flagpd1("ffixed-r19"), +flagpd1("ffixed-r9"), +flagpd1("ffixed-x1"), +flagpd1("ffixed-x10"), +flagpd1("ffixed-x11"), +flagpd1("ffixed-x12"), +flagpd1("ffixed-x13"), +flagpd1("ffixed-x14"), +flagpd1("ffixed-x15"), +flagpd1("ffixed-x16"), +flagpd1("ffixed-x17"), +flagpd1("ffixed-x18"), +flagpd1("ffixed-x19"), +flagpd1("ffixed-x2"), +flagpd1("ffixed-x20"), +flagpd1("ffixed-x21"), +flagpd1("ffixed-x22"), +flagpd1("ffixed-x23"), +flagpd1("ffixed-x24"), +flagpd1("ffixed-x25"), +flagpd1("ffixed-x26"), +flagpd1("ffixed-x27"), +flagpd1("ffixed-x28"), +flagpd1("ffixed-x29"), +flagpd1("ffixed-x3"), +flagpd1("ffixed-x30"), +flagpd1("ffixed-x31"), +flagpd1("ffixed-x4"), +flagpd1("ffixed-x5"), +flagpd1("ffixed-x6"), +flagpd1("ffixed-x7"), +flagpd1("ffixed-x8"), +flagpd1("ffixed-x9"), +flagpd1("ffor-scope"), +flagpd1("fforbid-guard-variables"), +flagpd1("fforce-dwarf-frame"), +flagpd1("fforce-emit-vtables"), +flagpd1("fforce-enable-int128"), +joinpd1("ffp-contract="), +joinpd1("ffp-exception-behavior="), +joinpd1("ffp-model="), +joinpd1("ffpe-trap="), +joinpd1("ffree-line-length-"), +flagpd1("ffreestanding"), +flagpd1("ffunction-sections"), +flagpd1("fgnu89-inline"), +flagpd1("fgnu-inline-asm"), +flagpd1("fgnu-keywords"), +flagpd1("fgnu-runtime"), +joinpd1("fgnuc-version="), +flagpd1("fgpu-allow-device-init"), +flagpd1("fgpu-rdc"), +flagpd1("fheinous-gnu-extensions"), +flagpd1("fhip-dump-offload-linker-script"), +flagpd1("fhip-new-launch-api"), +flagpd1("fhonor-infinities"), +flagpd1("fhonor-nans"), +flagpd1("fhosted"), +sepd1("filelist"), +sepd1("filetype"), +flagpd1("fimplicit-module-maps"), +flagpd1("fimplicit-modules"), +flagpd1("finclude-default-header"), +joinpd1("finit-character="), +joinpd1("finit-integer="), +joinpd1("finit-logical="), +joinpd1("finit-real="), +flagpd1("finline"), +flagpd1("finline-functions"), +flagpd1("finline-hint-functions"), +joinpd1("finline-limit="), +flagpd1("finline-limit"), +flagpd1("fno-inline-limit"), +joinpd1("finput-charset="), +flagpd1("finstrument-function-entry-bare"), +flagpd1("finstrument-functions"), +flagpd1("finstrument-functions-after-inlining"), +flagpd1("fintegrated-as"), +flagpd1("fintegrated-cc1"), +flagpd1("fix-only-warnings"), +flagpd1("fix-what-you-can"), +flagpd1("ffixed-form"), +flagpd1("fno-fixed-form"), +flagpd1("fixit"), +joinpd1("fixit="), +flagpd1("fixit-recompile"), +flagpd1("fixit-to-temporary"), +flagpd1("fjump-tables"), +flagpd1("fkeep-static-consts"), +flagpd1("flat_namespace"), +flagpd1("flax-vector-conversions"), +joinpd1("flax-vector-conversions="), +flagpd1("flimit-debug-info"), +joinpd1("flimited-precision="), +flagpd1("ffloat-store"), +flagpd1("fno-float-store"), +flagpd1("flto"), +joinpd1("flto="), +joinpd1("flto-jobs="), +flagpd1("flto-unit"), +flagpd1("flto-visibility-public-std"), +sepd1("fmacro-backtrace-limit"), +joinpd1("fmacro-backtrace-limit="), +joinpd1("fmacro-prefix-map="), +flagpd1("fmath-errno"), +joinpd1("fmax-array-constructor="), +joinpd1("fmax-errors="), +joinpd1("fmax-stack-var-size="), +joinpd1("fmax-subrecord-length="), +joinpd1("fmax-type-align="), +flagpd1("fmerge-all-constants"), +flagpd1("fmerge-functions"), +sepd1("fmessage-length"), +joinpd1("fmessage-length="), +sepd1("fmodule-feature"), +joinpd1("fmodule-file="), +flagpd1("fmodule-file-deps"), +joinpd1("fmodule-format="), +sepd1("fmodule-implementation-of"), +joinpd1("fmodule-map-file="), +flagpd1("fmodule-map-file-home-is-cwd"), +flagpd1("fmodule-maps"), +sepd1("fmodule-name"), +joinpd1("fmodule-name="), +flagpd1("fmodules"), +joinpd1("fmodules-cache-path="), +flagpd1("fmodules-codegen"), +flagpd1("fmodules-debuginfo"), +flagpd1("fmodules-decluse"), +flagpd1("fmodules-disable-diagnostic-validation"), +joinpd1("fmodules-embed-all-files"), +joinpd1("fmodules-embed-file="), +flagpd1("fmodules-hash-content"), +joinpd1("fmodules-ignore-macro="), +flagpd1("fmodules-local-submodule-visibility"), +joinpd1("fmodules-prune-after="), +joinpd1("fmodules-prune-interval="), +flagpd1("fmodules-search-all"), +flagpd1("fmodules-strict-context-hash"), +flagpd1("fmodules-strict-decluse"), +flagpd1("fmodules-ts"), +sepd1("fmodules-user-build-path"), +flagpd1("fmodules-validate-input-files-content"), +flagpd1("fmodules-validate-once-per-build-session"), +flagpd1("fmodules-validate-system-headers"), +flagpd1("fms-compatibility"), +joinpd1("fms-compatibility-version="), +flagpd1("fms-extensions"), +joinpd1("fms-memptr-rep="), +flagpd1("fms-volatile"), +joinpd1("fmsc-version="), +flagpd1("fmudflap"), +flagpd1("fmudflapth"), +flagpd1("fnative-half-arguments-and-returns"), +flagpd1("fnative-half-type"), +flagpd1("fnested-functions"), +joinpd1("fnew-alignment="), +flagpd1("fnext-runtime"), +flagpd1("fno-PIC"), +flagpd1("fno-PIE"), +flagpd1("fno-access-control"), +flagpd1("fno-addrsig"), +flagpd1("fno-align-functions"), +flagpd1("fno-aligned-allocation"), +flagpd1("fno-allow-editor-placeholders"), +flagpd1("fno-altivec"), +flagpd1("fno-apple-pragma-pack"), +flagpd1("fno-application-extension"), +flagpd1("fno-asm"), +flagpd1("fno-asm-blocks"), +flagpd1("fno-associative-math"), +flagpd1("fno-assume-sane-operator-new"), +flagpd1("fno-asynchronous-unwind-tables"), +flagpd1("fno-auto-profile"), +flagpd1("fno-auto-profile-accurate"), +flagpd1("fno-autolink"), +flagpd1("fno-bitfield-type-align"), +flagpd1("fno-blocks"), +flagpd1("fno-borland-extensions"), +flagpd1("fno-builtin"), +joinpd1("fno-builtin-"), +flagpd1("fno-caret-diagnostics"), +flagpd1("fno-char8_t"), +flagpd1("fno-color-diagnostics"), +flagpd1("fno-common"), +flagpd1("fno-complete-member-pointers"), +flagpd1("fno-concept-satisfaction-caching"), +flagpd1("fno-const-strings"), +flagpd1("fno-constant-cfstrings"), +flagpd1("fno-coroutines-ts"), +flagpd1("fno-coverage-mapping"), +flagpd1("fno-crash-diagnostics"), +flagpd1("fno-cuda-approx-transcendentals"), +flagpd1("fno-cuda-flush-denormals-to-zero"), +flagpd1("fno-cuda-host-device-constexpr"), +flagpd1("fno-cuda-short-ptr"), +flagpd1("fno-cxx-exceptions"), +flagpd1("fno-cxx-modules"), +flagpd1("fno-c++-static-destructors"), +flagpd1("fno-data-sections"), +flagpd1("fno-debug-info-for-profiling"), +flagpd1("fno-debug-macro"), +flagpd1("fno-debug-pass-manager"), +flagpd1("fno-debug-ranges-base-address"), +flagpd1("fno-debug-types-section"), +flagpd1("fno-declspec"), +flagpd1("fno-delayed-template-parsing"), +flagpd1("fno-delete-null-pointer-checks"), +flagpd1("fno-deprecated-macro"), +flagpd1("fno-diagnostics-color"), +flagpd1("fno-diagnostics-fixit-info"), +flagpd1("fno-diagnostics-show-hotness"), +flagpd1("fno-diagnostics-show-note-include-stack"), +flagpd1("fno-diagnostics-show-option"), +flagpd1("fno-diagnostics-use-presumed-location"), +flagpd1("fno-digraphs"), +flagpd1("fno-discard-value-names"), +flagpd1("fno-dllexport-inlines"), +flagpd1("fno-dollars-in-identifiers"), +flagpd1("fno-double-square-bracket-attributes"), +flagpd1("fno-dwarf2-cfi-asm"), +flagpd1("fno-dwarf-directory-asm"), +flagpd1("fno-elide-constructors"), +flagpd1("fno-elide-type"), +flagpd1("fno-eliminate-unused-debug-symbols"), +flagpd1("fno-emulated-tls"), +flagpd1("fno-escaping-block-tail-calls"), +flagpd1("fno-exceptions"), +flagpd1("fno-experimental-isel"), +flagpd1("fno-experimental-new-pass-manager"), +flagpd1("fno-fast-math"), +flagpd1("fno-fine-grained-bitfield-accesses"), +flagpd1("fno-finite-math-only"), +flagpd1("fno-fixed-point"), +flagpd1("fno-for-scope"), +flagpd1("fno-force-dwarf-frame"), +flagpd1("fno-force-emit-vtables"), +flagpd1("fno-force-enable-int128"), +flagpd1("fno-function-sections"), +flagpd1("fno-gnu89-inline"), +flagpd1("fno-gnu-inline-asm"), +flagpd1("fno-gnu-keywords"), +flagpd1("fno-gpu-allow-device-init"), +flagpd1("fno-gpu-rdc"), +flagpd1("fno-hip-new-launch-api"), +flagpd1("fno-honor-infinities"), +flagpd1("fno-honor-nans"), +flagpd1("fno-implicit-module-maps"), +flagpd1("fno-implicit-modules"), +flagpd1("fno-inline"), +flagpd1("fno-inline-functions"), +flagpd1("fno-integrated-as"), +flagpd1("fno-integrated-cc1"), +flagpd1("fno-jump-tables"), +flagpd1("fno-lax-vector-conversions"), +flagpd1("fno-limit-debug-info"), +flagpd1("fno-lto"), +flagpd1("fno-lto-unit"), +flagpd1("fno-math-builtin"), +flagpd1("fno-math-errno"), +flagpd1("fno-max-type-align"), +flagpd1("fno-merge-all-constants"), +flagpd1("fno-module-file-deps"), +flagpd1("fno-module-maps"), +flagpd1("fno-modules"), +flagpd1("fno-modules-decluse"), +flagpd1("fno-modules-error-recovery"), +flagpd1("fno-modules-global-index"), +flagpd1("fno-modules-search-all"), +flagpd1("fno-strict-modules-decluse"), +flagpd1("fno_modules-validate-input-files-content"), +flagpd1("fno-modules-validate-system-headers"), +flagpd1("fno-ms-compatibility"), +flagpd1("fno-ms-extensions"), +flagpd1("fno-objc-arc"), +flagpd1("fno-objc-arc-exceptions"), +flagpd1("fno-objc-convert-messages-to-runtime-calls"), +flagpd1("fno-objc-exceptions"), +flagpd1("fno-objc-infer-related-result-type"), +flagpd1("fno-objc-legacy-dispatch"), +flagpd1("fno-objc-nonfragile-abi"), +flagpd1("fno-objc-weak"), +flagpd1("fno-omit-frame-pointer"), +flagpd1("fno-openmp"), +flagpd1("fno-openmp-cuda-force-full-runtime"), +flagpd1("fno-openmp-cuda-mode"), +flagpd1("fno-openmp-optimistic-collapse"), +flagpd1("fno-openmp-simd"), +flagpd1("fno-operator-names"), +flagpd1("fno-optimize-sibling-calls"), +flagpd1("fno-pack-struct"), +flagpd1("fno-padding-on-unsigned-fixed-point"), +flagpd1("fno-pascal-strings"), +flagpd1("fno-pch-timestamp"), +flagpd1("fno_pch-validate-input-files-content"), +flagpd1("fno-pic"), +flagpd1("fno-pie"), +flagpd1("fno-plt"), +flagpd1("fno-preserve-as-comments"), +flagpd1("fno-profile-arcs"), +flagpd1("fno-profile-generate"), +flagpd1("fno-profile-instr-generate"), +flagpd1("fno-profile-instr-use"), +flagpd1("fno-profile-sample-accurate"), +flagpd1("fno-profile-sample-use"), +flagpd1("fno-profile-use"), +flagpd1("fno-reciprocal-math"), +flagpd1("fno-record-command-line"), +flagpd1("fno-register-global-dtors-with-atexit"), +flagpd1("fno-relaxed-template-template-args"), +flagpd1("fno-reroll-loops"), +flagpd1("fno-rewrite-imports"), +flagpd1("fno-rewrite-includes"), +flagpd1("fno-ropi"), +flagpd1("fno-rounding-math"), +flagpd1("fno-rtlib-add-rpath"), +flagpd1("fno-rtti"), +flagpd1("fno-rtti-data"), +flagpd1("fno-rwpi"), +.{ + .name = "fno-sanitize=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +flagpd1("fno-sanitize-address-poison-custom-array-cookie"), +flagpd1("fno-sanitize-address-use-after-scope"), +flagpd1("fno-sanitize-address-use-odr-indicator"), +flagpd1("fno-sanitize-blacklist"), +flagpd1("fno-sanitize-cfi-canonical-jump-tables"), +flagpd1("fno-sanitize-cfi-cross-dso"), +.{ + .name = "fno-sanitize-coverage=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +flagpd1("fno-sanitize-link-c++-runtime"), +flagpd1("fno-sanitize-link-runtime"), +flagpd1("fno-sanitize-memory-track-origins"), +flagpd1("fno-sanitize-memory-use-after-dtor"), +flagpd1("fno-sanitize-minimal-runtime"), +flagpd1("fno-sanitize-recover"), +.{ + .name = "fno-sanitize-recover=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +flagpd1("fno-sanitize-stats"), +flagpd1("fno-sanitize-thread-atomics"), +flagpd1("fno-sanitize-thread-func-entry-exit"), +flagpd1("fno-sanitize-thread-memory-access"), +.{ + .name = "fno-sanitize-trap=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +flagpd1("fno-sanitize-undefined-trap-on-error"), +flagpd1("fno-save-optimization-record"), +flagpd1("fno-short-enums"), +flagpd1("fno-short-wchar"), +flagpd1("fno-show-column"), +flagpd1("fno-show-source-location"), +flagpd1("fno-signaling-math"), +flagpd1("fno-signed-char"), +flagpd1("fno-signed-wchar"), +flagpd1("fno-signed-zeros"), +flagpd1("fno-sized-deallocation"), +flagpd1("fno-slp-vectorize"), +flagpd1("fno-spell-checking"), +flagpd1("fno-split-dwarf-inlining"), +flagpd1("fno-split-lto-unit"), +flagpd1("fno-stack-protector"), +flagpd1("fno-stack-size-section"), +flagpd1("fno-standalone-debug"), +flagpd1("fno-strict-aliasing"), +flagpd1("fno-strict-enums"), +flagpd1("fno-strict-float-cast-overflow"), +flagpd1("fno-strict-overflow"), +flagpd1("fno-strict-return"), +flagpd1("fno-strict-vtable-pointers"), +flagpd1("fno-struct-path-tbaa"), +flagpd1("fno-temp-file"), +flagpd1("fno-threadsafe-statics"), +flagpd1("fno-trapping-math"), +flagpd1("fno-trigraphs"), +flagpd1("fno-unique-section-names"), +flagpd1("fno-unit-at-a-time"), +flagpd1("fno-unroll-loops"), +flagpd1("fno-unsafe-math-optimizations"), +flagpd1("fno-unsigned-char"), +flagpd1("fno-unwind-tables"), +flagpd1("fno-use-cxa-atexit"), +flagpd1("fno-use-init-array"), +flagpd1("fno-use-line-directives"), +flagpd1("fno-validate-pch"), +flagpd1("fno-var-tracking"), +flagpd1("fno-vectorize"), +flagpd1("fno-verbose-asm"), +flagpd1("fno-virtual-function_elimination"), +flagpd1("fno-wchar"), +flagpd1("fno-whole-program-vtables"), +flagpd1("fno-working-directory"), +flagpd1("fno-wrapv"), +flagpd1("fno-zero-initialized-in-bss"), +flagpd1("fno-zvector"), +flagpd1("fnoopenmp-relocatable-target"), +flagpd1("fnoopenmp-use-tls"), +flagpd1("fno-xray-always-emit-customevents"), +flagpd1("fno-xray-always-emit-typedevents"), +flagpd1("fno-xray-instrument"), +flagpd1("fnoxray-link-deps"), +joinpd1("fobjc-abi-version="), +flagpd1("fobjc-arc"), +joinpd1("fobjc-arc-cxxlib="), +flagpd1("fobjc-arc-exceptions"), +flagpd1("fobjc-atdefs"), +flagpd1("fobjc-call-cxx-cdtors"), +flagpd1("fobjc-convert-messages-to-runtime-calls"), +joinpd1("fobjc-dispatch-method="), +flagpd1("fobjc-exceptions"), +flagpd1("fobjc-gc"), +flagpd1("fobjc-gc-only"), +flagpd1("fobjc-infer-related-result-type"), +flagpd1("fobjc-legacy-dispatch"), +flagpd1("fobjc-link-runtime"), +flagpd1("fobjc-new-property"), +flagpd1("fobjc-nonfragile-abi"), +joinpd1("fobjc-nonfragile-abi-version="), +joinpd1("fobjc-runtime="), +flagpd1("fobjc-runtime-has-weak"), +flagpd1("fobjc-sender-dependent-dispatch"), +flagpd1("fobjc-subscripting-legacy-runtime"), +flagpd1("fobjc-weak"), +flagpd1("fomit-frame-pointer"), +flagpd1("fopenmp"), +joinpd1("fopenmp="), +joinpd1("fopenmp-cuda-blocks-per-sm="), +flagpd1("fopenmp-cuda-force-full-runtime"), +flagpd1("fopenmp-cuda-mode"), +joinpd1("fopenmp-cuda-number-of-sm="), +joinpd1("fopenmp-cuda-teams-reduction-recs-num="), +flagpd1("fopenmp-enable-irbuilder"), +sepd1("fopenmp-host-ir-file-path"), +flagpd1("fopenmp-is-device"), +flagpd1("fopenmp-optimistic-collapse"), +flagpd1("fopenmp-relocatable-target"), +flagpd1("fopenmp-simd"), +.{ + .name = "fopenmp-targets=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +flagpd1("fopenmp-use-tls"), +joinpd1("fopenmp-version="), +sepd1("foperator-arrow-depth"), +joinpd1("foperator-arrow-depth="), +joinpd1("foptimization-record-file="), +joinpd1("foptimization-record-passes="), +flagpd1("foptimize-sibling-calls"), +flagpd1("force_cpusubtype_ALL"), +flagpd1("force_flat_namespace"), +sepd1("force_load"), +joinpd1("fforce-addr"), +flagpd1("forder-file-instrumentation"), +joinpd1("foutput-class-dir="), +joinpd1("foverride-record-layout="), +flagpd1("fpack-struct"), +joinpd1("fpack-struct="), +flagpd1("fpadding-on-unsigned-fixed-point"), +flagpd1("fparse-all-comments"), +flagpd1("fpascal-strings"), +joinpd1("fpass-plugin="), +joinpd1("fpatchable-function-entry="), +joinpd1("fpatchable-function-entry-offset="), +flagpd1("fpcc-struct-return"), +flagpd1("fpch-preprocess"), +flagpd1("fpch-validate-input-files-content"), +flagpd1("fpic"), +flagpd1("fpie"), +flagpd1("fplt"), +joinpd1("fplugin="), +joinpd1("fprebuilt-module-path="), +flagpd1("fpreserve-as-comments"), +flagpd1("fpreserve-vec3-type"), +flagpd1("fprofile-arcs"), +joinpd1("fprofile-dir="), +joinpd1("fprofile-exclude-files="), +joinpd1("fprofile-filter-files="), +flagpd1("fprofile-generate"), +joinpd1("fprofile-generate="), +flagpd1("fprofile-instr-generate"), +joinpd1("fprofile-instr-generate="), +flagpd1("fprofile-instr-use"), +joinpd1("fprofile-instr-use="), +joinpd1("fprofile-instrument="), +joinpd1("fprofile-instrument-path="), +joinpd1("fprofile-instrument-use-path="), +sepd1("fprofile-remapping-file"), +joinpd1("fprofile-remapping-file="), +flagpd1("fprofile-sample-accurate"), +flagpd1("fprofile-sample-use"), +joinpd1("fprofile-sample-use="), +flagpd1("fprofile-use"), +joinpd1("fprofile-use="), +sepd1("framework"), +joinpd1("frandom-seed="), +flagpd1("freciprocal-math"), +flagpd1("frecord-command-line"), +joinpd1("frecord-marker="), +flagpd1("ffree-form"), +flagpd1("fno-free-form"), +flagpd1("freg-struct-return"), +flagpd1("fregister-global-dtors-with-atexit"), +flagpd1("frelaxed-template-template-args"), +flagpd1("freroll-loops"), +flagpd1("fretain-comments-from-system-headers"), +flagpd1("frewrite-imports"), +flagpd1("frewrite-includes"), +sepd1("frewrite-map-file"), +joinpd1("frewrite-map-file="), +flagpd1("ffriend-injection"), +flagpd1("fno-friend-injection"), +flagpd1("ffrontend-optimize"), +flagpd1("fno-frontend-optimize"), +flagpd1("fropi"), +flagpd1("frounding-math"), +flagpd1("frtlib-add-rpath"), +flagpd1("frtti"), +flagpd1("frwpi"), +.{ + .name = "fsanitize=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +joinpd1("fsanitize-address-field-padding="), +flagpd1("fsanitize-address-globals-dead-stripping"), +flagpd1("fsanitize-address-poison-custom-array-cookie"), +flagpd1("fsanitize-address-use-after-scope"), +flagpd1("fsanitize-address-use-odr-indicator"), +joinpd1("fsanitize-blacklist="), +flagpd1("fsanitize-cfi-canonical-jump-tables"), +flagpd1("fsanitize-cfi-cross-dso"), +flagpd1("fsanitize-cfi-icall-generalize-pointers"), +.{ + .name = "fsanitize-coverage=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +flagpd1("fsanitize-coverage-8bit-counters"), +flagpd1("fsanitize-coverage-indirect-calls"), +flagpd1("fsanitize-coverage-inline-8bit-counters"), +flagpd1("fsanitize-coverage-no-prune"), +flagpd1("fsanitize-coverage-pc-table"), +flagpd1("fsanitize-coverage-stack-depth"), +flagpd1("fsanitize-coverage-trace-bb"), +flagpd1("fsanitize-coverage-trace-cmp"), +flagpd1("fsanitize-coverage-trace-div"), +flagpd1("fsanitize-coverage-trace-gep"), +flagpd1("fsanitize-coverage-trace-pc"), +flagpd1("fsanitize-coverage-trace-pc-guard"), +joinpd1("fsanitize-coverage-type="), +joinpd1("fsanitize-hwaddress-abi="), +flagpd1("fsanitize-link-c++-runtime"), +flagpd1("fsanitize-link-runtime"), +flagpd1("fsanitize-memory-track-origins"), +joinpd1("fsanitize-memory-track-origins="), +flagpd1("fsanitize-memory-use-after-dtor"), +flagpd1("fsanitize-minimal-runtime"), +flagpd1("fsanitize-recover"), +.{ + .name = "fsanitize-recover=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +flagpd1("fsanitize-stats"), +joinpd1("fsanitize-system-blacklist="), +flagpd1("fsanitize-thread-atomics"), +flagpd1("fsanitize-thread-func-entry-exit"), +flagpd1("fsanitize-thread-memory-access"), +.{ + .name = "fsanitize-trap=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +joinpd1("fsanitize-undefined-strip-path-components="), +flagpd1("fsanitize-undefined-trap-on-error"), +flagpd1("fsave-optimization-record"), +joinpd1("fsave-optimization-record="), +flagpd1("fseh-exceptions"), +flagpd1("fshort-enums"), +flagpd1("fshort-wchar"), +flagpd1("fshow-column"), +joinpd1("fshow-overloads="), +flagpd1("fshow-source-location"), +flagpd1("fsignaling-math"), +flagpd1("fsigned-bitfields"), +flagpd1("fsigned-char"), +flagpd1("fsigned-wchar"), +flagpd1("fsigned-zeros"), +flagpd1("fsized-deallocation"), +flagpd1("fsjlj-exceptions"), +flagpd1("fslp-vectorize"), +flagpd1("fspell-checking"), +sepd1("fspell-checking-limit"), +joinpd1("fspell-checking-limit="), +flagpd1("fsplit-dwarf-inlining"), +flagpd1("fsplit-lto-unit"), +flagpd1("fsplit-stack"), +flagpd1("fstack-protector"), +flagpd1("fstack-protector-all"), +flagpd1("fstack-protector-strong"), +flagpd1("fstack-size-section"), +flagpd1("fstandalone-debug"), +flagpd1("fstrict-aliasing"), +flagpd1("fstrict-enums"), +flagpd1("fstrict-float-cast-overflow"), +flagpd1("fstrict-overflow"), +flagpd1("fstrict-return"), +flagpd1("fstrict-vtable-pointers"), +flagpd1("fstruct-path-tbaa"), +flagpd1("fsycl-is-device"), +joinpd1("fsymbol-partition="), +flagpd1("fsyntax-only"), +sepd1("ftabstop"), +joinpd1("ftabstop="), +sepd1("ftemplate-backtrace-limit"), +joinpd1("ftemplate-backtrace-limit="), +sepd1("ftemplate-depth"), +joinpd1("ftemplate-depth-"), +joinpd1("ftemplate-depth="), +flagpd1("ftest-coverage"), +joinpd1("ftest-module-file-extension="), +joinpd1("fthin-link-bitcode="), +joinpd1("fthinlto-index="), +flagpd1("fthreadsafe-statics"), +flagpd1("ftime-report"), +flagpd1("ftime-trace"), +joinpd1("ftime-trace-granularity="), +joinpd1("ftls-model="), +joinpd1("ftrap-function="), +flagpd1("ftrapping-math"), +flagpd1("ftrapv"), +sepd1("ftrapv-handler"), +joinpd1("ftrapv-handler="), +flagpd1("ftrigraphs"), +joinpd1("ftrivial-auto-var-init="), +sepd1("ftype-visibility"), +sepd1("function-alignment"), +flagpd1("ffunction-attribute-list"), +flagpd1("fno-function-attribute-list"), +flagpd1("funique-section-names"), +flagpd1("funit-at-a-time"), +flagpd1("funknown-anytype"), +flagpd1("funroll-loops"), +flagpd1("funsafe-math-optimizations"), +flagpd1("funsigned-bitfields"), +flagpd1("funsigned-char"), +flagpd1("funwind-tables"), +flagpd1("fuse-cxa-atexit"), +flagpd1("fuse-init-array"), +joinpd1("fuse-ld="), +flagpd1("fuse-line-directives"), +flagpd1("fuse-register-sized-bitfield-access"), +flagpd1("fvalidate-ast-input-files-content"), +joinpd1("fveclib="), +flagpd1("fvectorize"), +flagpd1("fverbose-asm"), +flagpd1("fvirtual-function-elimination"), +sepd1("fvisibility"), +joinpd1("fvisibility="), +flagpd1("fvisibility-global-new-delete-hidden"), +flagpd1("fvisibility-inlines-hidden"), +flagpd1("fvisibility-ms-compat"), +flagpd1("fwasm-exceptions"), +joinpd1("fwchar-type="), +flagpd1("fwhole-program-vtables"), +flagpd1("fwrapv"), +flagpd1("fwritable-strings"), +flagpd1("fxray-always-emit-customevents"), +flagpd1("fxray-always-emit-typedevents"), +jspd1("fxray-always-instrument="), +jspd1("fxray-attr-list="), +jspd1("fxray-instruction-threshold"), +jspd1("fxray-instruction-threshold="), +flagpd1("fxray-instrument"), +jspd1("fxray-instrumentation-bundle="), +flagpd1("fxray-link-deps"), +jspd1("fxray-modes="), +jspd1("fxray-never-instrument="), +flagpd1("fzero-initialized-in-bss"), +flagpd1("fzvector"), +flagpd1("g0"), +flagpd1("g1"), +flagpd1("g2"), +flagpd1("g3"), +flagpd1("g"), +.{ + .name = "gcc-toolchain=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +sepd1("gcc-toolchain"), +flagpd1("gcodeview"), +flagpd1("gcodeview-ghash"), +joinpd1("gcoff"), +flagpd1("gcolumn-info"), +flagpd1("fgcse-after-reload"), +flagpd1("fno-gcse-after-reload"), +flagpd1("fgcse"), +flagpd1("fno-gcse"), +flagpd1("fgcse-las"), +flagpd1("fno-gcse-las"), +flagpd1("fgcse-sm"), +flagpd1("fno-gcse-sm"), +flagpd1("gdwarf"), +flagpd1("gdwarf-2"), +flagpd1("gdwarf-3"), +flagpd1("gdwarf-4"), +flagpd1("gdwarf-5"), +flagpd1("gdwarf-aranges"), +flagpd1("gembed-source"), +sepd1("gen-cdb-fragment-path"), +flagpd1("gen-reproducer"), +flagpd1("gfull"), +flagpd1("ggdb"), +flagpd1("ggdb0"), +flagpd1("ggdb1"), +flagpd1("ggdb2"), +flagpd1("ggdb3"), +flagpd1("ggnu-pubnames"), +flagpd1("ginline-line-tables"), +flagpd1("gline-directives-only"), +flagpd1("gline-tables-only"), +flagpd1("glldb"), +flagpd1("gmlt"), +flagpd1("gmodules"), +flagpd1("gno-codeview-ghash"), +flagpd1("gno-column-info"), +flagpd1("gno-embed-source"), +flagpd1("gno-gnu-pubnames"), +flagpd1("gno-inline-line-tables"), +flagpd1("gno-pubnames"), +flagpd1("gno-record-command-line"), +flagpd1("gno-strict-dwarf"), +flagpd1("fgnu"), +flagpd1("fno-gnu"), +.{ + .name = "gpu-max-threads-per-block=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +flagpd1("gpubnames"), +flagpd1("grecord-command-line"), +flagpd1("gsce"), +flagpd1("gsplit-dwarf"), +joinpd1("gsplit-dwarf="), +joinpd1("gstabs"), +flagpd1("gstrict-dwarf"), +flagpd1("gtoggle"), +flagpd1("gused"), +joinpd1("gvms"), +joinpd1("gxcoff"), +flagpd1("gz"), +joinpd1("gz="), +sepd1("header-include-file"), +joinpd1("headerpad_max_install_names"), +.{ + .name = "help", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "hip-device-lib=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "hip-device-lib-path=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "hip-link", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +jspd1("idirafter"), +jspd1("iframework"), +jspd1("iframeworkwithsysroot"), +.{ + .name = "imacros", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +sepd1("image_base"), +flagpd1("fimplement-inlines"), +flagpd1("fno-implement-inlines"), +flagpd1("fimplicit-none"), +flagpd1("fno-implicit-none"), +flagpd1("fimplicit-templates"), +flagpd1("fno-implicit-templates"), +sepd1("imultilib"), +.{ + .name = "include", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +sepd1("include-pch"), +flagpd1("index-header-map"), +sepd1("init"), +flagpd1("finit-local-zero"), +flagpd1("fno-init-local-zero"), +flagpd1("init-only"), +flagpd1("finline-functions-called-once"), +flagpd1("fno-inline-functions-called-once"), +flagpd1("finline-small-functions"), +flagpd1("fno-inline-small-functions"), +sepd1("install_name"), +flagpd1("finteger-4-integer-8"), +flagpd1("fno-integer-4-integer-8"), +jspd1("interface-stub-version="), +jspd1("internal-externc-isystem"), +jspd1("internal-isystem"), +flagpd1("fintrinsic-modules-path"), +flagpd1("fno-intrinsic-modules-path"), +flagpd1("fipa-cp"), +flagpd1("fno-ipa-cp"), +jspd1("iprefix"), +jspd1("iquote"), +jspd1("isysroot"), +jspd1("isystem"), +jspd1("isystem-after"), +jspd1("ivfsoverlay"), +flagpd1("fivopts"), +flagpd1("fno-ivopts"), +jspd1("iwithprefix"), +jspd1("iwithprefixbefore"), +jspd1("iwithsysroot"), +flagpd1("keep_private_externs"), +.{ + .name = "l", + .syntax = .joined_or_separate, + .zig_equivalent = .l, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +sepd1("lazy_framework"), +sepd1("lazy_library"), +.{ + .name = "libomptarget-nvptx-path=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "linker-option=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +sepd1("load"), +flagpd1("m16"), +flagpd1("m32"), +flagpd1("m3dnow"), +flagpd1("m3dnowa"), +flagpd1("m64"), +flagpd1("m80387"), +joinpd1("mabi="), +flagpd1("mabi=ieeelongdouble"), +flagpd1("mabicalls"), +joinpd1("mabs="), +flagpd1("madx"), +flagpd1("maes"), +sepd1("main-file-name"), +.{ + .name = "malign-branch=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +joinpd1("malign-branch-boundary="), +joinpd1("malign-branch-prefix-size="), +flagpd1("malign-double"), +joinpd1("malign-functions="), +joinpd1("malign-jumps="), +joinpd1("malign-loops="), +flagpd1("maltivec"), +joinpd1("mamdgpu-debugger-abi="), +joinpd1("mappletvos-version-min="), +joinpd1("mappletvsimulator-version-min="), +joinpd1("march="), +flagpd1("marm"), +joinpd1("masm="), +flagpd1("masm-verbose"), +flagpd1("massembler-fatal-warnings"), +flagpd1("massembler-no-warn"), +flagpd1("matomics"), +flagpd1("mavx"), +flagpd1("mavx2"), +flagpd1("mavx512bf16"), +flagpd1("mavx512bitalg"), +flagpd1("mavx512bw"), +flagpd1("mavx512cd"), +flagpd1("mavx512dq"), +flagpd1("mavx512er"), +flagpd1("mavx512f"), +flagpd1("mavx512ifma"), +flagpd1("mavx512pf"), +flagpd1("mavx512vbmi"), +flagpd1("mavx512vbmi2"), +flagpd1("mavx512vl"), +flagpd1("mavx512vnni"), +flagpd1("mavx512vp2intersect"), +flagpd1("mavx512vpopcntdq"), +flagpd1("fmax-identifier-length"), +flagpd1("fno-max-identifier-length"), +flagpd1("mbackchain"), +flagpd1("mbig-endian"), +flagpd1("mbmi"), +flagpd1("mbmi2"), +flagpd1("mbranch-likely"), +joinpd1("mbranch-protection="), +flagpd1("mbranch-target-enforce"), +flagpd1("mbranches-within-32B-boundaries"), +flagpd1("mbulk-memory"), +flagpd1("mcheck-zero-division"), +flagpd1("mcldemote"), +flagpd1("mclflushopt"), +flagpd1("mclwb"), +flagpd1("mclzero"), +joinpd1("mcmodel="), +flagpd1("mcmodel=medany"), +flagpd1("mcmodel=medlow"), +flagpd1("mcmpb"), +flagpd1("mcmse"), +sepd1("mcode-model"), +flagpd1("mcode-object-v3"), +joinpd1("mcompact-branches="), +joinpd1("mconsole"), +flagpd1("mconstant-cfstrings"), +flagpd1("mconstructor-aliases"), +joinpd1("mcpu="), +flagpd1("mcpu=?"), +flagpd1("mcrbits"), +flagpd1("mcrc"), +flagpd1("mcumode"), +flagpd1("mcx16"), +sepd1("mdebug-pass"), +joinpd1("mdefault-build-attributes"), +flagpd1("mdirect-move"), +flagpd1("mdisable-tail-calls"), +joinpd1("mdll"), +flagpd1("mdouble-float"), +flagpd1("mdsp"), +flagpd1("mdspr2"), +joinpd1("mdynamic-no-pic"), +sepd1("meabi"), +flagpd1("membedded-data"), +flagpd1("menable-no-infs"), +flagpd1("menable-no-nans"), +flagpd1("menable-unsafe-fp-math"), +flagpd1("menqcmd"), +flagpd1("fmerge-constants"), +flagpd1("fno-merge-constants"), +flagpd1("mexception-handling"), +flagpd1("mexecute-only"), +flagpd1("mextern-sdata"), +flagpd1("mf16c"), +flagpd1("mfancy-math-387"), +flagpd1("mfentry"), +flagpd1("mfix-and-continue"), +flagpd1("mfix-cortex-a53-835769"), +flagpd1("mfloat128"), +sepd1("mfloat-abi"), +joinpd1("mfloat-abi="), +flagpd1("mfma"), +flagpd1("mfma4"), +flagpd1("mfp32"), +flagpd1("mfp64"), +sepd1("mfpmath"), +joinpd1("mfpmath="), +flagpd1("mfprnd"), +joinpd1("mfpu="), +flagpd1("mfpxx"), +joinpd1("mframe-pointer="), +flagpd1("mfsgsbase"), +flagpd1("mfxsr"), +flagpd1("mgeneral-regs-only"), +flagpd1("mgfni"), +flagpd1("mginv"), +flagpd1("mglibc"), +flagpd1("mglobal-merge"), +flagpd1("mgpopt"), +flagpd1("mhard-float"), +flagpd1("mhvx"), +joinpd1("mhvx="), +joinpd1("mhvx-length="), +flagpd1("mhtm"), +joinpd1("mhwdiv="), +joinpd1("mhwmult="), +flagpd1("miamcu"), +flagpd1("mieee-fp"), +flagpd1("mieee-rnd-near"), +flagpd1("migrate"), +flagpd1("no-finalize-removal"), +flagpd1("no-ns-alloc-error"), +flagpd1("mimplicit-float"), +joinpd1("mimplicit-it="), +flagpd1("mincremental-linker-compatible"), +joinpd1("mindirect-jump="), +flagpd1("minline-all-stringops"), +flagpd1("minvariant-function-descriptors"), +flagpd1("minvpcid"), +joinpd1("mios-simulator-version-min="), +joinpd1("mios-version-min="), +joinpd1("miphoneos-version-min="), +joinpd1("miphonesimulator-version-min="), +flagpd1("mips1"), +flagpd1("mips16"), +flagpd1("mips2"), +flagpd1("mips3"), +flagpd1("mips32"), +flagpd1("mips32r2"), +flagpd1("mips32r3"), +flagpd1("mips32r5"), +flagpd1("mips32r6"), +flagpd1("mips4"), +flagpd1("mips5"), +flagpd1("mips64"), +flagpd1("mips64r2"), +flagpd1("mips64r3"), +flagpd1("mips64r5"), +flagpd1("mips64r6"), +flagpd1("misel"), +flagpd1("mkernel"), +flagpd1("mldc1-sdc1"), +sepd1("mlimit-float-precision"), +sepd1("mlink-bitcode-file"), +sepd1("mlink-builtin-bitcode"), +sepd1("mlink-cuda-bitcode"), +joinpd1("mlinker-version="), +flagpd1("mlittle-endian"), +sepd1("mllvm"), +flagpd1("mlocal-sdata"), +flagpd1("mlong-calls"), +flagpd1("mlong-double-128"), +flagpd1("mlong-double-64"), +flagpd1("mlong-double-80"), +flagpd1("mlongcall"), +flagpd1("mlwp"), +flagpd1("mlzcnt"), +joinpd1("mmacos-version-min="), +joinpd1("mmacosx-version-min="), +flagpd1("mmadd4"), +joinpd1("mmcu="), +flagpd1("mmemops"), +flagpd1("mmfcrf"), +flagpd1("mmfocrf"), +flagpd1("mmicromips"), +flagpd1("mmmx"), +flagpd1("mmovbe"), +flagpd1("mmovdir64b"), +flagpd1("mmovdiri"), +flagpd1("mmpx"), +flagpd1("mms-bitfields"), +flagpd1("mmsa"), +flagpd1("mmt"), +flagpd1("mmultivalue"), +flagpd1("mmutable-globals"), +flagpd1("mmwaitx"), +joinpd1("mnan="), +flagpd1("mno-3dnow"), +flagpd1("mno-3dnowa"), +flagpd1("mno-80387"), +flagpd1("mno-abicalls"), +flagpd1("mno-adx"), +flagpd1("mno-aes"), +flagpd1("mno-altivec"), +flagpd1("mno-atomics"), +flagpd1("mno-avx"), +flagpd1("mno-avx2"), +flagpd1("mno-avx512bf16"), +flagpd1("mno-avx512bitalg"), +flagpd1("mno-avx512bw"), +flagpd1("mno-avx512cd"), +flagpd1("mno-avx512dq"), +flagpd1("mno-avx512er"), +flagpd1("mno-avx512f"), +flagpd1("mno-avx512ifma"), +flagpd1("mno-avx512pf"), +flagpd1("mno-avx512vbmi"), +flagpd1("mno-avx512vbmi2"), +flagpd1("mno-avx512vl"), +flagpd1("mno-avx512vnni"), +flagpd1("mno-avx512vp2intersect"), +flagpd1("mno-avx512vpopcntdq"), +flagpd1("mno-backchain"), +flagpd1("mno-bmi"), +flagpd1("mno-bmi2"), +flagpd1("mno-branch-likely"), +flagpd1("mno-bulk-memory"), +flagpd1("mno-check-zero-division"), +flagpd1("mno-cldemote"), +flagpd1("mno-clflushopt"), +flagpd1("mno-clwb"), +flagpd1("mno-clzero"), +flagpd1("mno-cmpb"), +flagpd1("mno-code-object-v3"), +flagpd1("mno-constant-cfstrings"), +flagpd1("mno-crbits"), +flagpd1("mno-crc"), +flagpd1("mno-cumode"), +flagpd1("mno-cx16"), +joinpd1("mno-default-build-attributes"), +flagpd1("mno-dsp"), +flagpd1("mno-dspr2"), +flagpd1("mno-embedded-data"), +flagpd1("mno-enqcmd"), +flagpd1("mno-exception-handling"), +flagpd1("mnoexecstack"), +flagpd1("mno-execute-only"), +flagpd1("mno-extern-sdata"), +flagpd1("mno-f16c"), +flagpd1("mno-fix-cortex-a53-835769"), +flagpd1("mno-float128"), +flagpd1("mno-fma"), +flagpd1("mno-fma4"), +flagpd1("mno-fprnd"), +flagpd1("mno-fsgsbase"), +flagpd1("mno-fxsr"), +flagpd1("mno-gfni"), +flagpd1("mno-ginv"), +flagpd1("mno-global-merge"), +flagpd1("mno-gpopt"), +flagpd1("mno-hvx"), +flagpd1("mno-htm"), +flagpd1("mno-iamcu"), +flagpd1("mno-implicit-float"), +flagpd1("mno-incremental-linker-compatible"), +flagpd1("mno-inline-all-stringops"), +flagpd1("mno-invariant-function-descriptors"), +flagpd1("mno-invpcid"), +flagpd1("mno-isel"), +flagpd1("mno-ldc1-sdc1"), +flagpd1("mno-local-sdata"), +flagpd1("mno-long-calls"), +flagpd1("mno-longcall"), +flagpd1("mno-lwp"), +flagpd1("mno-lzcnt"), +flagpd1("mno-madd4"), +flagpd1("mno-memops"), +flagpd1("mno-mfcrf"), +flagpd1("mno-mfocrf"), +flagpd1("mno-micromips"), +flagpd1("mno-mips16"), +flagpd1("mno-mmx"), +flagpd1("mno-movbe"), +flagpd1("mno-movdir64b"), +flagpd1("mno-movdiri"), +flagpd1("mno-movt"), +flagpd1("mno-mpx"), +flagpd1("mno-ms-bitfields"), +flagpd1("mno-msa"), +flagpd1("mno-mt"), +flagpd1("mno-multivalue"), +flagpd1("mno-mutable-globals"), +flagpd1("mno-mwaitx"), +flagpd1("mno-neg-immediates"), +flagpd1("mno-nontrapping-fptoint"), +flagpd1("mno-nvj"), +flagpd1("mno-nvs"), +flagpd1("mno-odd-spreg"), +flagpd1("mno-omit-leaf-frame-pointer"), +flagpd1("mno-outline"), +flagpd1("mno-packed-stack"), +flagpd1("mno-packets"), +flagpd1("mno-pascal-strings"), +flagpd1("mno-pclmul"), +flagpd1("mno-pconfig"), +flagpd1("mno-pie-copy-relocations"), +flagpd1("mno-pku"), +flagpd1("mno-popcnt"), +flagpd1("mno-popcntd"), +flagpd1("mno-power8-vector"), +flagpd1("mno-power9-vector"), +flagpd1("mno-prefetchwt1"), +flagpd1("mno-prfchw"), +flagpd1("mno-ptwrite"), +flagpd1("mno-pure-code"), +flagpd1("mno-qpx"), +flagpd1("mno-rdpid"), +flagpd1("mno-rdrnd"), +flagpd1("mno-rdseed"), +flagpd1("mno-red-zone"), +flagpd1("mno-reference-types"), +flagpd1("mno-relax"), +flagpd1("mno-relax-all"), +flagpd1("mno-relax-pic-calls"), +flagpd1("mno-restrict-it"), +flagpd1("mno-retpoline"), +flagpd1("mno-retpoline-external-thunk"), +flagpd1("mno-rtd"), +flagpd1("mno-rtm"), +flagpd1("mno-sahf"), +flagpd1("mno-save-restore"), +flagpd1("mno-sgx"), +flagpd1("mno-sha"), +flagpd1("mno-shstk"), +flagpd1("mno-sign-ext"), +flagpd1("mno-simd128"), +flagpd1("mno-soft-float"), +flagpd1("mno-spe"), +flagpd1("mno-speculative-load-hardening"), +flagpd1("mno-sram-ecc"), +flagpd1("mno-sse"), +flagpd1("mno-sse2"), +flagpd1("mno-sse3"), +flagpd1("mno-sse4"), +flagpd1("mno-sse4.1"), +flagpd1("mno-sse4.2"), +flagpd1("mno-sse4a"), +flagpd1("mno-ssse3"), +flagpd1("mno-stack-arg-probe"), +flagpd1("mno-stackrealign"), +flagpd1("mno-tail-call"), +flagpd1("mno-tbm"), +flagpd1("mno-thumb"), +flagpd1("mno-tls-direct-seg-refs"), +flagpd1("mno-unaligned-access"), +flagpd1("mno-unimplemented-simd128"), +flagpd1("mno-vaes"), +flagpd1("mno-virt"), +flagpd1("mno-vpclmulqdq"), +flagpd1("mno-vsx"), +flagpd1("mno-vx"), +flagpd1("mno-vzeroupper"), +flagpd1("mno-waitpkg"), +flagpd1("mno-warn-nonportable-cfstrings"), +flagpd1("mno-wavefrontsize64"), +flagpd1("mno-wbnoinvd"), +flagpd1("mno-x87"), +flagpd1("mno-xgot"), +flagpd1("mno-xnack"), +flagpd1("mno-xop"), +flagpd1("mno-xsave"), +flagpd1("mno-xsavec"), +flagpd1("mno-xsaveopt"), +flagpd1("mno-xsaves"), +flagpd1("mno-zero-initialized-in-bss"), +flagpd1("mno-zvector"), +flagpd1("mnocrc"), +flagpd1("mno-direct-move"), +flagpd1("mnontrapping-fptoint"), +flagpd1("mnop-mcount"), +flagpd1("mno-crypto"), +flagpd1("mnvj"), +flagpd1("mnvs"), +flagpd1("modd-spreg"), +sepd1("module-dependency-dir"), +flagpd1("module-file-deps"), +flagpd1("module-file-info"), +flagpd1("fmodule-private"), +flagpd1("fno-module-private"), +flagpd1("fmodulo-sched-allow-regmoves"), +flagpd1("fno-modulo-sched-allow-regmoves"), +flagpd1("fmodulo-sched"), +flagpd1("fno-modulo-sched"), +flagpd1("momit-leaf-frame-pointer"), +joinpd1("moslib="), +flagpd1("moutline"), +flagpd1("mpacked-stack"), +flagpd1("mpackets"), +flagpd1("mpascal-strings"), +flagpd1("mpclmul"), +flagpd1("mpconfig"), +flagpd1("mpie-copy-relocations"), +flagpd1("mpku"), +flagpd1("mpopcnt"), +flagpd1("mpopcntd"), +flagpd1("mcrypto"), +flagpd1("mpower8-vector"), +flagpd1("mpower9-vector"), +joinpd1("mprefer-vector-width="), +flagpd1("mprefetchwt1"), +flagpd1("mprfchw"), +flagpd1("mptwrite"), +flagpd1("mpure-code"), +flagpd1("mqdsp6-compat"), +flagpd1("mqpx"), +flagpd1("mrdpid"), +flagpd1("mrdrnd"), +flagpd1("mrdseed"), +flagpd1("mreassociate"), +flagpd1("mrecip"), +.{ + .name = "mrecip=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +flagpd1("mrecord-mcount"), +flagpd1("mred-zone"), +flagpd1("mreference-types"), +sepd1("mregparm"), +joinpd1("mregparm="), +flagpd1("mrelax"), +flagpd1("mrelax-all"), +flagpd1("mrelax-pic-calls"), +.{ + .name = "mrelax-relocations", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +sepd1("mrelocation-model"), +flagpd1("mrestrict-it"), +flagpd1("mretpoline"), +flagpd1("mretpoline-external-thunk"), +flagpd1("mrtd"), +flagpd1("mrtm"), +flagpd1("msahf"), +flagpd1("msave-restore"), +flagpd1("msave-temp-labels"), +flagpd1("msecure-plt"), +flagpd1("msgx"), +flagpd1("msha"), +flagpd1("mshstk"), +flagpd1("msign-ext"), +joinpd1("msign-return-address="), +joinpd1("msign-return-address-key="), +flagpd1("msimd128"), +flagpd1("msingle-float"), +joinpd1("msmall-data-threshold="), +flagpd1("msoft-float"), +flagpd1("mspe"), +flagpd1("mspeculative-load-hardening"), +flagpd1("msram-ecc"), +flagpd1("msse"), +flagpd1("msse2"), +flagpd1("msse3"), +flagpd1("msse4"), +flagpd1("msse4.1"), +flagpd1("msse4.2"), +flagpd1("msse4a"), +flagpd1("mssse3"), +joinpd1("mstack-alignment="), +flagpd1("mstack-arg-probe"), +joinpd1("mstack-probe-size="), +flagpd1("mstackrealign"), +flagpd1("mstrict-align"), +sepd1("mt-migrate-directory"), +flagpd1("mtail-call"), +flagpd1("mtbm"), +sepd1("mthread-model"), +joinpd1("mthreads"), +flagpd1("mthumb"), +flagpd1("mtls-direct-seg-refs"), +joinpd1("mtls-size="), +sepd1("mtp"), +joinpd1("mtp="), +joinpd1("mtune="), +flagpd1("mtune=?"), +joinpd1("mtvos-simulator-version-min="), +joinpd1("mtvos-version-min="), +flagpd1("muclibc"), +flagpd1("multi_module"), +sepd1("multiply_defined"), +sepd1("multiply_defined_unused"), +flagpd1("munaligned-access"), +joinpd1("municode"), +flagpd1("munimplemented-simd128"), +flagpd1("munwind-tables"), +flagpd1("mv5"), +flagpd1("mv55"), +flagpd1("mv60"), +flagpd1("mv62"), +flagpd1("mv65"), +flagpd1("mv66"), +flagpd1("mvaes"), +flagpd1("mvirt"), +flagpd1("mvpclmulqdq"), +flagpd1("mvsx"), +flagpd1("mvx"), +flagpd1("mvzeroupper"), +flagpd1("mwaitpkg"), +flagpd1("mwarn-nonportable-cfstrings"), +joinpd1("mwatchos-simulator-version-min="), +joinpd1("mwatchos-version-min="), +joinpd1("mwatchsimulator-version-min="), +flagpd1("mwavefrontsize64"), +flagpd1("mwbnoinvd"), +joinpd1("mwindows"), +flagpd1("mx32"), +flagpd1("mx87"), +flagpd1("mxgot"), +flagpd1("mxnack"), +flagpd1("mxop"), +flagpd1("mxsave"), +flagpd1("mxsavec"), +flagpd1("mxsaveopt"), +flagpd1("mxsaves"), +flagpd1("mzvector"), +flagpd1("n"), +flagpd1("new-struct-path-tbaa"), +flagpd1("no_dead_strip_inits_and_terms"), +flagpd1("no-canonical-prefixes"), +flagpd1("no-code-completion-globals"), +flagpd1("no-code-completion-ns-level-decls"), +flagpd1("no-cpp-precomp"), +.{ + .name = "no-cuda-gpu-arch=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "no-cuda-include-ptx=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "no-cuda-noopt-device-debug", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "no-cuda-version-check", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +flagpd1("no-emit-llvm-uselists"), +flagpd1("no-implicit-float"), +.{ + .name = "no-integrated-cpp", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "no-pedantic", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +flagpd1("no-pie"), +flagpd1("no-pthread"), +flagpd1("no-struct-path-tbaa"), +.{ + .name = "no-system-header-prefix=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +flagpd1("nobuiltininc"), +flagpd1("nocpp"), +flagpd1("nocudainc"), +flagpd1("nodefaultlibs"), +flagpd1("nofixprebinding"), +flagpd1("nogpulib"), +flagpd1("nolibc"), +flagpd1("nomultidefs"), +flagpd1("fnon-call-exceptions"), +flagpd1("fno-non-call-exceptions"), +flagpd1("nopie"), +flagpd1("noprebind"), +flagpd1("noprofilelib"), +flagpd1("noseglinkedit"), +flagpd1("nostartfiles"), +flagpd1("nostdinc"), +flagpd1("nostdinc++"), +flagpd1("nostdlib"), +flagpd1("nostdlibinc"), +flagpd1("nostdlib++"), +flagpd1("nostdsysteminc"), +.{ + .name = "o", + .syntax = .joined_or_separate, + .zig_equivalent = .o, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +jspd1("objc-isystem"), +flagpd1("objcmt-atomic-property"), +flagpd1("objcmt-migrate-all"), +flagpd1("objcmt-migrate-annotation"), +flagpd1("objcmt-migrate-designated-init"), +flagpd1("objcmt-migrate-instancetype"), +flagpd1("objcmt-migrate-literals"), +flagpd1("objcmt-migrate-ns-macros"), +flagpd1("objcmt-migrate-property"), +flagpd1("objcmt-migrate-property-dot-syntax"), +flagpd1("objcmt-migrate-protocol-conformance"), +flagpd1("objcmt-migrate-readonly-property"), +flagpd1("objcmt-migrate-readwrite-property"), +flagpd1("objcmt-migrate-subscripting"), +flagpd1("objcmt-ns-nonatomic-iosonly"), +flagpd1("objcmt-returns-innerpointer-property"), +joinpd1("objcmt-whitelist-dir-path="), +jspd1("objcxx-isystem"), +flagpd1("object"), +sepd1("opt-record-file"), +sepd1("opt-record-format"), +sepd1("opt-record-passes"), +sepd1("output-asm-variant"), +flagpd1("p"), +flagpd1("fpack-derived"), +flagpd1("fno-pack-derived"), +jspd1("pagezero_size"), +.{ + .name = "pass-exit-codes", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +flagpd1("pch-through-hdrstop-create"), +flagpd1("pch-through-hdrstop-use"), +joinpd1("pch-through-header="), +.{ + .name = "pedantic", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "pedantic-errors", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +flagpd1("fpeel-loops"), +flagpd1("fno-peel-loops"), +flagpd1("fpermissive"), +flagpd1("fno-permissive"), +flagpd1("pg"), +flagpd1("pic-is-pie"), +sepd1("pic-level"), +flagpd1("pie"), +.{ + .name = "pipe", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +sepd1("plugin"), +.{ + .name = "plugin-arg-", + .syntax = .joined_and_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +joinpd1("preamble-bytes="), +flagpd1("prebind"), +flagpd1("prebind_all_twolevel_modules"), +flagpd1("fprefetch-loop-arrays"), +flagpd1("fno-prefetch-loop-arrays"), +flagpd1("preload"), +flagpd1("print-dependency-directives-minimized-source"), +.{ + .name = "print-effective-triple", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "print-file-name=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +flagpd1("print-ivar-layout"), +.{ + .name = "print-libgcc-file-name", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "print-multi-directory", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "print-multi-lib", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "print-multi-os-directory", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +flagpd1("print-preamble"), +.{ + .name = "print-prog-name=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "print-resource-dir", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "print-search-dirs", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +flagpd1("print-stats"), +.{ + .name = "print-supported-cpus", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "print-target-triple", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +flagpd1("fprintf"), +flagpd1("fno-printf"), +flagpd1("private_bundle"), +flagpd1("fprofile-correction"), +flagpd1("fno-profile-correction"), +flagpd1("fprofile"), +flagpd1("fno-profile"), +flagpd1("fprofile-generate-sampling"), +flagpd1("fno-profile-generate-sampling"), +flagpd1("fprofile-reusedist"), +flagpd1("fno-profile-reusedist"), +flagpd1("fprofile-values"), +flagpd1("fno-profile-values"), +flagpd1("fprotect-parens"), +flagpd1("fno-protect-parens"), +flagpd1("pthread"), +flagpd1("pthreads"), +.{ + .name = "ptxas-path=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +flagpd1("r"), +flagpd1("frange-check"), +flagpd1("fno-range-check"), +flagpd1("rdynamic"), +sepd1("read_only_relocs"), +flagpd1("freal-4-real-10"), +flagpd1("fno-real-4-real-10"), +flagpd1("freal-4-real-16"), +flagpd1("fno-real-4-real-16"), +flagpd1("freal-4-real-8"), +flagpd1("fno-real-4-real-8"), +flagpd1("freal-8-real-10"), +flagpd1("fno-real-8-real-10"), +flagpd1("freal-8-real-16"), +flagpd1("fno-real-8-real-16"), +flagpd1("freal-8-real-4"), +flagpd1("fno-real-8-real-4"), +flagpd1("frealloc-lhs"), +flagpd1("fno-realloc-lhs"), +sepd1("record-command-line"), +flagpd1("frecursive"), +flagpd1("fno-recursive"), +flagpd1("fregs-graph"), +flagpd1("fno-regs-graph"), +flagpd1("relaxed-aliasing"), +.{ + .name = "relocatable-pch", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +flagpd1("remap"), +sepd1("remap-file"), +flagpd1("frename-registers"), +flagpd1("fno-rename-registers"), +flagpd1("freorder-blocks"), +flagpd1("fno-reorder-blocks"), +flagpd1("frepack-arrays"), +flagpd1("fno-repack-arrays"), +sepd1("resource-dir"), +joinpd1("resource-dir="), +flagpd1("rewrite-legacy-objc"), +flagpd1("rewrite-macros"), +flagpd1("rewrite-objc"), +flagpd1("rewrite-test"), +flagpd1("fripa"), +flagpd1("fno-ripa"), +sepd1("rpath"), +.{ + .name = "rsp-quoting=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "rtlib=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +flagpd1("s"), +.{ + .name = "save-stats", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "save-stats=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "save-temps", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "save-temps=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +flagpd1("fschedule-insns2"), +flagpd1("fno-schedule-insns2"), +flagpd1("fschedule-insns"), +flagpd1("fno-schedule-insns"), +flagpd1("fsecond-underscore"), +flagpd1("fno-second-underscore"), +.{ + .name = "sectalign", + .syntax = .{ .multi_arg = 3 }, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +.{ + .name = "sectcreate", + .syntax = .{ .multi_arg = 3 }, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +.{ + .name = "sectobjectsymbols", + .syntax = .{ .multi_arg = 2 }, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +.{ + .name = "sectorder", + .syntax = .{ .multi_arg = 3 }, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +flagpd1("fsee"), +flagpd1("fno-see"), +jspd1("seg1addr"), +sepd1("seg_addr_table"), +sepd1("seg_addr_table_filename"), +.{ + .name = "segaddr", + .syntax = .{ .multi_arg = 2 }, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +.{ + .name = "segcreate", + .syntax = .{ .multi_arg = 3 }, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +flagpd1("seglinkedit"), +.{ + .name = "segprot", + .syntax = .{ .multi_arg = 3 }, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +joinpd1("segs_read_"), +sepd1("segs_read_only_addr"), +sepd1("segs_read_write_addr"), +flagpd1("setup-static-analyzer"), +.{ + .name = "shared", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +flagpd1("shared-libgcc"), +flagpd1("shared-libsan"), +flagpd1("show-encoding"), +.{ + .name = "show-includes", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +flagpd1("show-inst"), +flagpd1("fsign-zero"), +flagpd1("fno-sign-zero"), +flagpd1("fsignaling-nans"), +flagpd1("fno-signaling-nans"), +flagpd1("single_module"), +flagpd1("fsingle-precision-constant"), +flagpd1("fno-single-precision-constant"), +flagpd1("fspec-constr-count"), +flagpd1("fno-spec-constr-count"), +.{ + .name = "specs", + .syntax = .separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "specs=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +sepd1("split-dwarf-file"), +sepd1("split-dwarf-output"), +flagpd1("split-stacks"), +flagpd1("fstack-arrays"), +flagpd1("fno-stack-arrays"), +flagpd1("fstack-check"), +flagpd1("fno-stack-check"), +sepd1("stack-protector"), +sepd1("stack-protector-buffer-size"), +.{ + .name = "static", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +flagpd1("static-define"), +flagpd1("static-libgcc"), +flagpd1("static-libgfortran"), +flagpd1("static-libsan"), +flagpd1("static-libstdc++"), +flagpd1("static-openmp"), +flagpd1("static-pie"), +joinpd1("stats-file="), +.{ + .name = "std=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +joinpd1("std-default="), +.{ + .name = "stdlib=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +jspd1("stdlib++-isystem"), +flagpd1("fstrength-reduce"), +flagpd1("fno-strength-reduce"), +jspd1("sub_library"), +jspd1("sub_umbrella"), +flagpd1("sys-header-deps"), +.{ + .name = "system-header-prefix=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +flagpd1("t"), +.{ + .name = "target=", + .syntax = .joined, + .zig_equivalent = .target, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +sepd1("target-abi"), +sepd1("target-cpu"), +sepd1("target-feature"), +.{ + .name = "target", + .syntax = .separate, + .zig_equivalent = .target, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +sepd1("target-linker-version"), +joinpd1("target-sdk-version="), +flagpd1("templight-dump"), +flagpd1("test-coverage"), +flagpd1("time"), +flagpd1("ftls-model"), +flagpd1("fno-tls-model"), +flagpd1("ftracer"), +flagpd1("fno-tracer"), +.{ + .name = "traditional", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "traditional-cpp", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +flagpd1("ftree-dce"), +flagpd1("fno-tree-dce"), +flagpd1("ftree_loop_im"), +flagpd1("fno-tree_loop_im"), +flagpd1("ftree_loop_ivcanon"), +flagpd1("fno-tree_loop_ivcanon"), +flagpd1("ftree_loop_linear"), +flagpd1("fno-tree_loop_linear"), +flagpd1("ftree-salias"), +flagpd1("fno-tree-salias"), +flagpd1("ftree-ter"), +flagpd1("fno-tree-ter"), +flagpd1("ftree-vectorizer-verbose"), +flagpd1("fno-tree-vectorizer-verbose"), +flagpd1("ftree-vrp"), +flagpd1("fno-tree-vrp"), +.{ + .name = "trigraphs", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +flagpd1("trim-egraph"), +sepd1("triple"), +joinpd1("triple="), +flagpd1("twolevel_namespace"), +flagpd1("twolevel_namespace_hints"), +jspd1("u"), +sepd1("umbrella"), +flagpd1("undef"), +jspd1("undefined"), +flagpd1("funderscoring"), +flagpd1("fno-underscoring"), +sepd1("unexported_symbols_list"), +flagpd1("funroll-all-loops"), +flagpd1("fno-unroll-all-loops"), +flagpd1("funsafe-loop-optimizations"), +flagpd1("fno-unsafe-loop-optimizations"), +flagpd1("funswitch-loops"), +flagpd1("fno-unswitch-loops"), +.{ + .name = "unwindlib=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +flagpd1("fuse-linker-plugin"), +flagpd1("fno-use-linker-plugin"), +flagpd1("v"), +flagpd1("fvariable-expansion-in-unroller"), +flagpd1("fno-variable-expansion-in-unroller"), +flagpd1("fvect-cost-model"), +flagpd1("fno-vect-cost-model"), +flagpd1("vectorize-loops"), +flagpd1("vectorize-slp"), +flagpd1("verify"), +.{ + .name = "verify=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +.{ + .name = "verify-debug-info", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +flagpd1("verify-ignore-unexpected"), +.{ + .name = "verify-ignore-unexpected=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +flagpd1("verify-pch"), +flagpd1("version"), +.{ + .name = "via-file-asm", + .syntax = .flag, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +joinpd1("vtordisp-mode="), +flagpd1("w"), +sepd1("weak_framework"), +sepd1("weak_library"), +sepd1("weak_reference_mismatches"), +joinpd1("weak-l"), +flagpd1("fweb"), +flagpd1("fno-web"), +flagpd1("whatsloaded"), +flagpd1("fwhole-file"), +flagpd1("fno-whole-file"), +flagpd1("fwhole-program"), +flagpd1("fno-whole-program"), +flagpd1("whyload"), +jspd1("working-directory"), +joinpd1("working-directory="), +jspd1("x"), +joinpd1("y"), +sepd1("z"), +};}; diff --git a/src-self-hosted/stage2.zig b/src-self-hosted/stage2.zig index 78aa278005..23df042cbe 100644 --- a/src-self-hosted/stage2.zig +++ b/src-self-hosted/stage2.zig @@ -113,6 +113,7 @@ const Error = extern enum { TargetHasNoDynamicLinker, InvalidAbiVersion, InvalidOperatingSystemVersion, + UnknownClangOption, }; const FILE = std.c.FILE; @@ -1215,3 +1216,157 @@ fn convertSlice(slice: [][:0]u8, ptr: *[*][*:0]u8, len: *usize) !void { } ptr.* = new_slice.ptr; } + +const clang_args = @import("clang_options.zig").list; + +// ABI warning +pub const ClangArgIterator = extern struct { + has_next: bool, + zig_equivalent: ZigEquivalent, + only_arg: [*:0]const u8, + second_arg: [*:0]const u8, + other_args_ptr: [*]const [*:0]const u8, + other_args_len: usize, + argv_ptr: [*]const [*:0]const u8, + argv_len: usize, + next_index: usize, + + // ABI warning + pub const ZigEquivalent = extern enum { + target, + o, + c, + other, + positional, + l, + }; + + fn init(argv: []const [*:0]const u8) ClangArgIterator { + return .{ + .next_index = 2, // `zig cc foo` this points to `foo` + .has_next = argv.len > 2, + .zig_equivalent = undefined, + .only_arg = undefined, + .second_arg = undefined, + .other_args_ptr = undefined, + .other_args_len = undefined, + .argv_ptr = argv.ptr, + .argv_len = argv.len, + }; + } + + fn next(self: *ClangArgIterator) !void { + assert(self.has_next); + assert(self.next_index < self.argv_len); + // In this state we know that the parameter we are looking at is a root parameter + // rather than an argument to a parameter. + self.other_args_ptr = self.argv_ptr + self.next_index; + self.other_args_len = 1; // We adjust this value below when necessary. + const arg = mem.span(self.argv_ptr[self.next_index]); + self.next_index += 1; + defer { + if (self.next_index >= self.argv_len) self.has_next = false; + } + + if (!mem.startsWith(u8, arg, "-")) { + self.zig_equivalent = .positional; + self.only_arg = arg.ptr; + return; + } + + find_clang_arg: for (clang_args) |clang_arg| switch (clang_arg.syntax) { + .flag => if (clang_arg.matchEql(arg)) { + self.zig_equivalent = clang_arg.zig_equivalent; + self.only_arg = arg.ptr; + + break :find_clang_arg; + }, + .joined, .comma_joined => { + // Example: --target=foo + const prefix_len = clang_arg.matchStartsWith(arg); + if (prefix_len != 0) { + self.zig_equivalent = clang_arg.zig_equivalent; + self.only_arg = arg.ptr + prefix_len; // This will skip over the "--target=" part. + + break :find_clang_arg; + } + }, + .joined_or_separate => { + // Examples: `-lfoo`, `-l foo` + const prefix_len = clang_arg.matchStartsWith(arg); + if (prefix_len == arg.len) { + if (self.next_index >= self.argv_len) { + std.debug.warn("Expected parameter after '{}'\n", .{arg}); + process.exit(1); + } + self.only_arg = self.argv_ptr[self.next_index]; + self.next_index += 1; + self.other_args_len += 1; + self.zig_equivalent = clang_arg.zig_equivalent; + + break :find_clang_arg; + } else if (prefix_len != 0) { + self.zig_equivalent = clang_arg.zig_equivalent; + self.only_arg = arg.ptr + prefix_len; + + break :find_clang_arg; + } + }, + .joined_and_separate => { + // Example: `-Xopenmp-target=riscv64-linux-unknown foo` + const prefix_len = clang_arg.matchStartsWith(arg); + if (prefix_len != 0) { + self.only_arg = arg.ptr + prefix_len; + if (self.next_index >= self.argv_len) { + std.debug.warn("Expected parameter after '{}'\n", .{arg}); + process.exit(1); + } + self.second_arg = self.argv_ptr[self.next_index]; + self.next_index += 1; + self.other_args_len += 1; + self.zig_equivalent = clang_arg.zig_equivalent; + break :find_clang_arg; + } + }, + .separate => if (clang_arg.matchEql(arg)) { + if (self.next_index >= self.argv_len) { + std.debug.warn("Expected parameter after '{}'\n", .{arg}); + process.exit(1); + } + self.only_arg = self.argv_ptr[self.next_index]; + self.next_index += 1; + self.other_args_len += 1; + self.zig_equivalent = clang_arg.zig_equivalent; + break :find_clang_arg; + }, + .remaining_args_joined => { + const prefix_len = clang_arg.matchStartsWith(arg); + if (prefix_len != 0) { + @panic("TODO"); + } + }, + .multi_arg => if (clang_arg.matchEql(arg)) { + @panic("TODO"); + }, + } + else { + std.debug.warn("Unknown Clang option: '{}'\n", .{arg}); + process.exit(1); + } + } +}; + +export fn stage2_clang_arg_iterator( + result: *ClangArgIterator, + argc: usize, + argv: [*]const [*:0]const u8, +) void { + result.* = ClangArgIterator.init(argv[0..argc]); +} + +export fn stage2_clang_arg_next(it: *ClangArgIterator) Error { + it.next() catch |err| switch (err) { + error.UnknownClangOption => return .UnknownClangOption, + }; + return .None; +} diff --git a/src/codegen.cpp b/src/codegen.cpp index c2ce2ac3eb..7729172c2f 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -9778,7 +9778,7 @@ static void gen_c_object(CodeGen *g, Buf *self_exe_path, CFile *c_file) { Termination term; ZigList args = {}; args.append(buf_ptr(self_exe_path)); - args.append("cc"); + args.append("clang"); Buf *out_dep_path = buf_sprintf("%s.d", buf_ptr(out_obj_path)); add_cc_args(g, args, buf_ptr(out_dep_path), false); diff --git a/src/error.cpp b/src/error.cpp index 2e92a98217..c246ea5f31 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -83,6 +83,7 @@ const char *err_str(Error err) { case ErrorTargetHasNoDynamicLinker: return "target has no dynamic linker"; case ErrorInvalidAbiVersion: return "invalid C ABI version"; case ErrorInvalidOperatingSystemVersion: return "invalid operating system version"; + case ErrorUnknownClangOption: return "unknown Clang option"; } return "(invalid error)"; } diff --git a/src/link.cpp b/src/link.cpp index 0ae47c8432..b340206b14 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -2008,7 +2008,7 @@ static const char *get_def_lib(CodeGen *parent, const char *name, Buf *def_in_fi ZigList args = {}; args.append(buf_ptr(self_exe_path)); - args.append("cc"); + args.append("clang"); args.append("-x"); args.append("c"); args.append(buf_ptr(def_in_file)); diff --git a/src/main.cpp b/src/main.cpp index 76d6eadb14..f850b0bc47 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -36,7 +36,7 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) { " build-lib [source] create library from source or object files\n" " build-obj [source] create object from source or assembly\n" " builtin show the source code of @import(\"builtin\")\n" - " cc C compiler\n" + " cc use Zig as a drop-in C compiler\n" " fmt parse files and render in canonical zig format\n" " id print the base64-encoded compiler id\n" " init-exe initialize a `zig build` application in the cwd\n" @@ -271,7 +271,7 @@ static int main0(int argc, char **argv) { return 0; } - if (argc >= 2 && (strcmp(argv[1], "cc") == 0 || + if (argc >= 2 && (strcmp(argv[1], "clang") == 0 || strcmp(argv[1], "-cc1") == 0 || strcmp(argv[1], "-cc1as") == 0)) { return ZigClang_main(argc, argv); @@ -575,9 +575,55 @@ static int main0(int argc, char **argv) { return (term.how == TerminationIdClean) ? term.code : -1; } else if (argc >= 2 && strcmp(argv[1], "fmt") == 0) { return stage2_fmt(argc, argv); - } - - for (int i = 1; i < argc; i += 1) { + } else if (argc >= 2 && strcmp(argv[1], "cc") == 0) { + const char *o_arg = nullptr; + bool c_arg = false; + Stage2ClangArgIterator it; + stage2_clang_arg_iterator(&it, argc, argv); + while (it.has_next) { + if ((err = stage2_clang_arg_next(&it))) { + fprintf(stderr, "unable to parse command line parameters: %s\n", err_str(err)); + return EXIT_FAILURE; + } + switch (it.kind) { + case Stage2ClangArgTarget: // example: -target riscv64-linux-unknown + target_string = it.only_arg; + break; + case Stage2ClangArgO: // -o + o_arg = it.only_arg; + break; + case Stage2ClangArgC: // -c + c_arg = true; + break; + case Stage2ClangArgOther: + for (size_t i = 0; i < it.other_args_len; i += 1) { + clang_argv.append(it.other_args_ptr[i]); + } + break; + case Stage2ClangArgPositional: { + CFile *c_file = heap::c_allocator.create(); + c_file->source_path = it.only_arg; + c_source_files.append(c_file); + break; + } + case Stage2ClangArgL: // -l + if (strcmp(it.only_arg, "c") == 0) + have_libc = true; + link_libs.append(it.only_arg); + break; + } + } + if (!c_arg) { + cmd = CmdBuild; + out_type = OutTypeExe; + if (o_arg == nullptr) { + zig_panic("TODO set out name to a.out"); + } + } else { + cmd = CmdBuild; + out_type = OutTypeObj; + } + } else for (int i = 1; i < argc; i += 1) { char *arg = argv[i]; if (arg[0] == '-') { diff --git a/src/stage2.cpp b/src/stage2.cpp index a8d8b7cf97..c83b1aa77c 100644 --- a/src/stage2.cpp +++ b/src/stage2.cpp @@ -304,3 +304,15 @@ enum Error stage2_detect_native_paths(struct Stage2NativePaths *native_paths) { return ErrorNone; } + +void stage2_clang_arg_iterator(struct Stage2ClangArgIterator *it, + size_t argc, char **argv) +{ + const char *msg = "stage0 called stage2_clang_arg_iterator"; + stage2_panic(msg, strlen(msg)); +} + +enum Error stage2_clang_arg_next(struct Stage2ClangArgIterator *it) { + const char *msg = "stage0 called stage2_clang_arg_next"; + stage2_panic(msg, strlen(msg)); +} diff --git a/src/stage2.h b/src/stage2.h index 9ba7e062b1..2abdc4c513 100644 --- a/src/stage2.h +++ b/src/stage2.h @@ -105,6 +105,7 @@ enum Error { ErrorTargetHasNoDynamicLinker, ErrorInvalidAbiVersion, ErrorInvalidOperatingSystemVersion, + ErrorUnknownClangOption, }; // ABI warning @@ -316,4 +317,34 @@ struct Stage2NativePaths { // ABI warning ZIG_EXTERN_C enum Error stage2_detect_native_paths(struct Stage2NativePaths *native_paths); +// ABI warning +enum Stage2ClangArg { + Stage2ClangArgTarget, + Stage2ClangArgO, + Stage2ClangArgC, + Stage2ClangArgOther, + Stage2ClangArgPositional, + Stage2ClangArgL, +}; + +// ABI warning +struct Stage2ClangArgIterator { + bool has_next; + enum Stage2ClangArg kind; + const char *only_arg; + const char *second_arg; + const char **other_args_ptr; + size_t other_args_len; + const char **argv_ptr; + size_t argv_len; + size_t next_index; +}; + +// ABI warning +ZIG_EXTERN_C void stage2_clang_arg_iterator(struct Stage2ClangArgIterator *it, + size_t argc, char **argv); + +// ABI warning +ZIG_EXTERN_C enum Error stage2_clang_arg_next(struct Stage2ClangArgIterator *it); + #endif diff --git a/tools/process_headers.zig b/tools/process_headers.zig index abdc9fabf9..7c9befcffa 100644 --- a/tools/process_headers.zig +++ b/tools/process_headers.zig @@ -1,14 +1,14 @@ -// To get started, run this tool with no args and read the help message. -// -// The build systems of musl-libc and glibc require specifying a single target -// architecture. Meanwhile, Zig supports out-of-the-box cross compilation for -// every target. So the process to create libc headers that Zig ships is to use -// this tool. -// First, use the musl/glibc build systems to create installations of all the -// targets in the `glibc_targets`/`musl_targets` variables. -// Next, run this tool to create a new directory which puts .h files into -// subdirectories, with `generic` being files that apply to all architectures. -// You'll then have to manually update Zig source repo with these new files. +//! To get started, run this tool with no args and read the help message. +//! +//! The build systems of musl-libc and glibc require specifying a single target +//! architecture. Meanwhile, Zig supports out-of-the-box cross compilation for +//! every target. So the process to create libc headers that Zig ships is to use +//! this tool. +//! First, use the musl/glibc build systems to create installations of all the +//! targets in the `glibc_targets`/`musl_targets` variables. +//! Next, run this tool to create a new directory which puts .h files into +//! subdirectories, with `generic` being files that apply to all architectures. +//! You'll then have to manually update Zig source repo with these new files. const std = @import("std"); const Arch = std.Target.Cpu.Arch; diff --git a/tools/update_clang_options.zig b/tools/update_clang_options.zig new file mode 100644 index 0000000000..863c67b68d --- /dev/null +++ b/tools/update_clang_options.zig @@ -0,0 +1,274 @@ +//! To get started, run this tool with no args and read the help message. +//! +//! Clang has a file "options.td" which describes all of its command line parameter options. +//! When using `zig cc`, Zig acts as a proxy between the user and Clang. It does not need +//! to understand all the parameters, but it does need to understand some of them, such as +//! the target. This means that Zig must understand when a C command line parameter expects +//! to "consume" the next parameter on the command line. +//! +//! For example, `-z -target` would mean to pass `-target` to the linker, whereas `-E -target` +//! would mean that the next parameter specifies the target. + +const std = @import("std"); +const fs = std.fs; +const assert = std.debug.assert; +const json = std.json; + +const KnownOpt = struct { + name: []const u8, + + /// Corresponds to stage.zig ClangArgIterator.Kind + ident: []const u8, +}; + +const known_options = [_]KnownOpt{ + .{ + .name = "target", + .ident = "target", + }, + .{ + .name = "o", + .ident = "o", + }, + .{ + .name = "c", + .ident = "c", + }, + .{ + .name = "l", + .ident = "l", + }, +}; + +const blacklisted_options = [_][]const u8{}; + +fn knownOption(name: []const u8) ?[]const u8 { + const chopped_name = if (std.mem.endsWith(u8, name, "=")) name[0 .. name.len - 1] else name; + for (known_options) |item| { + if (std.mem.eql(u8, chopped_name, item.name)) { + return item.ident; + } + } + return null; +} + +pub fn main() anyerror!void { + var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator); + defer arena.deinit(); + + const allocator = &arena.allocator; + const args = try std.process.argsAlloc(allocator); + + if (args.len <= 1) { + usageAndExit(std.io.getStdErr(), args[0], 1); + } + if (std.mem.eql(u8, args[1], "--help")) { + usageAndExit(std.io.getStdOut(), args[0], 0); + } + if (args.len < 3) { + usageAndExit(std.io.getStdErr(), args[0], 1); + } + + const llvm_tblgen_exe = args[1]; + if (std.mem.startsWith(u8, llvm_tblgen_exe, "-")) { + usageAndExit(std.io.getStdErr(), args[0], 1); + } + + const llvm_src_root = args[2]; + if (std.mem.startsWith(u8, llvm_src_root, "-")) { + usageAndExit(std.io.getStdErr(), args[0], 1); + } + + const child_args = [_][]const u8{ + llvm_tblgen_exe, + "--dump-json", + try std.fmt.allocPrint(allocator, "{}/clang/include/clang/Driver/Options.td", .{llvm_src_root}), + try std.fmt.allocPrint(allocator, "-I={}/llvm/include", .{llvm_src_root}), + try std.fmt.allocPrint(allocator, "-I={}/clang/include/clang/Driver", .{llvm_src_root}), + }; + + const child_result = try std.ChildProcess.exec2(.{ + .allocator = allocator, + .argv = &child_args, + .max_output_bytes = 100 * 1024 * 1024, + }); + + std.debug.warn("{}\n", .{child_result.stderr}); + + const json_text = switch (child_result.term) { + .Exited => |code| if (code == 0) child_result.stdout else { + std.debug.warn("llvm-tblgen exited with code {}\n", .{code}); + std.process.exit(1); + }, + else => { + std.debug.warn("llvm-tblgen crashed\n", .{}); + std.process.exit(1); + }, + }; + + var parser = json.Parser.init(allocator, false); + const tree = try parser.parse(json_text); + const root_map = &tree.root.Object; + + var all_names = std.ArrayList([]const u8).init(allocator); + { + var it = root_map.iterator(); + it_map: while (it.next()) |kv| { + if (kv.key.len == 0) continue; + if (kv.key[0] == '!') continue; + if (kv.value != .Object) continue; + if (!kv.value.Object.contains("NumArgs")) continue; + if (!kv.value.Object.contains("Name")) continue; + for (blacklisted_options) |blacklisted_key| { + if (std.mem.eql(u8, blacklisted_key, kv.key)) continue :it_map; + } + if (kv.value.Object.get("Name").?.value.String.len == 0) continue; + try all_names.append(kv.key); + } + } + std.sort.sort([]const u8, all_names.span(), nameLessThan); + + var stdout_bos = std.io.bufferedOutStream(std.io.getStdOut().outStream()); + const stdout = stdout_bos.outStream(); + try stdout.writeAll( + \\// This file is generated by tools/update_clang_options.zig. + \\// zig fmt: off + \\usingnamespace @import("clang_options.zig"); + \\pub const data = blk: { @setEvalBranchQuota(6000); break :blk &[_]CliArg{ + \\ + ); + + for (all_names.span()) |key| { + const obj = &root_map.get(key).?.value.Object; + const name = obj.get("Name").?.value.String; + var pd1 = false; + var pd2 = false; + var pslash = false; + for (obj.get("Prefixes").?.value.Array.span()) |prefix_json| { + const prefix = prefix_json.String; + if (std.mem.eql(u8, prefix, "-")) { + pd1 = true; + } else if (std.mem.eql(u8, prefix, "--")) { + pd2 = true; + } else if (std.mem.eql(u8, prefix, "/")) { + pslash = true; + } else { + std.debug.warn("{} (key {}) has unrecognized prefix '{}'\n", .{ name, key, prefix }); + std.process.exit(1); + } + } + const num_args = @intCast(u8, obj.get("NumArgs").?.value.Integer); + const syntax_str: []const u8 = blk: { + for (obj.get("!superclasses").?.value.Array.span()) |superclass_json| { + const superclass = superclass_json.String; + if (std.mem.eql(u8, superclass, "Joined")) { + break :blk ".joined"; + } else if (std.mem.eql(u8, superclass, "CLJoined")) { + break :blk ".joined"; + } else if (std.mem.eql(u8, superclass, "CLIgnoredJoined")) { + break :blk ".joined"; + } else if (std.mem.eql(u8, superclass, "CLCompileJoined")) { + break :blk ".joined"; + } else if (std.mem.eql(u8, superclass, "JoinedOrSeparate")) { + break :blk ".joined_or_separate"; + } else if (std.mem.eql(u8, superclass, "CLJoinedOrSeparate")) { + break :blk ".joined_or_separate"; + } else if (std.mem.eql(u8, superclass, "CLCompileJoinedOrSeparate")) { + break :blk ".joined_or_separate"; + } else if (std.mem.eql(u8, superclass, "Flag")) { + break :blk ".flag"; + } else if (std.mem.eql(u8, superclass, "CLFlag")) { + break :blk ".flag"; + } else if (std.mem.eql(u8, superclass, "CLIgnoredFlag")) { + break :blk ".flag"; + } else if (std.mem.eql(u8, superclass, "Separate")) { + break :blk ".separate"; + } else if (std.mem.eql(u8, superclass, "JoinedAndSeparate")) { + break :blk ".joined_and_separate"; + } else if (std.mem.eql(u8, superclass, "CommaJoined")) { + break :blk ".comma_joined"; + } else if (std.mem.eql(u8, superclass, "CLRemainingArgsJoined")) { + break :blk ".remaining_args_joined"; + } else if (std.mem.eql(u8, superclass, "MultiArg")) { + break :blk try std.fmt.allocPrint(allocator, ".{{ .multi_arg = {} }}", .{num_args}); + } + } + if (std.mem.eql(u8, name, "")) { + break :blk ".flag"; + } else if (std.mem.eql(u8, name, "")) { + break :blk ".flag"; + } + const kind_def = obj.get("Kind").?.value.Object.get("def").?.value.String; + if (std.mem.eql(u8, kind_def, "KIND_FLAG")) { + break :blk ".flag"; + } + std.debug.warn("{} (key {}) has unrecognized superclasses:\n", .{ name, key }); + for (obj.get("!superclasses").?.value.Array.span()) |superclass_json| { + std.debug.warn(" {}\n", .{superclass_json.String}); + } + std.process.exit(1); + }; + if (knownOption(name)) |ident| { + try stdout.print( + \\.{{ + \\ .name = "{}", + \\ .syntax = {}, + \\ .zig_equivalent = .{}, + \\ .pd1 = {}, + \\ .pd2 = {}, + \\ .psl = {}, + \\}}, + \\ + , .{ name, syntax_str, ident, pd1, pd2, pslash }); + } else if (pd1 and !pd2 and !pslash and + std.mem.eql(u8, syntax_str, ".flag")) + { + try stdout.print("flagpd1(\"{}\"),\n", .{name}); + } else if (pd1 and !pd2 and !pslash and + std.mem.eql(u8, syntax_str, ".joined")) + { + try stdout.print("joinpd1(\"{}\"),\n", .{name}); + } else if (pd1 and !pd2 and !pslash and + std.mem.eql(u8, syntax_str, ".joined_or_separate")) + { + try stdout.print("jspd1(\"{}\"),\n", .{name}); + } else if (pd1 and !pd2 and !pslash and + std.mem.eql(u8, syntax_str, ".separate")) + { + try stdout.print("sepd1(\"{}\"),\n", .{name}); + } else { + try stdout.print( + \\.{{ + \\ .name = "{}", + \\ .syntax = {}, + \\ .zig_equivalent = .other, + \\ .pd1 = {}, + \\ .pd2 = {}, + \\ .psl = {}, + \\}}, + \\ + , .{ name, syntax_str, pd1, pd2, pslash }); + } + } + + try stdout.writeAll( + \\};}; + \\ + ); + + try stdout_bos.flush(); +} + +fn nameLessThan(a: []const u8, b: []const u8) bool { + return std.mem.lessThan(u8, a, b); +} + +fn usageAndExit(file: fs.File, arg0: []const u8, code: u8) noreturn { + file.outStream().print( + \\Usage: {} /path/to/llvm-tblgen /path/to/git/llvm/llvm-project + \\ + \\Prints to stdout Zig code which you can use to replace the file src-self-hosted/clang_options_data.zig. + \\ + , .{arg0}) catch std.process.exit(1); + std.process.exit(code); +} From 0eee98edc1e505486a9ec51a331d3aa322fce9ee Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 21 Mar 2020 15:29:52 -0400 Subject: [PATCH 2/6] zig cc improvements * The generated options data file is sorted now in a way that makes sure longer prefixes are first. This prevents collisions with some parameters. * Add support for `-fPIC`, `-fno-PIC`, `-nostdlib`, `-shared`, `-rdynamic`, `-Wl,-soname`, `-Wl,-rpath` * Better support for `-o`. * Disable generating h files * Shared library support. * Better positional argument support. --- src-self-hosted/clang_options.zig | 6 +- src-self-hosted/clang_options_data.zig | 2952 ++++++++++++------------ src-self-hosted/stage2.zig | 11 +- src/main.cpp | 149 +- src/stage2.h | 8 + tools/update_clang_options.zig | 260 ++- 6 files changed, 1838 insertions(+), 1548 deletions(-) diff --git a/src-self-hosted/clang_options.zig b/src-self-hosted/clang_options.zig index 9fa35b8f9a..538f281706 100644 --- a/src-self-hosted/clang_options.zig +++ b/src-self-hosted/clang_options.zig @@ -20,7 +20,7 @@ pub const CliArg = struct { /// Prefixed by "/" psl: bool = false, - const Syntax = union(enum) { + pub const Syntax = union(enum) { /// A flag with no values. flag, @@ -46,7 +46,7 @@ pub const CliArg = struct { multi_arg: u8, }; - fn matchEql(self: CliArg, arg: []const u8) bool { + pub fn matchEql(self: CliArg, arg: []const u8) bool { if (self.pd1 and arg.len >= self.name.len + 1 and mem.startsWith(u8, arg, "-") and mem.eql(u8, arg[1..], self.name)) { @@ -65,7 +65,7 @@ pub const CliArg = struct { return false; } - fn matchStartsWith(self: CliArg, arg: []const u8) usize { + pub fn matchStartsWith(self: CliArg, arg: []const u8) usize { if (self.pd1 and arg.len >= self.name.len + 1 and mem.startsWith(u8, arg, "-") and mem.startsWith(u8, arg[1..], self.name)) { diff --git a/src-self-hosted/clang_options_data.zig b/src-self-hosted/clang_options_data.zig index a88f3583c9..a21069f93c 100644 --- a/src-self-hosted/clang_options_data.zig +++ b/src-self-hosted/clang_options_data.zig @@ -2,21 +2,13 @@ // zig fmt: off usingnamespace @import("clang_options.zig"); pub const data = blk: { @setEvalBranchQuota(6000); break :blk &[_]CliArg{ -jspd1("A"), -joinpd1("A-"), -jspd1("B"), flagpd1("C"), flagpd1("CC"), -jspd1("D"), flagpd1("E"), flagpd1("EB"), flagpd1("EL"), flagpd1("Eonly"), -jspd1("F"), -jspd1("G"), -joinpd1("G="), flagpd1("H"), -jspd1("I"), .{ .name = "", .syntax = .flag, @@ -26,42 +18,25 @@ jspd1("I"), .psl = false, }, flagpd1("I-"), -jspd1("J"), -jspd1("L"), flagpd1("M"), flagpd1("MD"), -jspd1("MF"), flagpd1("MG"), -jspd1("MJ"), flagpd1("MM"), flagpd1("MMD"), flagpd1("MP"), -jspd1("MQ"), -jspd1("MT"), flagpd1("MV"), flagpd1("Mach"), -joinpd1("O"), flagpd1("O0"), flagpd1("O4"), flagpd1("O"), flagpd1("ObjC"), flagpd1("ObjC++"), -joinpd1("Ofast"), flagpd1("P"), flagpd1("Q"), flagpd1("Qn"), flagpd1("Qunused-arguments"), flagpd1("Qy"), -joinpd1("R"), -joinpd1("Rpass="), -joinpd1("Rpass-analysis="), -joinpd1("Rpass-missed="), flagpd1("S"), -jspd1("T"), -jspd1("Tbss"), -jspd1("Tdata"), -jspd1("Ttext"), -jspd1("U"), .{ .name = "", .syntax = .flag, @@ -70,74 +45,24 @@ jspd1("U"), .pd2 = false, .psl = false, }, -jspd1("V"), flagpd1("WCL4"), -joinpd1("W"), -.{ - .name = "Wa,", - .syntax = .comma_joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = false, -}, flagpd1("Wall"), flagpd1("Wdeprecated"), -joinpd1("Wframe-larger-than="), -.{ - .name = "Wl,", - .syntax = .comma_joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = false, -}, -joinpd1("Wlarge-by-value-copy="), flagpd1("Wlarge-by-value-copy"), -joinpd1("Wlarger-than-"), -joinpd1("Wlarger-than="), flagpd1("Wno-deprecated"), -joinpd1("Wno-nonportable-cfstrings"), flagpd1("Wno-rewrite-macros"), flagpd1("Wno-write-strings"), -joinpd1("Wnonportable-cfstrings"), -.{ - .name = "Wp,", - .syntax = .comma_joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = false, -}, flagpd1("Wwrite-strings"), flagpd1("X"), -joinpd1("X"), sepd1("Xanalyzer"), -.{ - .name = "Xarch_", - .syntax = .joined_and_separate, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = false, -}, sepd1("Xassembler"), sepd1("Xclang"), sepd1("Xcuda-fatbinary"), sepd1("Xcuda-ptxas"), sepd1("Xlinker"), sepd1("Xopenmp-target"), -.{ - .name = "Xopenmp-target=", - .syntax = .joined_and_separate, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = false, -}, sepd1("Xpreprocessor"), flagpd1("Z"), -joinpd1("Z"), flagpd1("Z-Xlinker-no-demangle"), flagpd1("Z-reserved-lib-cckext"), flagpd1("Z-reserved-lib-stdc++"), @@ -150,23 +75,7 @@ sepd1("Zlinker-input"), .pd2 = true, .psl = false, }, -.{ - .name = "CLASSPATH=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, flagpd1("###"), -.{ - .name = "AI", - .syntax = .joined_or_separate, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "Brepro", .syntax = .flag, @@ -207,14 +116,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "D", - .syntax = .joined_or_separate, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "E", .syntax = .flag, @@ -223,14 +124,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "EH", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "EP", .syntax = .flag, @@ -239,14 +132,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "F", - .syntax = .joined_or_separate, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "FA", .syntax = .flag, @@ -255,14 +140,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "FA", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "FC", .syntax = .flag, @@ -271,22 +148,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "FI", - .syntax = .joined_or_separate, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, -.{ - .name = "FR", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "FS", .syntax = .flag, @@ -295,78 +156,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "FU", - .syntax = .joined_or_separate, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, -.{ - .name = "Fa", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, -.{ - .name = "Fd", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, -.{ - .name = "Fe", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, -.{ - .name = "Fi", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, -.{ - .name = "Fm", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, -.{ - .name = "Fo", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, -.{ - .name = "Fp", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, -.{ - .name = "Fr", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "Fx", .syntax = .flag, @@ -559,14 +348,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "Gs", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "Gv", .syntax = .flag, @@ -631,14 +412,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "I", - .syntax = .joined_or_separate, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "J", .syntax = .flag, @@ -695,14 +468,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "MP", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "MT", .syntax = .flag, @@ -719,14 +484,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "O", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "P", .syntax = .flag, @@ -775,14 +532,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "Qpar-report", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "Qsafe_fp_loads", .syntax = .flag, @@ -815,22 +564,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "Qvec-report", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, -.{ - .name = "RTC", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "TC", .syntax = .flag, @@ -847,30 +580,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "Tc", - .syntax = .joined_or_separate, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, -.{ - .name = "Tp", - .syntax = .joined_or_separate, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, -.{ - .name = "U", - .syntax = .joined_or_separate, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "V", .syntax = .flag, @@ -975,14 +684,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "Yc", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "Yd", .syntax = .flag, @@ -991,22 +692,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "Yl", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, -.{ - .name = "Yu", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "Z7", .syntax = .flag, @@ -1047,14 +732,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "ZW", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "Za", .syntax = .flag, @@ -1063,14 +740,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "Zc:", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "Zc:__cplusplus", .syntax = .flag, @@ -1287,14 +956,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "Zm", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "Zo", .syntax = .flag, @@ -1311,14 +972,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "Zp", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "Zp", .syntax = .flag, @@ -1343,14 +996,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "arch:", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "await", .syntax = .flag, @@ -1375,38 +1020,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "cgthreads", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, -.{ - .name = "clang:", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, -.{ - .name = "clr", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, -.{ - .name = "constexpr:", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "d1PP", .syntax = .flag, @@ -1423,14 +1036,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "d2", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "d2FastFail", .syntax = .flag, @@ -1471,30 +1076,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "doc", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, -.{ - .name = "errorReport", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, -.{ - .name = "execution-charset:", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "fallback", .syntax = .flag, @@ -1503,14 +1084,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "favor", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "fp:except", .syntax = .flag, @@ -1551,18 +1124,10 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "guard:", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "help", .syntax = .flag, - .zig_equivalent = .other, + .zig_equivalent = .passthrough, .pd1 = true, .pd2 = false, .psl = true, @@ -1583,14 +1148,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "imsvc", - .syntax = .joined_or_separate, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "kernel", .syntax = .flag, @@ -1607,14 +1164,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "link", - .syntax = .remaining_args_joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "nologo", .syntax = .flag, @@ -1623,14 +1172,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "o", - .syntax = .joined_or_separate, - .zig_equivalent = .o, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "openmp", .syntax = .flag, @@ -1703,22 +1244,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "source-charset:", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, -.{ - .name = "std:", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "u", .syntax = .flag, @@ -1751,14 +1276,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "vd", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "vmb", .syntax = .flag, @@ -1815,14 +1332,6 @@ flagpd1("###"), .pd2 = false, .psl = true, }, -.{ - .name = "w", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = true, -}, .{ .name = "w", .syntax = .flag, @@ -1895,14 +1404,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "analyzer-output", - .syntax = .joined_or_separate, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "assemble", .syntax = .flag, @@ -1919,14 +1420,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "assert=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "bootclasspath", .syntax = .separate, @@ -1935,14 +1428,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "bootclasspath=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "classpath", .syntax = .separate, @@ -1951,14 +1436,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "classpath=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "comments", .syntax = .flag, @@ -1999,14 +1476,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "debug=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "define-macro", .syntax = .separate, @@ -2015,14 +1484,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "define-macro=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "dependencies", .syntax = .flag, @@ -2039,14 +1500,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "dyld-prefix=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "encoding", .syntax = .separate, @@ -2055,14 +1508,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "encoding=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "entry", .syntax = .flag, @@ -2079,14 +1524,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "extdirs=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "extra-warnings", .syntax = .flag, @@ -2103,14 +1540,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "for-linker=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "force-link", .syntax = .separate, @@ -2119,14 +1548,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "force-link=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "help-hidden", .syntax = .flag, @@ -2135,22 +1556,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "imacros=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, -.{ - .name = "include=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "include-barrier", .syntax = .flag, @@ -2167,14 +1572,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "include-directory=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "include-directory-after", .syntax = .separate, @@ -2183,14 +1580,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "include-directory-after=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "include-prefix", .syntax = .separate, @@ -2199,14 +1588,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "include-prefix=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "include-with-prefix", .syntax = .separate, @@ -2215,14 +1596,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "include-with-prefix=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "include-with-prefix-after", .syntax = .separate, @@ -2231,14 +1604,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "include-with-prefix-after=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "include-with-prefix-before", .syntax = .separate, @@ -2247,14 +1612,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "include-with-prefix-before=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "language", .syntax = .separate, @@ -2263,14 +1620,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "language=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "library-directory", .syntax = .separate, @@ -2279,14 +1628,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "library-directory=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "mhwdiv", .syntax = .separate, @@ -2295,14 +1636,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "mhwdiv=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "migrate", .syntax = .flag, @@ -2330,7 +1663,7 @@ flagpd1("###"), .{ .name = "no-standard-libraries", .syntax = .flag, - .zig_equivalent = .other, + .zig_equivalent = .nostdlib, .pd1 = false, .pd2 = true, .psl = false, @@ -2359,14 +1692,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "optimize=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "output", .syntax = .separate, @@ -2375,14 +1700,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "output=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "output-class-directory", .syntax = .separate, @@ -2391,14 +1708,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "output-class-directory=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "param", .syntax = .separate, @@ -2407,14 +1716,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "param=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "precompile", .syntax = .flag, @@ -2431,14 +1732,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "prefix=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "preprocess", .syntax = .flag, @@ -2503,14 +1796,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "resource=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "rtlib", .syntax = .separate, @@ -2559,14 +1844,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "sysroot=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "target-help", .syntax = .flag, @@ -2591,14 +1868,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "undefine-macro=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "unsigned-char", .syntax = .flag, @@ -2631,22 +1900,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -.{ - .name = "warn-", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, -.{ - .name = "warn-=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "write-dependencies", .syntax = .flag, @@ -2663,7 +1916,6 @@ flagpd1("###"), .pd2 = true, .psl = false, }, -joinpd1("a"), sepd1("add-plugin"), flagpd1("faggressive-function-elimination"), flagpd1("fno-aggressive-function-elimination"), @@ -2684,9 +1936,7 @@ flagpd1("cfg-add-implicit-dtors"), flagpd1("unoptimized-cfg"), flagpd1("analyze"), sepd1("analyze-function"), -joinpd1("analyze-function="), sepd1("analyzer-checker"), -joinpd1("analyzer-checker="), flagpd1("analyzer-checker-help"), flagpd1("analyzer-checker-help-alpha"), flagpd1("analyzer-checker-help-developer"), @@ -2695,32 +1945,23 @@ flagpd1("analyzer-checker-option-help-alpha"), flagpd1("analyzer-checker-option-help-developer"), sepd1("analyzer-config"), sepd1("analyzer-config-compatibility-mode"), -joinpd1("analyzer-config-compatibility-mode="), flagpd1("analyzer-config-help"), sepd1("analyzer-constraints"), -joinpd1("analyzer-constraints="), flagpd1("analyzer-disable-all-checks"), sepd1("analyzer-disable-checker"), -joinpd1("analyzer-disable-checker="), flagpd1("analyzer-disable-retry-exhausted"), flagpd1("analyzer-display-progress"), sepd1("analyzer-dump-egraph"), -joinpd1("analyzer-dump-egraph="), sepd1("analyzer-inline-max-stack-depth"), -joinpd1("analyzer-inline-max-stack-depth="), sepd1("analyzer-inlining-mode"), -joinpd1("analyzer-inlining-mode="), flagpd1("analyzer-list-enabled-checkers"), sepd1("analyzer-max-loop"), flagpd1("analyzer-opt-analyze-headers"), flagpd1("analyzer-opt-analyze-nested-blocks"), sepd1("analyzer-output"), -joinpd1("analyzer-output="), sepd1("analyzer-purge"), -joinpd1("analyzer-purge="), flagpd1("analyzer-stats"), sepd1("analyzer-store"), -joinpd1("analyzer-store="), flagpd1("analyzer-viz-egraph-graphviz"), flagpd1("analyzer-werror"), flagpd1("fslp-vectorize-aggressive"), @@ -2735,7 +1976,6 @@ flagpd1("fhonor-infinites"), flagpd1("fno-honor-infinites"), flagpd1("findirect-virtual-calls"), sepd1("fnew-alignment"), -joinpd1("objcmt-white-list-dir-path="), flagpd1("faligned-new"), flagpd1("fno-aligned-new"), flagpd1("fsched-interblock"), @@ -2912,27 +2152,16 @@ flagpd1("arcmt-migrate-emit-errors"), sepd1("arcmt-migrate-report-output"), flagpd1("arcmt-modify"), flagpd1("ast-dump"), -joinpd1("ast-dump="), flagpd1("ast-dump-all"), -joinpd1("ast-dump-all="), sepd1("ast-dump-filter"), flagpd1("ast-dump-lookups"), flagpd1("ast-list"), sepd1("ast-merge"), flagpd1("ast-print"), flagpd1("ast-view"), -.{ - .name = "autocomplete=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, flagpd1("fautomatic"), flagpd1("fno-automatic"), sepd1("aux-triple"), -jspd1("b"), flagpd1("fbackslash"), flagpd1("fno-backslash"), flagpd1("fbacktrace"), @@ -2953,12 +2182,10 @@ sepd1("bundle_loader"), .pd2 = false, .psl = false, }, -jspd1("c-isystem"), flagpd1("fcaller-saves"), flagpd1("fno-caller-saves"), flagpd1("cc1"), flagpd1("cc1as"), -joinpd1("ccc-"), flagpd1("ccc-arcmt-check"), sepd1("ccc-arcmt-migrate"), flagpd1("ccc-arcmt-modify"), @@ -2973,14 +2200,6 @@ sepd1("chain-include"), flagpd1("fcheck-array-temporaries"), flagpd1("fno-check-array-temporaries"), flagpd1("cl-denorms-are-zero"), -.{ - .name = "cl-ext=", - .syntax = .comma_joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = false, -}, flagpd1("cl-fast-relaxed-math"), flagpd1("cl-finite-math-only"), flagpd1("cl-fp32-correctly-rounded-divide-sqrt"), @@ -2989,13 +2208,10 @@ flagpd1("cl-mad-enable"), flagpd1("cl-no-signed-zeros"), flagpd1("cl-opt-disable"), flagpd1("cl-single-precision-constant"), -joinpd1("cl-std="), flagpd1("cl-strict-aliasing"), flagpd1("cl-uniform-work-group-size"), flagpd1("cl-unsafe-math-optimizations"), -jspd1("client_name"), sepd1("code-completion-at"), -joinpd1("code-completion-at="), flagpd1("code-completion-brief-comments"), flagpd1("code-completion-macros"), flagpd1("code-completion-patterns"), @@ -3008,7 +2224,6 @@ flagpd1("code-completion-with-fixits"), .pd2 = true, .psl = false, }, -jspd1("compatibility_version"), flagpd1("compiler-options-dump"), .{ .name = "compress-debug-sections", @@ -3018,14 +2233,6 @@ flagpd1("compiler-options-dump"), .pd2 = true, .psl = false, }, -.{ - .name = "compress-debug-sections=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = true, - .psl = false, -}, .{ .name = "config", .syntax = .separate, @@ -3034,22 +2241,6 @@ flagpd1("compiler-options-dump"), .pd2 = true, .psl = false, }, -.{ - .name = "config-system-dir=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, -.{ - .name = "config-user-dir=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "coverage", .syntax = .flag, @@ -3060,12 +2251,9 @@ flagpd1("compiler-options-dump"), }, flagpd1("coverage-cfg-checksum"), sepd1("coverage-data-file"), -joinpd1("coverage-data-file="), flagpd1("coverage-exit-block-before-body"), flagpd1("coverage-no-function-names-in-data"), sepd1("coverage-notes-file"), -joinpd1("coverage-notes-file="), -joinpd1("coverage-version="), flagpd1("cpp"), flagpd1("cpp-precomp"), flagpd1("fcray-pointer"), @@ -3086,14 +2274,6 @@ flagpd1("fno-cray-pointer"), .pd2 = true, .psl = false, }, -.{ - .name = "cuda-gpu-arch=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "cuda-host-only", .syntax = .flag, @@ -3102,14 +2282,6 @@ flagpd1("fno-cray-pointer"), .pd2 = true, .psl = false, }, -.{ - .name = "cuda-include-ptx=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "cuda-noopt-device-debug", .syntax = .flag, @@ -3118,14 +2290,6 @@ flagpd1("fno-cray-pointer"), .pd2 = true, .psl = false, }, -.{ - .name = "cuda-path=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "cuda-path-ignore-env", .syntax = .flag, @@ -3134,23 +2298,18 @@ flagpd1("fno-cray-pointer"), .pd2 = true, .psl = false, }, -jspd1("current_version"), -jspd1("cxx-isystem"), flagpd1("dA"), flagpd1("dD"), flagpd1("dI"), flagpd1("dM"), flagpd1("d"), -joinpd1("d"), flagpd1("fd-lines-as-code"), flagpd1("fno-d-lines-as-code"), flagpd1("fd-lines-as-comments"), flagpd1("fno-d-lines-as-comments"), flagpd1("dead_strip"), flagpd1("debug-forward-template-params"), -joinpd1("debug-info-kind="), flagpd1("debug-info-macro"), -joinpd1("debugger-tuning="), flagpd1("fdefault-double-8"), flagpd1("fno-default-double-8"), sepd1("default-function-attr"), @@ -3163,14 +2322,6 @@ flagpd1("fno-default-real-8"), sepd1("defsym"), sepd1("dependency-dot"), sepd1("dependency-file"), -.{ - .name = "dependent-lib=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, flagpd1("detailed-preprocessing-record"), flagpd1("fdevirtualize"), flagpd1("fno-devirtualize"), @@ -3190,14 +2341,6 @@ flagpd1("disable-red-zone"), flagpd1("discard-value-names"), flagpd1("fdollar-ok"), flagpd1("fno-dollar-ok"), -.{ - .name = "driver-mode=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, flagpd1("dump-coverage-mapping"), flagpd1("dump-deserialized-decls"), flagpd1("fdump-fortran-optimized"), @@ -3216,13 +2359,10 @@ sepd1("dwarf-debug-flags"), sepd1("dwarf-debug-producer"), flagpd1("dwarf-explicit-import"), flagpd1("dwarf-ext-refs"), -joinpd1("dwarf-version="), sepd1("dylib_file"), flagpd1("dylinker"), -jspd1("dylinker_install_name"), flagpd1("dynamic"), flagpd1("dynamiclib"), -jspd1("e"), flagpd1("feliminate-unused-debug-types"), flagpd1("fno-eliminate-unused-debug-types"), flagpd1("emit-ast"), @@ -3241,24 +2381,24 @@ flagpd1("emit-obj"), flagpd1("emit-pch"), flagpd1("enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang"), sepd1("error-on-deserialized-decl"), -joinpd1("error-on-deserialized-decl="), sepd1("exported_symbols_list"), flagpd1("fexternal-blas"), flagpd1("fno-external-blas"), flagpd1("ff2c"), flagpd1("fno-f2c"), -flagpd1("fPIC"), +.{ + .name = "fPIC", + .syntax = .flag, + .zig_equivalent = .pic, + .pd1 = true, + .pd2 = false, + .psl = false, +}, flagpd1("fPIE"), flagpd1("faccess-control"), -joinpd1("faddress-space-map-mangling="), flagpd1("faddrsig"), flagpd1("falign-functions"), -joinpd1("falign-functions="), -joinpd1("falign-jumps="), -joinpd1("falign-labels="), -joinpd1("falign-loops="), flagpd1("faligned-allocation"), -joinpd1("faligned-new="), flagpd1("fallow-editor-placeholders"), flagpd1("fallow-half-arguments-and-returns"), flagpd1("fallow-pch-with-compiler-errors"), @@ -3281,18 +2421,12 @@ flagpd1("fasynchronous-unwind-tables"), flagpd1("ffat-lto-objects"), flagpd1("fno-fat-lto-objects"), flagpd1("fauto-profile"), -joinpd1("fauto-profile="), flagpd1("fauto-profile-accurate"), flagpd1("fautolink"), -joinpd1("fblas-matmul-limit="), flagpd1("fblocks"), flagpd1("fblocks-runtime-optional"), -joinpd1("fbootclasspath="), flagpd1("fborland-extensions"), sepd1("fbracket-depth"), -joinpd1("fbracket-depth="), -joinpd1("fbuild-session-file="), -joinpd1("fbuild-session-timestamp="), flagpd1("fbuiltin"), flagpd1("fbuiltin-module-map"), flagpd1("fcall-saved-x10"), @@ -3307,46 +2441,24 @@ flagpd1("fcall-saved-x9"), flagpd1("fcaret-diagnostics"), sepd1("fcaret-diagnostics-max-lines"), flagpd1("fcf-protection"), -joinpd1("fcf-protection="), -joinpd1("fcf-runtime-abi="), flagpd1("fchar8_t"), -joinpd1("fcheck="), flagpd1("fcheck-new"), flagpd1("fno-check-new"), -joinpd1("fclang-abi-compat="), -joinpd1("fclasspath="), -joinpd1("fcoarray="), flagpd1("fcolor-diagnostics"), -.{ - .name = "fcomment-block-commands=", - .syntax = .comma_joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = false, -}, flagpd1("fcommon"), -joinpd1("fcompile-resource="), flagpd1("fcomplete-member-pointers"), flagpd1("fconcepts-ts"), flagpd1("fconst-strings"), flagpd1("fconstant-cfstrings"), sepd1("fconstant-string-class"), -joinpd1("fconstant-string-class="), sepd1("fconstexpr-backtrace-limit"), -joinpd1("fconstexpr-backtrace-limit="), sepd1("fconstexpr-depth"), -joinpd1("fconstexpr-depth="), sepd1("fconstexpr-steps"), -joinpd1("fconstexpr-steps="), flagpd1("fconvergent-functions"), -joinpd1("fconvert="), flagpd1("fcoroutines-ts"), flagpd1("fcoverage-mapping"), -joinpd1("fcrash-diagnostics-dir="), flagpd1("fcreate-profile"), flagpd1("fcs-profile-generate"), -joinpd1("fcs-profile-generate="), flagpd1("fcuda-allow-variadic-functions"), flagpd1("fcuda-approx-transcendentals"), flagpd1("fcuda-flush-denormals-to-zero"), @@ -3358,14 +2470,11 @@ flagpd1("fcxx-modules"), flagpd1("fc++-static-destructors"), flagpd1("fdata-sections"), sepd1("fdebug-compilation-dir"), -joinpd1("fdebug-compilation-dir="), -joinpd1("fdebug-default-version="), flagpd1("fdebug-info-for-profiling"), flagpd1("fdebug-macro"), flagpd1("fdebug-pass-arguments"), flagpd1("fdebug-pass-manager"), flagpd1("fdebug-pass-structure"), -joinpd1("fdebug-prefix-map="), flagpd1("fdebug-ranges-base-address"), flagpd1("fdebug-types-section"), flagpd1("fdebugger-cast-result-to-id"), @@ -3373,25 +2482,17 @@ flagpd1("fdebugger-objc-literal"), flagpd1("fdebugger-support"), flagpd1("fdeclare-opencl-builtins"), flagpd1("fdeclspec"), -joinpd1("fdefault-calling-conv="), flagpd1("fdelayed-template-parsing"), flagpd1("fdelete-null-pointer-checks"), -joinpd1("fdenormal-fp-math="), -joinpd1("fdepfile-entry="), flagpd1("fdeprecated-macro"), flagpd1("fdiagnostics-absolute-paths"), flagpd1("fdiagnostics-color"), -joinpd1("fdiagnostics-color="), flagpd1("fdiagnostics-fixit-info"), sepd1("fdiagnostics-format"), -joinpd1("fdiagnostics-format="), -joinpd1("fdiagnostics-hotness-threshold="), flagpd1("fdiagnostics-parseable-fixits"), flagpd1("fdiagnostics-print-source-range-info"), sepd1("fdiagnostics-show-category"), -joinpd1("fdiagnostics-show-category="), flagpd1("fdiagnostics-show-hotness"), -joinpd1("fdiagnostics-show-location="), flagpd1("fdiagnostics-show-note-include-stack"), flagpd1("fdiagnostics-show-option"), flagpd1("fdiagnostics-show-template-tree"), @@ -3409,7 +2510,6 @@ flagpd1("fdwarf-exceptions"), flagpd1("felide-constructors"), flagpd1("feliminate-unused-debug-symbols"), flagpd1("fembed-bitcode"), -joinpd1("fembed-bitcode="), flagpd1("fembed-bitcode-marker"), flagpd1("femit-all-decls"), flagpd1("femit-coverage-data"), @@ -3417,24 +2517,17 @@ flagpd1("femit-coverage-notes"), flagpd1("femit-debug-entry-values"), flagpd1("femulated-tls"), flagpd1("fencode-extended-block-signature"), -joinpd1("fencoding="), sepd1("ferror-limit"), -joinpd1("ferror-limit="), flagpd1("fescaping-block-tail-calls"), flagpd1("fexceptions"), -joinpd1("fexcess-precision="), -joinpd1("fexec-charset="), flagpd1("fexperimental-isel"), flagpd1("fexperimental-new-constant-interpreter"), flagpd1("fexperimental-new-pass-manager"), -joinpd1("fextdirs="), flagpd1("fexternc-nounwind"), flagpd1("ffake-address-space-map"), flagpd1("ffast-math"), -joinpd1("ffile-prefix-map="), flagpd1("ffine-grained-bitfield-accesses"), flagpd1("ffinite-math-only"), -joinpd1("ffixed-line-length-"), flagpd1("ffixed-point"), flagpd1("ffixed-r19"), flagpd1("ffixed-r9"), @@ -3474,18 +2567,12 @@ flagpd1("fforbid-guard-variables"), flagpd1("fforce-dwarf-frame"), flagpd1("fforce-emit-vtables"), flagpd1("fforce-enable-int128"), -joinpd1("ffp-contract="), -joinpd1("ffp-exception-behavior="), -joinpd1("ffp-model="), -joinpd1("ffpe-trap="), -joinpd1("ffree-line-length-"), flagpd1("ffreestanding"), flagpd1("ffunction-sections"), flagpd1("fgnu89-inline"), flagpd1("fgnu-inline-asm"), flagpd1("fgnu-keywords"), flagpd1("fgnu-runtime"), -joinpd1("fgnuc-version="), flagpd1("fgpu-allow-device-init"), flagpd1("fgpu-rdc"), flagpd1("fheinous-gnu-extensions"), @@ -3499,17 +2586,11 @@ sepd1("filetype"), flagpd1("fimplicit-module-maps"), flagpd1("fimplicit-modules"), flagpd1("finclude-default-header"), -joinpd1("finit-character="), -joinpd1("finit-integer="), -joinpd1("finit-logical="), -joinpd1("finit-real="), flagpd1("finline"), flagpd1("finline-functions"), flagpd1("finline-hint-functions"), -joinpd1("finline-limit="), flagpd1("finline-limit"), flagpd1("fno-inline-limit"), -joinpd1("finput-charset="), flagpd1("finstrument-function-entry-bare"), flagpd1("finstrument-functions"), flagpd1("finstrument-functions-after-inlining"), @@ -3520,59 +2601,36 @@ flagpd1("fix-what-you-can"), flagpd1("ffixed-form"), flagpd1("fno-fixed-form"), flagpd1("fixit"), -joinpd1("fixit="), flagpd1("fixit-recompile"), flagpd1("fixit-to-temporary"), flagpd1("fjump-tables"), flagpd1("fkeep-static-consts"), flagpd1("flat_namespace"), flagpd1("flax-vector-conversions"), -joinpd1("flax-vector-conversions="), flagpd1("flimit-debug-info"), -joinpd1("flimited-precision="), flagpd1("ffloat-store"), flagpd1("fno-float-store"), flagpd1("flto"), -joinpd1("flto="), -joinpd1("flto-jobs="), flagpd1("flto-unit"), flagpd1("flto-visibility-public-std"), sepd1("fmacro-backtrace-limit"), -joinpd1("fmacro-backtrace-limit="), -joinpd1("fmacro-prefix-map="), flagpd1("fmath-errno"), -joinpd1("fmax-array-constructor="), -joinpd1("fmax-errors="), -joinpd1("fmax-stack-var-size="), -joinpd1("fmax-subrecord-length="), -joinpd1("fmax-type-align="), flagpd1("fmerge-all-constants"), flagpd1("fmerge-functions"), sepd1("fmessage-length"), -joinpd1("fmessage-length="), sepd1("fmodule-feature"), -joinpd1("fmodule-file="), flagpd1("fmodule-file-deps"), -joinpd1("fmodule-format="), sepd1("fmodule-implementation-of"), -joinpd1("fmodule-map-file="), flagpd1("fmodule-map-file-home-is-cwd"), flagpd1("fmodule-maps"), sepd1("fmodule-name"), -joinpd1("fmodule-name="), flagpd1("fmodules"), -joinpd1("fmodules-cache-path="), flagpd1("fmodules-codegen"), flagpd1("fmodules-debuginfo"), flagpd1("fmodules-decluse"), flagpd1("fmodules-disable-diagnostic-validation"), -joinpd1("fmodules-embed-all-files"), -joinpd1("fmodules-embed-file="), flagpd1("fmodules-hash-content"), -joinpd1("fmodules-ignore-macro="), flagpd1("fmodules-local-submodule-visibility"), -joinpd1("fmodules-prune-after="), -joinpd1("fmodules-prune-interval="), flagpd1("fmodules-search-all"), flagpd1("fmodules-strict-context-hash"), flagpd1("fmodules-strict-decluse"), @@ -3582,19 +2640,22 @@ flagpd1("fmodules-validate-input-files-content"), flagpd1("fmodules-validate-once-per-build-session"), flagpd1("fmodules-validate-system-headers"), flagpd1("fms-compatibility"), -joinpd1("fms-compatibility-version="), flagpd1("fms-extensions"), -joinpd1("fms-memptr-rep="), flagpd1("fms-volatile"), -joinpd1("fmsc-version="), flagpd1("fmudflap"), flagpd1("fmudflapth"), flagpd1("fnative-half-arguments-and-returns"), flagpd1("fnative-half-type"), flagpd1("fnested-functions"), -joinpd1("fnew-alignment="), flagpd1("fnext-runtime"), -flagpd1("fno-PIC"), +.{ + .name = "fno-PIC", + .syntax = .flag, + .zig_equivalent = .no_pic, + .pd1 = true, + .pd2 = false, + .psl = false, +}, flagpd1("fno-PIE"), flagpd1("fno-access-control"), flagpd1("fno-addrsig"), @@ -3616,7 +2677,6 @@ flagpd1("fno-bitfield-type-align"), flagpd1("fno-blocks"), flagpd1("fno-borland-extensions"), flagpd1("fno-builtin"), -joinpd1("fno-builtin-"), flagpd1("fno-caret-diagnostics"), flagpd1("fno-char8_t"), flagpd1("fno-color-diagnostics"), @@ -3755,54 +2815,22 @@ flagpd1("fno-rtlib-add-rpath"), flagpd1("fno-rtti"), flagpd1("fno-rtti-data"), flagpd1("fno-rwpi"), -.{ - .name = "fno-sanitize=", - .syntax = .comma_joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = false, -}, flagpd1("fno-sanitize-address-poison-custom-array-cookie"), flagpd1("fno-sanitize-address-use-after-scope"), flagpd1("fno-sanitize-address-use-odr-indicator"), flagpd1("fno-sanitize-blacklist"), flagpd1("fno-sanitize-cfi-canonical-jump-tables"), flagpd1("fno-sanitize-cfi-cross-dso"), -.{ - .name = "fno-sanitize-coverage=", - .syntax = .comma_joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = false, -}, flagpd1("fno-sanitize-link-c++-runtime"), flagpd1("fno-sanitize-link-runtime"), flagpd1("fno-sanitize-memory-track-origins"), flagpd1("fno-sanitize-memory-use-after-dtor"), flagpd1("fno-sanitize-minimal-runtime"), flagpd1("fno-sanitize-recover"), -.{ - .name = "fno-sanitize-recover=", - .syntax = .comma_joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = false, -}, flagpd1("fno-sanitize-stats"), flagpd1("fno-sanitize-thread-atomics"), flagpd1("fno-sanitize-thread-func-entry-exit"), flagpd1("fno-sanitize-thread-memory-access"), -.{ - .name = "fno-sanitize-trap=", - .syntax = .comma_joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = false, -}, flagpd1("fno-sanitize-undefined-trap-on-error"), flagpd1("fno-save-optimization-record"), flagpd1("fno-short-enums"), @@ -3858,14 +2886,11 @@ flagpd1("fno-xray-always-emit-customevents"), flagpd1("fno-xray-always-emit-typedevents"), flagpd1("fno-xray-instrument"), flagpd1("fnoxray-link-deps"), -joinpd1("fobjc-abi-version="), flagpd1("fobjc-arc"), -joinpd1("fobjc-arc-cxxlib="), flagpd1("fobjc-arc-exceptions"), flagpd1("fobjc-atdefs"), flagpd1("fobjc-call-cxx-cdtors"), flagpd1("fobjc-convert-messages-to-runtime-calls"), -joinpd1("fobjc-dispatch-method="), flagpd1("fobjc-exceptions"), flagpd1("fobjc-gc"), flagpd1("fobjc-gc-only"), @@ -3874,91 +2899,50 @@ flagpd1("fobjc-legacy-dispatch"), flagpd1("fobjc-link-runtime"), flagpd1("fobjc-new-property"), flagpd1("fobjc-nonfragile-abi"), -joinpd1("fobjc-nonfragile-abi-version="), -joinpd1("fobjc-runtime="), flagpd1("fobjc-runtime-has-weak"), flagpd1("fobjc-sender-dependent-dispatch"), flagpd1("fobjc-subscripting-legacy-runtime"), flagpd1("fobjc-weak"), flagpd1("fomit-frame-pointer"), flagpd1("fopenmp"), -joinpd1("fopenmp="), -joinpd1("fopenmp-cuda-blocks-per-sm="), flagpd1("fopenmp-cuda-force-full-runtime"), flagpd1("fopenmp-cuda-mode"), -joinpd1("fopenmp-cuda-number-of-sm="), -joinpd1("fopenmp-cuda-teams-reduction-recs-num="), flagpd1("fopenmp-enable-irbuilder"), sepd1("fopenmp-host-ir-file-path"), flagpd1("fopenmp-is-device"), flagpd1("fopenmp-optimistic-collapse"), flagpd1("fopenmp-relocatable-target"), flagpd1("fopenmp-simd"), -.{ - .name = "fopenmp-targets=", - .syntax = .comma_joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = false, -}, flagpd1("fopenmp-use-tls"), -joinpd1("fopenmp-version="), sepd1("foperator-arrow-depth"), -joinpd1("foperator-arrow-depth="), -joinpd1("foptimization-record-file="), -joinpd1("foptimization-record-passes="), flagpd1("foptimize-sibling-calls"), flagpd1("force_cpusubtype_ALL"), flagpd1("force_flat_namespace"), sepd1("force_load"), -joinpd1("fforce-addr"), flagpd1("forder-file-instrumentation"), -joinpd1("foutput-class-dir="), -joinpd1("foverride-record-layout="), flagpd1("fpack-struct"), -joinpd1("fpack-struct="), flagpd1("fpadding-on-unsigned-fixed-point"), flagpd1("fparse-all-comments"), flagpd1("fpascal-strings"), -joinpd1("fpass-plugin="), -joinpd1("fpatchable-function-entry="), -joinpd1("fpatchable-function-entry-offset="), flagpd1("fpcc-struct-return"), flagpd1("fpch-preprocess"), flagpd1("fpch-validate-input-files-content"), flagpd1("fpic"), flagpd1("fpie"), flagpd1("fplt"), -joinpd1("fplugin="), -joinpd1("fprebuilt-module-path="), flagpd1("fpreserve-as-comments"), flagpd1("fpreserve-vec3-type"), flagpd1("fprofile-arcs"), -joinpd1("fprofile-dir="), -joinpd1("fprofile-exclude-files="), -joinpd1("fprofile-filter-files="), flagpd1("fprofile-generate"), -joinpd1("fprofile-generate="), flagpd1("fprofile-instr-generate"), -joinpd1("fprofile-instr-generate="), flagpd1("fprofile-instr-use"), -joinpd1("fprofile-instr-use="), -joinpd1("fprofile-instrument="), -joinpd1("fprofile-instrument-path="), -joinpd1("fprofile-instrument-use-path="), sepd1("fprofile-remapping-file"), -joinpd1("fprofile-remapping-file="), flagpd1("fprofile-sample-accurate"), flagpd1("fprofile-sample-use"), -joinpd1("fprofile-sample-use="), flagpd1("fprofile-use"), -joinpd1("fprofile-use="), sepd1("framework"), -joinpd1("frandom-seed="), flagpd1("freciprocal-math"), flagpd1("frecord-command-line"), -joinpd1("frecord-marker="), flagpd1("ffree-form"), flagpd1("fno-free-form"), flagpd1("freg-struct-return"), @@ -3969,7 +2953,6 @@ flagpd1("fretain-comments-from-system-headers"), flagpd1("frewrite-imports"), flagpd1("frewrite-includes"), sepd1("frewrite-map-file"), -joinpd1("frewrite-map-file="), flagpd1("ffriend-injection"), flagpd1("fno-friend-injection"), flagpd1("ffrontend-optimize"), @@ -3979,31 +2962,13 @@ flagpd1("frounding-math"), flagpd1("frtlib-add-rpath"), flagpd1("frtti"), flagpd1("frwpi"), -.{ - .name = "fsanitize=", - .syntax = .comma_joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = false, -}, -joinpd1("fsanitize-address-field-padding="), flagpd1("fsanitize-address-globals-dead-stripping"), flagpd1("fsanitize-address-poison-custom-array-cookie"), flagpd1("fsanitize-address-use-after-scope"), flagpd1("fsanitize-address-use-odr-indicator"), -joinpd1("fsanitize-blacklist="), flagpd1("fsanitize-cfi-canonical-jump-tables"), flagpd1("fsanitize-cfi-cross-dso"), flagpd1("fsanitize-cfi-icall-generalize-pointers"), -.{ - .name = "fsanitize-coverage=", - .syntax = .comma_joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = false, -}, flagpd1("fsanitize-coverage-8bit-counters"), flagpd1("fsanitize-coverage-indirect-calls"), flagpd1("fsanitize-coverage-inline-8bit-counters"), @@ -4016,45 +2981,22 @@ flagpd1("fsanitize-coverage-trace-div"), flagpd1("fsanitize-coverage-trace-gep"), flagpd1("fsanitize-coverage-trace-pc"), flagpd1("fsanitize-coverage-trace-pc-guard"), -joinpd1("fsanitize-coverage-type="), -joinpd1("fsanitize-hwaddress-abi="), flagpd1("fsanitize-link-c++-runtime"), flagpd1("fsanitize-link-runtime"), flagpd1("fsanitize-memory-track-origins"), -joinpd1("fsanitize-memory-track-origins="), flagpd1("fsanitize-memory-use-after-dtor"), flagpd1("fsanitize-minimal-runtime"), flagpd1("fsanitize-recover"), -.{ - .name = "fsanitize-recover=", - .syntax = .comma_joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = false, -}, flagpd1("fsanitize-stats"), -joinpd1("fsanitize-system-blacklist="), flagpd1("fsanitize-thread-atomics"), flagpd1("fsanitize-thread-func-entry-exit"), flagpd1("fsanitize-thread-memory-access"), -.{ - .name = "fsanitize-trap=", - .syntax = .comma_joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = false, -}, -joinpd1("fsanitize-undefined-strip-path-components="), flagpd1("fsanitize-undefined-trap-on-error"), flagpd1("fsave-optimization-record"), -joinpd1("fsave-optimization-record="), flagpd1("fseh-exceptions"), flagpd1("fshort-enums"), flagpd1("fshort-wchar"), flagpd1("fshow-column"), -joinpd1("fshow-overloads="), flagpd1("fshow-source-location"), flagpd1("fsignaling-math"), flagpd1("fsigned-bitfields"), @@ -4066,7 +3008,6 @@ flagpd1("fsjlj-exceptions"), flagpd1("fslp-vectorize"), flagpd1("fspell-checking"), sepd1("fspell-checking-limit"), -joinpd1("fspell-checking-limit="), flagpd1("fsplit-dwarf-inlining"), flagpd1("fsplit-lto-unit"), flagpd1("fsplit-stack"), @@ -4083,31 +3024,18 @@ flagpd1("fstrict-return"), flagpd1("fstrict-vtable-pointers"), flagpd1("fstruct-path-tbaa"), flagpd1("fsycl-is-device"), -joinpd1("fsymbol-partition="), flagpd1("fsyntax-only"), sepd1("ftabstop"), -joinpd1("ftabstop="), sepd1("ftemplate-backtrace-limit"), -joinpd1("ftemplate-backtrace-limit="), sepd1("ftemplate-depth"), -joinpd1("ftemplate-depth-"), -joinpd1("ftemplate-depth="), flagpd1("ftest-coverage"), -joinpd1("ftest-module-file-extension="), -joinpd1("fthin-link-bitcode="), -joinpd1("fthinlto-index="), flagpd1("fthreadsafe-statics"), flagpd1("ftime-report"), flagpd1("ftime-trace"), -joinpd1("ftime-trace-granularity="), -joinpd1("ftls-model="), -joinpd1("ftrap-function="), flagpd1("ftrapping-math"), flagpd1("ftrapv"), sepd1("ftrapv-handler"), -joinpd1("ftrapv-handler="), flagpd1("ftrigraphs"), -joinpd1("ftrivial-auto-var-init="), sepd1("ftype-visibility"), sepd1("function-alignment"), flagpd1("ffunction-attribute-list"), @@ -4122,35 +3050,24 @@ flagpd1("funsigned-char"), flagpd1("funwind-tables"), flagpd1("fuse-cxa-atexit"), flagpd1("fuse-init-array"), -joinpd1("fuse-ld="), flagpd1("fuse-line-directives"), flagpd1("fuse-register-sized-bitfield-access"), flagpd1("fvalidate-ast-input-files-content"), -joinpd1("fveclib="), flagpd1("fvectorize"), flagpd1("fverbose-asm"), flagpd1("fvirtual-function-elimination"), sepd1("fvisibility"), -joinpd1("fvisibility="), flagpd1("fvisibility-global-new-delete-hidden"), flagpd1("fvisibility-inlines-hidden"), flagpd1("fvisibility-ms-compat"), flagpd1("fwasm-exceptions"), -joinpd1("fwchar-type="), flagpd1("fwhole-program-vtables"), flagpd1("fwrapv"), flagpd1("fwritable-strings"), flagpd1("fxray-always-emit-customevents"), flagpd1("fxray-always-emit-typedevents"), -jspd1("fxray-always-instrument="), -jspd1("fxray-attr-list="), -jspd1("fxray-instruction-threshold"), -jspd1("fxray-instruction-threshold="), flagpd1("fxray-instrument"), -jspd1("fxray-instrumentation-bundle="), flagpd1("fxray-link-deps"), -jspd1("fxray-modes="), -jspd1("fxray-never-instrument="), flagpd1("fzero-initialized-in-bss"), flagpd1("fzvector"), flagpd1("g0"), @@ -4158,18 +3075,9 @@ flagpd1("g1"), flagpd1("g2"), flagpd1("g3"), flagpd1("g"), -.{ - .name = "gcc-toolchain=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, sepd1("gcc-toolchain"), flagpd1("gcodeview"), flagpd1("gcodeview-ghash"), -joinpd1("gcoff"), flagpd1("gcolumn-info"), flagpd1("fgcse-after-reload"), flagpd1("fno-gcse-after-reload"), @@ -4211,53 +3119,23 @@ flagpd1("gno-record-command-line"), flagpd1("gno-strict-dwarf"), flagpd1("fgnu"), flagpd1("fno-gnu"), -.{ - .name = "gpu-max-threads-per-block=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, flagpd1("gpubnames"), flagpd1("grecord-command-line"), flagpd1("gsce"), flagpd1("gsplit-dwarf"), -joinpd1("gsplit-dwarf="), -joinpd1("gstabs"), flagpd1("gstrict-dwarf"), flagpd1("gtoggle"), flagpd1("gused"), -joinpd1("gvms"), -joinpd1("gxcoff"), flagpd1("gz"), -joinpd1("gz="), sepd1("header-include-file"), -joinpd1("headerpad_max_install_names"), .{ .name = "help", .syntax = .flag, - .zig_equivalent = .other, + .zig_equivalent = .passthrough, .pd1 = true, .pd2 = true, .psl = false, }, -.{ - .name = "hip-device-lib=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, -.{ - .name = "hip-device-lib-path=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "hip-link", .syntax = .flag, @@ -4266,17 +3144,6 @@ joinpd1("headerpad_max_install_names"), .pd2 = true, .psl = false, }, -jspd1("idirafter"), -jspd1("iframework"), -jspd1("iframeworkwithsysroot"), -.{ - .name = "imacros", - .syntax = .joined_or_separate, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = true, - .psl = false, -}, sepd1("image_base"), flagpd1("fimplement-inlines"), flagpd1("fno-implement-inlines"), @@ -4285,14 +3152,6 @@ flagpd1("fno-implicit-none"), flagpd1("fimplicit-templates"), flagpd1("fno-implicit-templates"), sepd1("imultilib"), -.{ - .name = "include", - .syntax = .joined_or_separate, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = true, - .psl = false, -}, sepd1("include-pch"), flagpd1("index-header-map"), sepd1("init"), @@ -4306,51 +3165,15 @@ flagpd1("fno-inline-small-functions"), sepd1("install_name"), flagpd1("finteger-4-integer-8"), flagpd1("fno-integer-4-integer-8"), -jspd1("interface-stub-version="), -jspd1("internal-externc-isystem"), -jspd1("internal-isystem"), flagpd1("fintrinsic-modules-path"), flagpd1("fno-intrinsic-modules-path"), flagpd1("fipa-cp"), flagpd1("fno-ipa-cp"), -jspd1("iprefix"), -jspd1("iquote"), -jspd1("isysroot"), -jspd1("isystem"), -jspd1("isystem-after"), -jspd1("ivfsoverlay"), flagpd1("fivopts"), flagpd1("fno-ivopts"), -jspd1("iwithprefix"), -jspd1("iwithprefixbefore"), -jspd1("iwithsysroot"), flagpd1("keep_private_externs"), -.{ - .name = "l", - .syntax = .joined_or_separate, - .zig_equivalent = .l, - .pd1 = true, - .pd2 = false, - .psl = false, -}, sepd1("lazy_framework"), sepd1("lazy_library"), -.{ - .name = "libomptarget-nvptx-path=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, -.{ - .name = "linker-option=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, sepd1("load"), flagpd1("m16"), flagpd1("m32"), @@ -4358,34 +3181,14 @@ flagpd1("m3dnow"), flagpd1("m3dnowa"), flagpd1("m64"), flagpd1("m80387"), -joinpd1("mabi="), flagpd1("mabi=ieeelongdouble"), flagpd1("mabicalls"), -joinpd1("mabs="), flagpd1("madx"), flagpd1("maes"), sepd1("main-file-name"), -.{ - .name = "malign-branch=", - .syntax = .comma_joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = false, -}, -joinpd1("malign-branch-boundary="), -joinpd1("malign-branch-prefix-size="), flagpd1("malign-double"), -joinpd1("malign-functions="), -joinpd1("malign-jumps="), -joinpd1("malign-loops="), flagpd1("maltivec"), -joinpd1("mamdgpu-debugger-abi="), -joinpd1("mappletvos-version-min="), -joinpd1("mappletvsimulator-version-min="), -joinpd1("march="), flagpd1("marm"), -joinpd1("masm="), flagpd1("masm-verbose"), flagpd1("massembler-fatal-warnings"), flagpd1("massembler-no-warn"), @@ -4414,7 +3217,6 @@ flagpd1("mbig-endian"), flagpd1("mbmi"), flagpd1("mbmi2"), flagpd1("mbranch-likely"), -joinpd1("mbranch-protection="), flagpd1("mbranch-target-enforce"), flagpd1("mbranches-within-32B-boundaries"), flagpd1("mbulk-memory"), @@ -4423,32 +3225,25 @@ flagpd1("mcldemote"), flagpd1("mclflushopt"), flagpd1("mclwb"), flagpd1("mclzero"), -joinpd1("mcmodel="), flagpd1("mcmodel=medany"), flagpd1("mcmodel=medlow"), flagpd1("mcmpb"), flagpd1("mcmse"), sepd1("mcode-model"), flagpd1("mcode-object-v3"), -joinpd1("mcompact-branches="), -joinpd1("mconsole"), flagpd1("mconstant-cfstrings"), flagpd1("mconstructor-aliases"), -joinpd1("mcpu="), flagpd1("mcpu=?"), flagpd1("mcrbits"), flagpd1("mcrc"), flagpd1("mcumode"), flagpd1("mcx16"), sepd1("mdebug-pass"), -joinpd1("mdefault-build-attributes"), flagpd1("mdirect-move"), flagpd1("mdisable-tail-calls"), -joinpd1("mdll"), flagpd1("mdouble-float"), flagpd1("mdsp"), flagpd1("mdspr2"), -joinpd1("mdynamic-no-pic"), sepd1("meabi"), flagpd1("membedded-data"), flagpd1("menable-no-infs"), @@ -4467,17 +3262,13 @@ flagpd1("mfix-and-continue"), flagpd1("mfix-cortex-a53-835769"), flagpd1("mfloat128"), sepd1("mfloat-abi"), -joinpd1("mfloat-abi="), flagpd1("mfma"), flagpd1("mfma4"), flagpd1("mfp32"), flagpd1("mfp64"), sepd1("mfpmath"), -joinpd1("mfpmath="), flagpd1("mfprnd"), -joinpd1("mfpu="), flagpd1("mfpxx"), -joinpd1("mframe-pointer="), flagpd1("mfsgsbase"), flagpd1("mfxsr"), flagpd1("mgeneral-regs-only"), @@ -4488,11 +3279,7 @@ flagpd1("mglobal-merge"), flagpd1("mgpopt"), flagpd1("mhard-float"), flagpd1("mhvx"), -joinpd1("mhvx="), -joinpd1("mhvx-length="), flagpd1("mhtm"), -joinpd1("mhwdiv="), -joinpd1("mhwmult="), flagpd1("miamcu"), flagpd1("mieee-fp"), flagpd1("mieee-rnd-near"), @@ -4500,16 +3287,10 @@ flagpd1("migrate"), flagpd1("no-finalize-removal"), flagpd1("no-ns-alloc-error"), flagpd1("mimplicit-float"), -joinpd1("mimplicit-it="), flagpd1("mincremental-linker-compatible"), -joinpd1("mindirect-jump="), flagpd1("minline-all-stringops"), flagpd1("minvariant-function-descriptors"), flagpd1("minvpcid"), -joinpd1("mios-simulator-version-min="), -joinpd1("mios-version-min="), -joinpd1("miphoneos-version-min="), -joinpd1("miphonesimulator-version-min="), flagpd1("mips1"), flagpd1("mips16"), flagpd1("mips2"), @@ -4533,7 +3314,6 @@ sepd1("mlimit-float-precision"), sepd1("mlink-bitcode-file"), sepd1("mlink-builtin-bitcode"), sepd1("mlink-cuda-bitcode"), -joinpd1("mlinker-version="), flagpd1("mlittle-endian"), sepd1("mllvm"), flagpd1("mlocal-sdata"), @@ -4544,10 +3324,7 @@ flagpd1("mlong-double-80"), flagpd1("mlongcall"), flagpd1("mlwp"), flagpd1("mlzcnt"), -joinpd1("mmacos-version-min="), -joinpd1("mmacosx-version-min="), flagpd1("mmadd4"), -joinpd1("mmcu="), flagpd1("mmemops"), flagpd1("mmfcrf"), flagpd1("mmfocrf"), @@ -4563,7 +3340,6 @@ flagpd1("mmt"), flagpd1("mmultivalue"), flagpd1("mmutable-globals"), flagpd1("mmwaitx"), -joinpd1("mnan="), flagpd1("mno-3dnow"), flagpd1("mno-3dnowa"), flagpd1("mno-80387"), @@ -4606,7 +3382,6 @@ flagpd1("mno-crbits"), flagpd1("mno-crc"), flagpd1("mno-cumode"), flagpd1("mno-cx16"), -joinpd1("mno-default-build-attributes"), flagpd1("mno-dsp"), flagpd1("mno-dspr2"), flagpd1("mno-embedded-data"), @@ -4761,7 +3536,6 @@ flagpd1("fno-modulo-sched-allow-regmoves"), flagpd1("fmodulo-sched"), flagpd1("fno-modulo-sched"), flagpd1("momit-leaf-frame-pointer"), -joinpd1("moslib="), flagpd1("moutline"), flagpd1("mpacked-stack"), flagpd1("mpackets"), @@ -4775,7 +3549,6 @@ flagpd1("mpopcntd"), flagpd1("mcrypto"), flagpd1("mpower8-vector"), flagpd1("mpower9-vector"), -joinpd1("mprefer-vector-width="), flagpd1("mprefetchwt1"), flagpd1("mprfchw"), flagpd1("mptwrite"), @@ -4787,19 +3560,10 @@ flagpd1("mrdrnd"), flagpd1("mrdseed"), flagpd1("mreassociate"), flagpd1("mrecip"), -.{ - .name = "mrecip=", - .syntax = .comma_joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = false, -}, flagpd1("mrecord-mcount"), flagpd1("mred-zone"), flagpd1("mreference-types"), sepd1("mregparm"), -joinpd1("mregparm="), flagpd1("mrelax"), flagpd1("mrelax-all"), flagpd1("mrelax-pic-calls"), @@ -4825,11 +3589,8 @@ flagpd1("msgx"), flagpd1("msha"), flagpd1("mshstk"), flagpd1("msign-ext"), -joinpd1("msign-return-address="), -joinpd1("msign-return-address-key="), flagpd1("msimd128"), flagpd1("msingle-float"), -joinpd1("msmall-data-threshold="), flagpd1("msoft-float"), flagpd1("mspe"), flagpd1("mspeculative-load-hardening"), @@ -4842,31 +3603,22 @@ flagpd1("msse4.1"), flagpd1("msse4.2"), flagpd1("msse4a"), flagpd1("mssse3"), -joinpd1("mstack-alignment="), flagpd1("mstack-arg-probe"), -joinpd1("mstack-probe-size="), flagpd1("mstackrealign"), flagpd1("mstrict-align"), sepd1("mt-migrate-directory"), flagpd1("mtail-call"), flagpd1("mtbm"), sepd1("mthread-model"), -joinpd1("mthreads"), flagpd1("mthumb"), flagpd1("mtls-direct-seg-refs"), -joinpd1("mtls-size="), sepd1("mtp"), -joinpd1("mtp="), -joinpd1("mtune="), flagpd1("mtune=?"), -joinpd1("mtvos-simulator-version-min="), -joinpd1("mtvos-version-min="), flagpd1("muclibc"), flagpd1("multi_module"), sepd1("multiply_defined"), sepd1("multiply_defined_unused"), flagpd1("munaligned-access"), -joinpd1("municode"), flagpd1("munimplemented-simd128"), flagpd1("munwind-tables"), flagpd1("mv5"), @@ -4883,12 +3635,8 @@ flagpd1("mvx"), flagpd1("mvzeroupper"), flagpd1("mwaitpkg"), flagpd1("mwarn-nonportable-cfstrings"), -joinpd1("mwatchos-simulator-version-min="), -joinpd1("mwatchos-version-min="), -joinpd1("mwatchsimulator-version-min="), flagpd1("mwavefrontsize64"), flagpd1("mwbnoinvd"), -joinpd1("mwindows"), flagpd1("mx32"), flagpd1("mx87"), flagpd1("mxgot"), @@ -4906,22 +3654,6 @@ flagpd1("no-canonical-prefixes"), flagpd1("no-code-completion-globals"), flagpd1("no-code-completion-ns-level-decls"), flagpd1("no-cpp-precomp"), -.{ - .name = "no-cuda-gpu-arch=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, -.{ - .name = "no-cuda-include-ptx=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, .{ .name = "no-cuda-noopt-device-debug", .syntax = .flag, @@ -4959,14 +3691,6 @@ flagpd1("no-implicit-float"), flagpd1("no-pie"), flagpd1("no-pthread"), flagpd1("no-struct-path-tbaa"), -.{ - .name = "no-system-header-prefix=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, flagpd1("nobuiltininc"), flagpd1("nocpp"), flagpd1("nocudainc"), @@ -4984,19 +3708,17 @@ flagpd1("noseglinkedit"), flagpd1("nostartfiles"), flagpd1("nostdinc"), flagpd1("nostdinc++"), -flagpd1("nostdlib"), -flagpd1("nostdlibinc"), -flagpd1("nostdlib++"), -flagpd1("nostdsysteminc"), .{ - .name = "o", - .syntax = .joined_or_separate, - .zig_equivalent = .o, + .name = "nostdlib", + .syntax = .flag, + .zig_equivalent = .nostdlib, .pd1 = true, .pd2 = false, .psl = false, }, -jspd1("objc-isystem"), +flagpd1("nostdlibinc"), +flagpd1("nostdlib++"), +flagpd1("nostdsysteminc"), flagpd1("objcmt-atomic-property"), flagpd1("objcmt-migrate-all"), flagpd1("objcmt-migrate-annotation"), @@ -5012,8 +3734,6 @@ flagpd1("objcmt-migrate-readwrite-property"), flagpd1("objcmt-migrate-subscripting"), flagpd1("objcmt-ns-nonatomic-iosonly"), flagpd1("objcmt-returns-innerpointer-property"), -joinpd1("objcmt-whitelist-dir-path="), -jspd1("objcxx-isystem"), flagpd1("object"), sepd1("opt-record-file"), sepd1("opt-record-format"), @@ -5022,7 +3742,6 @@ sepd1("output-asm-variant"), flagpd1("p"), flagpd1("fpack-derived"), flagpd1("fno-pack-derived"), -jspd1("pagezero_size"), .{ .name = "pass-exit-codes", .syntax = .flag, @@ -5033,7 +3752,6 @@ jspd1("pagezero_size"), }, flagpd1("pch-through-hdrstop-create"), flagpd1("pch-through-hdrstop-use"), -joinpd1("pch-through-header="), .{ .name = "pedantic", .syntax = .flag, @@ -5061,21 +3779,12 @@ flagpd1("pie"), .{ .name = "pipe", .syntax = .flag, - .zig_equivalent = .other, + .zig_equivalent = .ignore, .pd1 = true, .pd2 = true, .psl = false, }, sepd1("plugin"), -.{ - .name = "plugin-arg-", - .syntax = .joined_and_separate, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = false, -}, -joinpd1("preamble-bytes="), flagpd1("prebind"), flagpd1("prebind_all_twolevel_modules"), flagpd1("fprefetch-loop-arrays"), @@ -5090,14 +3799,6 @@ flagpd1("print-dependency-directives-minimized-source"), .pd2 = true, .psl = false, }, -.{ - .name = "print-file-name=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = true, - .psl = false, -}, flagpd1("print-ivar-layout"), .{ .name = "print-libgcc-file-name", @@ -5132,14 +3833,6 @@ flagpd1("print-ivar-layout"), .psl = false, }, flagpd1("print-preamble"), -.{ - .name = "print-prog-name=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = true, - .psl = false, -}, .{ .name = "print-resource-dir", .syntax = .flag, @@ -5190,18 +3883,17 @@ flagpd1("fprotect-parens"), flagpd1("fno-protect-parens"), flagpd1("pthread"), flagpd1("pthreads"), -.{ - .name = "ptxas-path=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, flagpd1("r"), flagpd1("frange-check"), flagpd1("fno-range-check"), -flagpd1("rdynamic"), +.{ + .name = "rdynamic", + .syntax = .flag, + .zig_equivalent = .rdynamic, + .pd1 = true, + .pd2 = false, + .psl = false, +}, sepd1("read_only_relocs"), flagpd1("freal-4-real-10"), flagpd1("fno-real-4-real-10"), @@ -5240,7 +3932,6 @@ flagpd1("fno-reorder-blocks"), flagpd1("frepack-arrays"), flagpd1("fno-repack-arrays"), sepd1("resource-dir"), -joinpd1("resource-dir="), flagpd1("rewrite-legacy-objc"), flagpd1("rewrite-macros"), flagpd1("rewrite-objc"), @@ -5248,22 +3939,6 @@ flagpd1("rewrite-test"), flagpd1("fripa"), flagpd1("fno-ripa"), sepd1("rpath"), -.{ - .name = "rsp-quoting=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, -.{ - .name = "rtlib=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = true, - .psl = false, -}, flagpd1("s"), .{ .name = "save-stats", @@ -5273,14 +3948,6 @@ flagpd1("s"), .pd2 = true, .psl = false, }, -.{ - .name = "save-stats=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = true, - .psl = false, -}, .{ .name = "save-temps", .syntax = .flag, @@ -5289,14 +3956,6 @@ flagpd1("s"), .pd2 = true, .psl = false, }, -.{ - .name = "save-temps=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = true, - .psl = false, -}, flagpd1("fschedule-insns2"), flagpd1("fno-schedule-insns2"), flagpd1("fschedule-insns"), @@ -5305,7 +3964,7 @@ flagpd1("fsecond-underscore"), flagpd1("fno-second-underscore"), .{ .name = "sectalign", - .syntax = .{ .multi_arg = 3 }, + .syntax = .{.multi_arg=3}, .zig_equivalent = .other, .pd1 = true, .pd2 = false, @@ -5313,7 +3972,7 @@ flagpd1("fno-second-underscore"), }, .{ .name = "sectcreate", - .syntax = .{ .multi_arg = 3 }, + .syntax = .{.multi_arg=3}, .zig_equivalent = .other, .pd1 = true, .pd2 = false, @@ -5321,7 +3980,7 @@ flagpd1("fno-second-underscore"), }, .{ .name = "sectobjectsymbols", - .syntax = .{ .multi_arg = 2 }, + .syntax = .{.multi_arg=2}, .zig_equivalent = .other, .pd1 = true, .pd2 = false, @@ -5329,7 +3988,7 @@ flagpd1("fno-second-underscore"), }, .{ .name = "sectorder", - .syntax = .{ .multi_arg = 3 }, + .syntax = .{.multi_arg=3}, .zig_equivalent = .other, .pd1 = true, .pd2 = false, @@ -5337,12 +3996,11 @@ flagpd1("fno-second-underscore"), }, flagpd1("fsee"), flagpd1("fno-see"), -jspd1("seg1addr"), sepd1("seg_addr_table"), sepd1("seg_addr_table_filename"), .{ .name = "segaddr", - .syntax = .{ .multi_arg = 2 }, + .syntax = .{.multi_arg=2}, .zig_equivalent = .other, .pd1 = true, .pd2 = false, @@ -5350,7 +4008,7 @@ sepd1("seg_addr_table_filename"), }, .{ .name = "segcreate", - .syntax = .{ .multi_arg = 3 }, + .syntax = .{.multi_arg=3}, .zig_equivalent = .other, .pd1 = true, .pd2 = false, @@ -5359,20 +4017,19 @@ sepd1("seg_addr_table_filename"), flagpd1("seglinkedit"), .{ .name = "segprot", - .syntax = .{ .multi_arg = 3 }, + .syntax = .{.multi_arg=3}, .zig_equivalent = .other, .pd1 = true, .pd2 = false, .psl = false, }, -joinpd1("segs_read_"), sepd1("segs_read_only_addr"), sepd1("segs_read_write_addr"), flagpd1("setup-static-analyzer"), .{ .name = "shared", .syntax = .flag, - .zig_equivalent = .other, + .zig_equivalent = .shared, .pd1 = true, .pd2 = true, .psl = false, @@ -5406,14 +4063,6 @@ flagpd1("fno-spec-constr-count"), .pd2 = true, .psl = false, }, -.{ - .name = "specs=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = true, - .psl = false, -}, sepd1("split-dwarf-file"), sepd1("split-dwarf-output"), flagpd1("split-stacks"), @@ -5438,47 +4087,10 @@ flagpd1("static-libsan"), flagpd1("static-libstdc++"), flagpd1("static-openmp"), flagpd1("static-pie"), -joinpd1("stats-file="), -.{ - .name = "std=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = true, - .psl = false, -}, -joinpd1("std-default="), -.{ - .name = "stdlib=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = true, - .psl = false, -}, -jspd1("stdlib++-isystem"), flagpd1("fstrength-reduce"), flagpd1("fno-strength-reduce"), -jspd1("sub_library"), -jspd1("sub_umbrella"), flagpd1("sys-header-deps"), -.{ - .name = "system-header-prefix=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = false, - .pd2 = true, - .psl = false, -}, flagpd1("t"), -.{ - .name = "target=", - .syntax = .joined, - .zig_equivalent = .target, - .pd1 = false, - .pd2 = true, - .psl = false, -}, sepd1("target-abi"), sepd1("target-cpu"), sepd1("target-feature"), @@ -5491,7 +4103,6 @@ sepd1("target-feature"), .psl = false, }, sepd1("target-linker-version"), -joinpd1("target-sdk-version="), flagpd1("templight-dump"), flagpd1("test-coverage"), flagpd1("time"), @@ -5541,13 +4152,10 @@ flagpd1("fno-tree-vrp"), }, flagpd1("trim-egraph"), sepd1("triple"), -joinpd1("triple="), flagpd1("twolevel_namespace"), flagpd1("twolevel_namespace_hints"), -jspd1("u"), sepd1("umbrella"), flagpd1("undef"), -jspd1("undefined"), flagpd1("funderscoring"), flagpd1("fno-underscoring"), sepd1("unexported_symbols_list"), @@ -5557,14 +4165,6 @@ flagpd1("funsafe-loop-optimizations"), flagpd1("fno-unsafe-loop-optimizations"), flagpd1("funswitch-loops"), flagpd1("fno-unswitch-loops"), -.{ - .name = "unwindlib=", - .syntax = .joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = true, - .psl = false, -}, flagpd1("fuse-linker-plugin"), flagpd1("fno-use-linker-plugin"), flagpd1("v"), @@ -5575,14 +4175,6 @@ flagpd1("fno-vect-cost-model"), flagpd1("vectorize-loops"), flagpd1("vectorize-slp"), flagpd1("verify"), -.{ - .name = "verify=", - .syntax = .comma_joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = false, -}, .{ .name = "verify-debug-info", .syntax = .flag, @@ -5592,14 +4184,6 @@ flagpd1("verify"), .psl = false, }, flagpd1("verify-ignore-unexpected"), -.{ - .name = "verify-ignore-unexpected=", - .syntax = .comma_joined, - .zig_equivalent = .other, - .pd1 = true, - .pd2 = false, - .psl = false, -}, flagpd1("verify-pch"), flagpd1("version"), .{ @@ -5610,12 +4194,10 @@ flagpd1("version"), .pd2 = true, .psl = false, }, -joinpd1("vtordisp-mode="), flagpd1("w"), sepd1("weak_framework"), sepd1("weak_library"), sepd1("weak_reference_mismatches"), -joinpd1("weak-l"), flagpd1("fweb"), flagpd1("fno-web"), flagpd1("whatsloaded"), @@ -5624,9 +4206,1455 @@ flagpd1("fno-whole-file"), flagpd1("fwhole-program"), flagpd1("fno-whole-program"), flagpd1("whyload"), -jspd1("working-directory"), +sepd1("z"), +joinpd1("fsanitize-undefined-strip-path-components="), +joinpd1("fopenmp-cuda-teams-reduction-recs-num="), +joinpd1("analyzer-config-compatibility-mode="), +joinpd1("fpatchable-function-entry-offset="), +joinpd1("analyzer-inline-max-stack-depth="), +joinpd1("fsanitize-address-field-padding="), +joinpd1("fdiagnostics-hotness-threshold="), +joinpd1("fsanitize-memory-track-origins="), +joinpd1("mwatchos-simulator-version-min="), +joinpd1("mappletvsimulator-version-min="), +joinpd1("fobjc-nonfragile-abi-version="), +joinpd1("fprofile-instrument-use-path="), +jspd1("fxray-instrumentation-bundle="), +joinpd1("miphonesimulator-version-min="), +joinpd1("faddress-space-map-mangling="), +joinpd1("foptimization-record-passes="), +joinpd1("ftest-module-file-extension="), +jspd1("fxray-instruction-threshold="), +joinpd1("mno-default-build-attributes"), +joinpd1("mtvos-simulator-version-min="), +joinpd1("mwatchsimulator-version-min="), +.{ + .name = "include-with-prefix-before=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("objcmt-white-list-dir-path="), +joinpd1("error-on-deserialized-decl="), +joinpd1("fconstexpr-backtrace-limit="), +joinpd1("fdiagnostics-show-category="), +joinpd1("fdiagnostics-show-location="), +joinpd1("fopenmp-cuda-blocks-per-sm="), +joinpd1("fsanitize-system-blacklist="), +jspd1("fxray-instruction-threshold"), +joinpd1("headerpad_max_install_names"), +joinpd1("mios-simulator-version-min="), +.{ + .name = "include-with-prefix-after=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("fms-compatibility-version="), +joinpd1("fopenmp-cuda-number-of-sm="), +joinpd1("foptimization-record-file="), +joinpd1("fpatchable-function-entry="), +joinpd1("fsave-optimization-record="), +joinpd1("ftemplate-backtrace-limit="), +.{ + .name = "gpu-max-threads-per-block=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("malign-branch-prefix-size="), +joinpd1("objcmt-whitelist-dir-path="), +joinpd1("Wno-nonportable-cfstrings"), +joinpd1("analyzer-disable-checker="), +joinpd1("fbuild-session-timestamp="), +joinpd1("fprofile-instrument-path="), +joinpd1("mdefault-build-attributes"), +joinpd1("msign-return-address-key="), +.{ + .name = "verify-ignore-unexpected=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +.{ + .name = "include-directory-after=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "compress-debug-sections=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "fcomment-block-commands=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +joinpd1("flax-vector-conversions="), +joinpd1("fmodules-embed-all-files"), +joinpd1("fmodules-prune-interval="), +joinpd1("foverride-record-layout="), +joinpd1("fprofile-instr-generate="), +joinpd1("fprofile-remapping-file="), +joinpd1("fsanitize-coverage-type="), +joinpd1("fsanitize-hwaddress-abi="), +joinpd1("ftime-trace-granularity="), +jspd1("fxray-always-instrument="), +jspd1("internal-externc-isystem"), +.{ + .name = "libomptarget-nvptx-path=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "no-system-header-prefix=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "output-class-directory=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("analyzer-inlining-mode="), +joinpd1("fconstant-string-class="), +joinpd1("fcrash-diagnostics-dir="), +joinpd1("fdebug-compilation-dir="), +joinpd1("fdebug-default-version="), +joinpd1("ffp-exception-behavior="), +joinpd1("fmacro-backtrace-limit="), +joinpd1("fmax-array-constructor="), +joinpd1("fprofile-exclude-files="), +joinpd1("ftrivial-auto-var-init="), +jspd1("fxray-never-instrument="), +jspd1("interface-stub-version="), +joinpd1("malign-branch-boundary="), +joinpd1("mappletvos-version-min="), +joinpd1("Wnonportable-cfstrings"), +joinpd1("fdefault-calling-conv="), +joinpd1("fmax-subrecord-length="), +joinpd1("fmodules-ignore-macro="), +.{ + .name = "fno-sanitize-coverage=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +joinpd1("fobjc-dispatch-method="), +joinpd1("foperator-arrow-depth="), +joinpd1("fprebuilt-module-path="), +joinpd1("fprofile-filter-files="), +joinpd1("fspell-checking-limit="), +joinpd1("miphoneos-version-min="), +joinpd1("msmall-data-threshold="), +joinpd1("Wlarge-by-value-copy="), +joinpd1("analyzer-constraints="), +joinpd1("analyzer-dump-egraph="), +jspd1("compatibility_version"), +jspd1("dylinker_install_name"), +joinpd1("fcs-profile-generate="), +joinpd1("fmodules-prune-after="), +.{ + .name = "fno-sanitize-recover=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +jspd1("iframeworkwithsysroot"), +joinpd1("mamdgpu-debugger-abi="), +joinpd1("mprefer-vector-width="), +joinpd1("msign-return-address="), +joinpd1("mwatchos-version-min="), +.{ + .name = "system-header-prefix=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "include-with-prefix=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("coverage-notes-file="), +joinpd1("fbuild-session-file="), +joinpd1("fdiagnostics-format="), +joinpd1("fmax-stack-var-size="), +joinpd1("fmodules-cache-path="), +joinpd1("fmodules-embed-file="), +joinpd1("fprofile-instrument="), +joinpd1("fprofile-sample-use="), +joinpd1("fsanitize-blacklist="), +.{ + .name = "hip-device-lib-path=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("mmacosx-version-min="), +.{ + .name = "no-cuda-include-ptx=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("Wframe-larger-than="), +joinpd1("code-completion-at="), +joinpd1("coverage-data-file="), +joinpd1("fblas-matmul-limit="), +joinpd1("fdiagnostics-color="), +joinpd1("ffixed-line-length-"), +joinpd1("flimited-precision="), +joinpd1("fprofile-instr-use="), +.{ + .name = "fsanitize-coverage=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +joinpd1("fthin-link-bitcode="), +joinpd1("mbranch-protection="), +joinpd1("mmacos-version-min="), +joinpd1("pch-through-header="), +joinpd1("target-sdk-version="), +.{ + .name = "execution-charset:", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "include-directory=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "library-directory=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "config-system-dir=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("fclang-abi-compat="), +joinpd1("fcompile-resource="), +joinpd1("fdebug-prefix-map="), +joinpd1("fdenormal-fp-math="), +joinpd1("fexcess-precision="), +joinpd1("ffree-line-length-"), +joinpd1("fmacro-prefix-map="), +.{ + .name = "fno-sanitize-trap=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +joinpd1("fobjc-abi-version="), +joinpd1("foutput-class-dir="), +joinpd1("fprofile-generate="), +joinpd1("frewrite-map-file="), +.{ + .name = "fsanitize-recover=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +joinpd1("fsymbol-partition="), +joinpd1("mcompact-branches="), +joinpd1("mstack-probe-size="), +joinpd1("mtvos-version-min="), joinpd1("working-directory="), +joinpd1("analyze-function="), +joinpd1("analyzer-checker="), +joinpd1("coverage-version="), +.{ + .name = "cuda-include-ptx=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("falign-functions="), +joinpd1("fconstexpr-depth="), +joinpd1("fconstexpr-steps="), +joinpd1("ffile-prefix-map="), +joinpd1("fmodule-map-file="), +joinpd1("fobjc-arc-cxxlib="), +jspd1("iwithprefixbefore"), +joinpd1("malign-functions="), +joinpd1("mios-version-min="), +joinpd1("mstack-alignment="), +.{ + .name = "no-cuda-gpu-arch=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +jspd1("working-directory"), +joinpd1("analyzer-output="), +.{ + .name = "config-user-dir=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("debug-info-kind="), +joinpd1("debugger-tuning="), +joinpd1("fcf-runtime-abi="), +joinpd1("finit-character="), +joinpd1("fmax-type-align="), +joinpd1("fmessage-length="), +.{ + .name = "fopenmp-targets=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +joinpd1("fopenmp-version="), +joinpd1("fshow-overloads="), +joinpd1("ftemplate-depth-"), +joinpd1("ftemplate-depth="), +jspd1("fxray-attr-list="), +jspd1("internal-isystem"), +joinpd1("mlinker-version="), +.{ + .name = "print-file-name=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "print-prog-name=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +jspd1("stdlib++-isystem"), +joinpd1("Rpass-analysis="), +.{ + .name = "Xopenmp-target=", + .syntax = .joined_and_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +.{ + .name = "source-charset:", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "analyzer-output", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "include-prefix=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "undefine-macro=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("analyzer-purge="), +joinpd1("analyzer-store="), +jspd1("current_version"), +joinpd1("fbootclasspath="), +joinpd1("fbracket-depth="), +joinpd1("fcf-protection="), +joinpd1("fdepfile-entry="), +joinpd1("fembed-bitcode="), +joinpd1("finput-charset="), +joinpd1("fmodule-format="), +joinpd1("fms-memptr-rep="), +joinpd1("fnew-alignment="), +joinpd1("frecord-marker="), +.{ + .name = "fsanitize-trap=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +joinpd1("fthinlto-index="), +joinpd1("ftrap-function="), +joinpd1("ftrapv-handler="), +.{ + .name = "hip-device-lib=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("mdynamic-no-pic"), +joinpd1("mframe-pointer="), +joinpd1("mindirect-jump="), +joinpd1("preamble-bytes="), +.{ + .name = "bootclasspath=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "cuda-gpu-arch=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "dependent-lib=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("dwarf-version="), +joinpd1("falign-labels="), +joinpd1("fauto-profile="), +joinpd1("fexec-charset="), +joinpd1("fgnuc-version="), +joinpd1("finit-integer="), +joinpd1("finit-logical="), +joinpd1("finline-limit="), +joinpd1("fobjc-runtime="), +.{ + .name = "gcc-toolchain=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "linker-option=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "malign-branch=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +jspd1("objcxx-isystem"), +joinpd1("vtordisp-mode="), +joinpd1("Rpass-missed="), +joinpd1("Wlarger-than-"), +joinpd1("Wlarger-than="), +.{ + .name = "define-macro=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("ast-dump-all="), +.{ + .name = "autocomplete=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("falign-jumps="), +joinpd1("falign-loops="), +joinpd1("faligned-new="), +joinpd1("ferror-limit="), +joinpd1("ffp-contract="), +joinpd1("fmodule-file="), +joinpd1("fmodule-name="), +joinpd1("fmsc-version="), +.{ + .name = "fno-sanitize=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +joinpd1("fpack-struct="), +joinpd1("fpass-plugin="), +joinpd1("fprofile-dir="), +joinpd1("fprofile-use="), +joinpd1("frandom-seed="), +joinpd1("gsplit-dwarf="), +jspd1("isystem-after"), +joinpd1("malign-jumps="), +joinpd1("malign-loops="), +joinpd1("mimplicit-it="), +jspd1("pagezero_size"), +joinpd1("resource-dir="), +.{ + .name = "dyld-prefix=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "driver-mode=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("fmax-errors="), +joinpd1("fno-builtin-"), +joinpd1("fvisibility="), +joinpd1("fwchar-type="), +jspd1("fxray-modes="), +jspd1("iwithsysroot"), +joinpd1("mhvx-length="), +jspd1("objc-isystem"), +.{ + .name = "rsp-quoting=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("std-default="), +jspd1("sub_umbrella"), +.{ + .name = "Qpar-report", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Qvec-report", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "errorReport", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "for-linker=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "force-link=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +jspd1("client_name"), +jspd1("cxx-isystem"), +joinpd1("fclasspath="), +joinpd1("finit-real="), +joinpd1("fforce-addr"), +joinpd1("ftls-model="), +jspd1("ivfsoverlay"), +jspd1("iwithprefix"), +joinpd1("mfloat-abi="), +.{ + .name = "plugin-arg-", + .syntax = .joined_and_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +.{ + .name = "ptxas-path=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "save-stats=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "save-temps=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +joinpd1("stats-file="), +jspd1("sub_library"), +.{ + .name = "CLASSPATH=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "constexpr:", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "classpath=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "cuda-path=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("fencoding="), +joinpd1("ffp-model="), +joinpd1("ffpe-trap="), +joinpd1("flto-jobs="), +.{ + .name = "fsanitize=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +jspd1("iframework"), +joinpd1("mtls-size="), +joinpd1("segs_read_"), +.{ + .name = "unwindlib=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "cgthreads", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "encoding=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "language=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "optimize=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "resource=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("ast-dump="), +jspd1("c-isystem"), +joinpd1("fcoarray="), +joinpd1("fconvert="), +joinpd1("fextdirs="), +joinpd1("ftabstop="), +jspd1("idirafter"), +joinpd1("mregparm="), +jspd1("undefined"), +.{ + .name = "extdirs=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "imacros=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "include=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "sysroot=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("fopenmp="), +joinpd1("fplugin="), +joinpd1("fuse-ld="), +joinpd1("fveclib="), +jspd1("isysroot"), +joinpd1("mcmodel="), +joinpd1("mconsole"), +joinpd1("mfpmath="), +joinpd1("mhwmult="), +joinpd1("mthreads"), +joinpd1("municode"), +joinpd1("mwindows"), +jspd1("seg1addr"), +.{ + .name = "assert=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "mhwdiv=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "output=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "prefix=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "cl-ext=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +joinpd1("cl-std="), +joinpd1("fcheck="), +.{ + .name = "imacros", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "include", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +jspd1("iprefix"), +jspd1("isystem"), +joinpd1("mhwdiv="), +joinpd1("moslib="), +.{ + .name = "mrecip=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +.{ + .name = "stdlib=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "target=", + .syntax = .joined, + .zig_equivalent = .target, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("triple="), +.{ + .name = "verify=", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +joinpd1("Rpass="), +.{ + .name = "Xarch_", + .syntax = .joined_and_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +.{ + .name = "clang:", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "guard:", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "debug=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "param=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +.{ + .name = "warn-=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("fixit="), +joinpd1("gstabs"), +joinpd1("gxcoff"), +jspd1("iquote"), +joinpd1("march="), +joinpd1("mtune="), +.{ + .name = "rtlib=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "specs=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +joinpd1("weak-l"), +joinpd1("Ofast"), +jspd1("Tdata"), +jspd1("Ttext"), +.{ + .name = "arch:", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "favor", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "imsvc", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "warn-", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = false, + .pd2 = true, + .psl = false, +}, +joinpd1("flto="), +joinpd1("gcoff"), +joinpd1("mabi="), +joinpd1("mabs="), +joinpd1("masm="), +joinpd1("mcpu="), +joinpd1("mfpu="), +joinpd1("mhvx="), +joinpd1("mmcu="), +joinpd1("mnan="), +jspd1("Tbss"), +.{ + .name = "link", + .syntax = .remaining_args_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "std:", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +joinpd1("ccc-"), +joinpd1("gvms"), +joinpd1("mdll"), +joinpd1("mtp="), +.{ + .name = "std=", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = true, + .psl = false, +}, +.{ + .name = "Wa,", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +.{ + .name = "Wl,", + .syntax = .comma_joined, + .zig_equivalent = .wl, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +.{ + .name = "Wp,", + .syntax = .comma_joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +.{ + .name = "RTC", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zc:", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "clr", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "doc", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +joinpd1("gz="), +joinpd1("A-"), +joinpd1("G="), +jspd1("MF"), +jspd1("MJ"), +jspd1("MQ"), +jspd1("MT"), +.{ + .name = "AI", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "EH", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "FA", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "FI", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "FR", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "FU", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Fa", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Fd", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Fe", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Fi", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Fm", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Fo", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Fp", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Fr", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Gs", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "MP", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Tc", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Tp", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Yc", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Yl", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Yu", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "ZW", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zm", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "Zp", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "d2", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "vd", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +jspd1("A"), +jspd1("B"), +jspd1("D"), +jspd1("F"), +jspd1("G"), +jspd1("I"), +jspd1("J"), +jspd1("L"), +joinpd1("O"), +joinpd1("R"), +jspd1("T"), +jspd1("U"), +jspd1("V"), +joinpd1("W"), +joinpd1("X"), +joinpd1("Z"), +.{ + .name = "D", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "F", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "I", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "O", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "U", + .syntax = .joined_or_separate, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "o", + .syntax = .joined_or_separate, + .zig_equivalent = .o, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +.{ + .name = "w", + .syntax = .joined, + .zig_equivalent = .other, + .pd1 = true, + .pd2 = false, + .psl = true, +}, +joinpd1("a"), +jspd1("b"), +joinpd1("d"), +jspd1("e"), +.{ + .name = "l", + .syntax = .joined_or_separate, + .zig_equivalent = .l, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +.{ + .name = "o", + .syntax = .joined_or_separate, + .zig_equivalent = .o, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +jspd1("u"), jspd1("x"), joinpd1("y"), -sepd1("z"), };}; diff --git a/src-self-hosted/stage2.zig b/src-self-hosted/stage2.zig index 23df042cbe..73a053b853 100644 --- a/src-self-hosted/stage2.zig +++ b/src-self-hosted/stage2.zig @@ -1239,6 +1239,14 @@ pub const ClangArgIterator = extern struct { other, positional, l, + ignore, + passthrough, + pic, + no_pic, + nostdlib, + shared, + rdynamic, + wl, }; fn init(argv: []const [*:0]const u8) ClangArgIterator { @@ -1282,7 +1290,8 @@ pub const ClangArgIterator = extern struct { break :find_clang_arg; }, .joined, .comma_joined => { - // Example: --target=foo + // joined example: --target=foo + // comma_joined example: -Wl,-soname,libsoundio.so.2 const prefix_len = clang_arg.matchStartsWith(arg); if (prefix_len != 0) { self.zig_equivalent = clang_arg.zig_equivalent; diff --git a/src/main.cpp b/src/main.cpp index f850b0bc47..0bb6868f1a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -430,6 +430,7 @@ static int main0(int argc, char **argv) { bool enable_dump_analysis = false; bool enable_doc_generation = false; bool emit_bin = true; + const char *emit_bin_override_path = nullptr; bool emit_asm = false; bool emit_llvm_ir = false; bool emit_h = false; @@ -451,6 +452,7 @@ static int main0(int argc, char **argv) { bool function_sections = false; const char *mcpu = nullptr; CodeModel code_model = CodeModelDefault; + const char *override_soname = nullptr; ZigList llvm_argv = {0}; llvm_argv.append("zig (LLVM option parsing)"); @@ -576,10 +578,14 @@ static int main0(int argc, char **argv) { } else if (argc >= 2 && strcmp(argv[1], "fmt") == 0) { return stage2_fmt(argc, argv); } else if (argc >= 2 && strcmp(argv[1], "cc") == 0) { - const char *o_arg = nullptr; + emit_h = false; + bool c_arg = false; Stage2ClangArgIterator it; stage2_clang_arg_iterator(&it, argc, argv); + bool nostdlib = false; + bool is_shared_lib = false; + ZigList linker_args = {}; while (it.has_next) { if ((err = stage2_clang_arg_next(&it))) { fprintf(stderr, "unable to parse command line parameters: %s\n", err_str(err)); @@ -590,7 +596,8 @@ static int main0(int argc, char **argv) { target_string = it.only_arg; break; case Stage2ClangArgO: // -o - o_arg = it.only_arg; + emit_bin_override_path = it.only_arg; + enable_cache = CacheOptOn; break; case Stage2ClangArgC: // -c c_arg = true; @@ -601,9 +608,17 @@ static int main0(int argc, char **argv) { } break; case Stage2ClangArgPositional: { - CFile *c_file = heap::c_allocator.create(); - c_file->source_path = it.only_arg; - c_source_files.append(c_file); + Buf *arg_buf = buf_create_from_str(it.only_arg); + if (buf_ends_with_str(arg_buf, ".c") || + buf_ends_with_str(arg_buf, ".cpp") || + buf_ends_with_str(arg_buf, ".s")) + { + CFile *c_file = heap::c_allocator.create(); + c_file->source_path = it.only_arg; + c_source_files.append(c_file); + } else { + objects.append(it.only_arg); + } break; } case Stage2ClangArgL: // -l @@ -611,18 +626,111 @@ static int main0(int argc, char **argv) { have_libc = true; link_libs.append(it.only_arg); break; + case Stage2ClangArgIgnore: + break; + case Stage2ClangArgPassthrough: + // Never mind what we're doing, just pass the args directly. For example --help. + return ZigClang_main(argc, argv); + case Stage2ClangArgPIC: + want_pic = WantPICEnabled; + break; + case Stage2ClangArgNoPIC: + want_pic = WantPICDisabled; + break; + case Stage2ClangArgNoStdLib: + nostdlib = true; + break; + case Stage2ClangArgShared: + is_dynamic = true; + is_shared_lib = true; + break; + case Stage2ClangArgRDynamic: + rdynamic = true; + break; + case Stage2ClangArgWL: { + const char *arg = it.only_arg; + for (;;) { + size_t pos = 0; + while (arg[pos] != ',' && arg[pos] != 0) pos += 1; + linker_args.append(buf_create_from_mem(arg, pos)); + if (arg[pos] == 0) break; + arg += pos + 1; + } + break; + } } } + // Parse linker args + for (size_t i = 0; i < linker_args.length; i += 1) { + Buf *arg = linker_args.at(i); + if (buf_eql_str(arg, "-soname")) { + i += 1; + if (i >= linker_args.length) { + fprintf(stderr, "expected linker arg after '%s'\n", buf_ptr(arg)); + return EXIT_FAILURE; + } + Buf *soname_buf = linker_args.at(i); + override_soname = buf_ptr(soname_buf); + // use it as --name + // example: libsoundio.so.2 + size_t prefix = 0; + if (buf_starts_with_str(soname_buf, "lib")) { + prefix = 3; + } + size_t end = buf_len(soname_buf); + if (buf_ends_with_str(soname_buf, ".so")) { + end -= 3; + } else { + bool found_digit = false; + while (end > 0 && isdigit(buf_ptr(soname_buf)[end - 1])) { + found_digit = true; + end -= 1; + } + if (found_digit && end > 0 && buf_ptr(soname_buf)[end - 1] == '.') { + end -= 1; + } else { + end = buf_len(soname_buf); + } + if (buf_ends_with_str(buf_slice(soname_buf, prefix, end), ".so")) { + end -= 3; + } + } + out_name = buf_ptr(buf_slice(soname_buf, prefix, end)); + } else if (buf_eql_str(arg, "-rpath")) { + i += 1; + if (i >= linker_args.length) { + fprintf(stderr, "expected linker arg after '%s'\n", buf_ptr(arg)); + return EXIT_FAILURE; + } + Buf *rpath = linker_args.at(i); + rpath_list.append(buf_ptr(rpath)); + } else { + fprintf(stderr, "warning: unsupported linker arg: %s\n", buf_ptr(arg)); + } + } + + if (!nostdlib && !have_libc) { + have_libc = true; + link_libs.append("c"); + } if (!c_arg) { cmd = CmdBuild; - out_type = OutTypeExe; - if (o_arg == nullptr) { - zig_panic("TODO set out name to a.out"); + if (is_shared_lib) { + out_type = OutTypeLib; + } else { + out_type = OutTypeExe; + } + if (emit_bin_override_path == nullptr) { + emit_bin_override_path = "a.out"; } } else { cmd = CmdBuild; out_type = OutTypeObj; } + if (c_source_files.length == 0 && objects.length == 0) { + // For example `zig cc` and no args should print the "no input files" message. + return ZigClang_main(argc, argv); + } } else for (int i = 1; i < argc; i += 1) { char *arg = argv[i]; @@ -1184,6 +1292,18 @@ static int main0(int argc, char **argv) { buf_out_name = buf_alloc(); os_path_extname(&basename, buf_out_name, nullptr); } + if (need_name && buf_out_name == nullptr && objects.length == 1) { + Buf basename = BUF_INIT; + os_path_split(buf_create_from_str(objects.at(0)), nullptr, &basename); + buf_out_name = buf_alloc(); + os_path_extname(&basename, buf_out_name, nullptr); + } + if (need_name && buf_out_name == nullptr && emit_bin_override_path != nullptr) { + Buf basename = BUF_INIT; + os_path_split(buf_create_from_str(emit_bin_override_path), nullptr, &basename); + buf_out_name = buf_alloc(); + os_path_extname(&basename, buf_out_name, nullptr); + } if (need_name && buf_out_name == nullptr) { fprintf(stderr, "--name [name] not provided and unable to infer\n\n"); @@ -1259,6 +1379,10 @@ static int main0(int argc, char **argv) { g->function_sections = function_sections; g->code_model = code_model; + if (override_soname) { + g->override_soname = buf_create_from_str(override_soname); + } + for (size_t i = 0; i < lib_dirs.length; i += 1) { codegen_add_lib_dir(g, lib_dirs.at(i)); } @@ -1337,7 +1461,14 @@ static int main0(int argc, char **argv) { os_spawn_process(args, &term); return term.code; } else if (cmd == CmdBuild) { - if (g->enable_cache) { + if (emit_bin_override_path != nullptr) { + Buf *dest_path = buf_create_from_str(emit_bin_override_path); + if ((err = os_update_file(&g->bin_file_output_path, dest_path))) { + fprintf(stderr, "unable to copy %s to %s: %s\n", buf_ptr(&g->bin_file_output_path), + buf_ptr(dest_path), err_str(err)); + return main_exit(root_progress_node, EXIT_FAILURE); + } + } else if (g->enable_cache) { #if defined(ZIG_OS_WINDOWS) buf_replace(&g->bin_file_output_path, '/', '\\'); buf_replace(g->output_dir, '/', '\\'); diff --git a/src/stage2.h b/src/stage2.h index 2abdc4c513..6b94f8780a 100644 --- a/src/stage2.h +++ b/src/stage2.h @@ -325,6 +325,14 @@ enum Stage2ClangArg { Stage2ClangArgOther, Stage2ClangArgPositional, Stage2ClangArgL, + Stage2ClangArgIgnore, + Stage2ClangArgPassthrough, + Stage2ClangArgPIC, + Stage2ClangArgNoPIC, + Stage2ClangArgNoStdLib, + Stage2ClangArgShared, + Stage2ClangArgRDynamic, + Stage2ClangArgWL, }; // ABI warning diff --git a/tools/update_clang_options.zig b/tools/update_clang_options.zig index 863c67b68d..c820ee34a3 100644 --- a/tools/update_clang_options.zig +++ b/tools/update_clang_options.zig @@ -38,6 +38,42 @@ const known_options = [_]KnownOpt{ .name = "l", .ident = "l", }, + .{ + .name = "pipe", + .ident = "ignore", + }, + .{ + .name = "help", + .ident = "passthrough", + }, + .{ + .name = "fPIC", + .ident = "pic", + }, + .{ + .name = "fno-PIC", + .ident = "no_pic", + }, + .{ + .name = "nostdlib", + .ident = "nostdlib", + }, + .{ + .name = "no-standard-libraries", + .ident = "nostdlib", + }, + .{ + .name = "shared", + .ident = "shared", + }, + .{ + .name = "rdynamic", + .ident = "rdynamic", + }, + .{ + .name = "Wl,", + .ident = "wl", + }, }; const blacklisted_options = [_][]const u8{}; @@ -110,7 +146,7 @@ pub fn main() anyerror!void { const tree = try parser.parse(json_text); const root_map = &tree.root.Object; - var all_names = std.ArrayList([]const u8).init(allocator); + var all_objects = std.ArrayList(*json.ObjectMap).init(allocator); { var it = root_map.iterator(); it_map: while (it.next()) |kv| { @@ -123,10 +159,12 @@ pub fn main() anyerror!void { if (std.mem.eql(u8, blacklisted_key, kv.key)) continue :it_map; } if (kv.value.Object.get("Name").?.value.String.len == 0) continue; - try all_names.append(kv.key); + try all_objects.append(&kv.value.Object); } } - std.sort.sort([]const u8, all_names.span(), nameLessThan); + // Some options have multiple matches. As an example, "-Wl,foo" matches both + // "W" and "Wl,". So we sort this list in order of descending priority. + std.sort.sort(*json.ObjectMap, all_objects.span(), objectLessThan); var stdout_bos = std.io.bufferedOutStream(std.io.getStdOut().outStream()); const stdout = stdout_bos.outStream(); @@ -138,8 +176,7 @@ pub fn main() anyerror!void { \\ ); - for (all_names.span()) |key| { - const obj = &root_map.get(key).?.value.Object; + for (all_objects.span()) |obj| { const name = obj.get("Name").?.value.String; var pd1 = false; var pd2 = false; @@ -153,61 +190,12 @@ pub fn main() anyerror!void { } else if (std.mem.eql(u8, prefix, "/")) { pslash = true; } else { - std.debug.warn("{} (key {}) has unrecognized prefix '{}'\n", .{ name, key, prefix }); + std.debug.warn("{} has unrecognized prefix '{}'\n", .{ name, prefix }); std.process.exit(1); } } - const num_args = @intCast(u8, obj.get("NumArgs").?.value.Integer); - const syntax_str: []const u8 = blk: { - for (obj.get("!superclasses").?.value.Array.span()) |superclass_json| { - const superclass = superclass_json.String; - if (std.mem.eql(u8, superclass, "Joined")) { - break :blk ".joined"; - } else if (std.mem.eql(u8, superclass, "CLJoined")) { - break :blk ".joined"; - } else if (std.mem.eql(u8, superclass, "CLIgnoredJoined")) { - break :blk ".joined"; - } else if (std.mem.eql(u8, superclass, "CLCompileJoined")) { - break :blk ".joined"; - } else if (std.mem.eql(u8, superclass, "JoinedOrSeparate")) { - break :blk ".joined_or_separate"; - } else if (std.mem.eql(u8, superclass, "CLJoinedOrSeparate")) { - break :blk ".joined_or_separate"; - } else if (std.mem.eql(u8, superclass, "CLCompileJoinedOrSeparate")) { - break :blk ".joined_or_separate"; - } else if (std.mem.eql(u8, superclass, "Flag")) { - break :blk ".flag"; - } else if (std.mem.eql(u8, superclass, "CLFlag")) { - break :blk ".flag"; - } else if (std.mem.eql(u8, superclass, "CLIgnoredFlag")) { - break :blk ".flag"; - } else if (std.mem.eql(u8, superclass, "Separate")) { - break :blk ".separate"; - } else if (std.mem.eql(u8, superclass, "JoinedAndSeparate")) { - break :blk ".joined_and_separate"; - } else if (std.mem.eql(u8, superclass, "CommaJoined")) { - break :blk ".comma_joined"; - } else if (std.mem.eql(u8, superclass, "CLRemainingArgsJoined")) { - break :blk ".remaining_args_joined"; - } else if (std.mem.eql(u8, superclass, "MultiArg")) { - break :blk try std.fmt.allocPrint(allocator, ".{{ .multi_arg = {} }}", .{num_args}); - } - } - if (std.mem.eql(u8, name, "")) { - break :blk ".flag"; - } else if (std.mem.eql(u8, name, "")) { - break :blk ".flag"; - } - const kind_def = obj.get("Kind").?.value.Object.get("def").?.value.String; - if (std.mem.eql(u8, kind_def, "KIND_FLAG")) { - break :blk ".flag"; - } - std.debug.warn("{} (key {}) has unrecognized superclasses:\n", .{ name, key }); - for (obj.get("!superclasses").?.value.Array.span()) |superclass_json| { - std.debug.warn(" {}\n", .{superclass_json.String}); - } - std.process.exit(1); - }; + const syntax = objSyntax(obj); + if (knownOption(name)) |ident| { try stdout.print( \\.{{ @@ -219,22 +207,14 @@ pub fn main() anyerror!void { \\ .psl = {}, \\}}, \\ - , .{ name, syntax_str, ident, pd1, pd2, pslash }); - } else if (pd1 and !pd2 and !pslash and - std.mem.eql(u8, syntax_str, ".flag")) - { + , .{ name, syntax, ident, pd1, pd2, pslash }); + } else if (pd1 and !pd2 and !pslash and syntax == .flag) { try stdout.print("flagpd1(\"{}\"),\n", .{name}); - } else if (pd1 and !pd2 and !pslash and - std.mem.eql(u8, syntax_str, ".joined")) - { + } else if (pd1 and !pd2 and !pslash and syntax == .joined) { try stdout.print("joinpd1(\"{}\"),\n", .{name}); - } else if (pd1 and !pd2 and !pslash and - std.mem.eql(u8, syntax_str, ".joined_or_separate")) - { + } else if (pd1 and !pd2 and !pslash and syntax == .joined_or_separate) { try stdout.print("jspd1(\"{}\"),\n", .{name}); - } else if (pd1 and !pd2 and !pslash and - std.mem.eql(u8, syntax_str, ".separate")) - { + } else if (pd1 and !pd2 and !pslash and syntax == .separate) { try stdout.print("sepd1(\"{}\"),\n", .{name}); } else { try stdout.print( @@ -247,7 +227,7 @@ pub fn main() anyerror!void { \\ .psl = {}, \\}}, \\ - , .{ name, syntax_str, pd1, pd2, pslash }); + , .{ name, syntax, pd1, pd2, pslash }); } } @@ -259,8 +239,142 @@ pub fn main() anyerror!void { try stdout_bos.flush(); } -fn nameLessThan(a: []const u8, b: []const u8) bool { - return std.mem.lessThan(u8, a, b); +// TODO we should be able to import clang_options.zig but currently this is problematic because it will +// import stage2.zig and that causes a bunch of stuff to get exported +const Syntax = union(enum) { + /// A flag with no values. + flag, + + /// An option which prefixes its (single) value. + joined, + + /// An option which is followed by its value. + separate, + + /// An option which is either joined to its (non-empty) value, or followed by its value. + joined_or_separate, + + /// An option which is both joined to its (first) value, and followed by its (second) value. + joined_and_separate, + + /// An option followed by its values, which are separated by commas. + comma_joined, + + /// An option which consumes an optional joined argument and any other remaining arguments. + remaining_args_joined, + + /// An option which is which takes multiple (separate) arguments. + multi_arg: u8, + + pub fn format( + self: Syntax, + comptime fmt: []const u8, + options: std.fmt.FormatOptions, + out_stream: var, + ) !void { + switch (self) { + .multi_arg => |n| return out_stream.print(".{{.{}={}}}", .{ @tagName(self), n }), + else => return out_stream.print(".{}", .{@tagName(self)}), + } + } +}; + +fn objSyntax(obj: *json.ObjectMap) Syntax { + const num_args = @intCast(u8, obj.get("NumArgs").?.value.Integer); + for (obj.get("!superclasses").?.value.Array.span()) |superclass_json| { + const superclass = superclass_json.String; + if (std.mem.eql(u8, superclass, "Joined")) { + return .joined; + } else if (std.mem.eql(u8, superclass, "CLJoined")) { + return .joined; + } else if (std.mem.eql(u8, superclass, "CLIgnoredJoined")) { + return .joined; + } else if (std.mem.eql(u8, superclass, "CLCompileJoined")) { + return .joined; + } else if (std.mem.eql(u8, superclass, "JoinedOrSeparate")) { + return .joined_or_separate; + } else if (std.mem.eql(u8, superclass, "CLJoinedOrSeparate")) { + return .joined_or_separate; + } else if (std.mem.eql(u8, superclass, "CLCompileJoinedOrSeparate")) { + return .joined_or_separate; + } else if (std.mem.eql(u8, superclass, "Flag")) { + return .flag; + } else if (std.mem.eql(u8, superclass, "CLFlag")) { + return .flag; + } else if (std.mem.eql(u8, superclass, "CLIgnoredFlag")) { + return .flag; + } else if (std.mem.eql(u8, superclass, "Separate")) { + return .separate; + } else if (std.mem.eql(u8, superclass, "JoinedAndSeparate")) { + return .joined_and_separate; + } else if (std.mem.eql(u8, superclass, "CommaJoined")) { + return .comma_joined; + } else if (std.mem.eql(u8, superclass, "CLRemainingArgsJoined")) { + return .remaining_args_joined; + } else if (std.mem.eql(u8, superclass, "MultiArg")) { + return .{ .multi_arg = num_args }; + } + } + const name = obj.get("Name").?.value.String; + if (std.mem.eql(u8, name, "")) { + return .flag; + } else if (std.mem.eql(u8, name, "")) { + return .flag; + } + const kind_def = obj.get("Kind").?.value.Object.get("def").?.value.String; + if (std.mem.eql(u8, kind_def, "KIND_FLAG")) { + return .flag; + } + const key = obj.get("!name").?.value.String; + std.debug.warn("{} (key {}) has unrecognized superclasses:\n", .{ name, key }); + for (obj.get("!superclasses").?.value.Array.span()) |superclass_json| { + std.debug.warn(" {}\n", .{superclass_json.String}); + } + std.process.exit(1); +} + +fn syntaxMatchesWithEql(syntax: Syntax) bool { + return switch (syntax) { + .flag, + .separate, + .multi_arg, + => true, + + .joined, + .joined_or_separate, + .joined_and_separate, + .comma_joined, + .remaining_args_joined, + => false, + }; +} + +fn objectLessThan(a: *json.ObjectMap, b: *json.ObjectMap) bool { + // Priority is determined by exact matches first, followed by prefix matches in descending + // length, with key as a final tiebreaker. + const a_syntax = objSyntax(a); + const b_syntax = objSyntax(b); + + const a_match_with_eql = syntaxMatchesWithEql(a_syntax); + const b_match_with_eql = syntaxMatchesWithEql(b_syntax); + + if (a_match_with_eql and !b_match_with_eql) { + return true; + } else if (!a_match_with_eql and b_match_with_eql) { + return false; + } + + if (!a_match_with_eql and !b_match_with_eql) { + const a_name = a.get("Name").?.value.String; + const b_name = b.get("Name").?.value.String; + if (a_name.len != b_name.len) { + return a_name.len > b_name.len; + } + } + + const a_key = a.get("!name").?.value.String; + const b_key = b.get("!name").?.value.String; + return std.mem.lessThan(u8, a_key, b_key); } fn usageAndExit(file: fs.File, arg0: []const u8, code: u8) noreturn { From 4d9b458f8f722603dd0c303bddeca553948025fb Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 21 Mar 2020 16:51:43 -0400 Subject: [PATCH 3/6] zig cc: support .cc and .cxx extensions --- src/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 0bb6868f1a..fc73cb78d6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -610,7 +610,9 @@ static int main0(int argc, char **argv) { case Stage2ClangArgPositional: { Buf *arg_buf = buf_create_from_str(it.only_arg); if (buf_ends_with_str(arg_buf, ".c") || + buf_ends_with_str(arg_buf, ".cc") || buf_ends_with_str(arg_buf, ".cpp") || + buf_ends_with_str(arg_buf, ".cxx") || buf_ends_with_str(arg_buf, ".s")) { CFile *c_file = heap::c_allocator.create(); From 28ad78cb7f4a567ce6a595b8ff466e90b311f3e4 Mon Sep 17 00:00:00 2001 From: Michael Dusan Date: Sat, 21 Mar 2020 16:38:58 -0400 Subject: [PATCH 4/6] =?UTF-8?q?rename=20"passthrough"=20=E2=86=92=20"drive?= =?UTF-8?q?r=5Fpunt"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - punt when `-E` is supplied - punt when `-S` is supplied --- src-self-hosted/clang_options_data.zig | 24 +++++++++++++++++++----- src-self-hosted/stage2.zig | 2 +- src/main.cpp | 2 +- src/stage2.h | 2 +- tools/update_clang_options.zig | 10 +++++++++- 5 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src-self-hosted/clang_options_data.zig b/src-self-hosted/clang_options_data.zig index a21069f93c..bfd26c6de2 100644 --- a/src-self-hosted/clang_options_data.zig +++ b/src-self-hosted/clang_options_data.zig @@ -4,7 +4,14 @@ usingnamespace @import("clang_options.zig"); pub const data = blk: { @setEvalBranchQuota(6000); break :blk &[_]CliArg{ flagpd1("C"), flagpd1("CC"), -flagpd1("E"), +.{ + .name = "E", + .syntax = .flag, + .zig_equivalent = .driver_punt, + .pd1 = true, + .pd2 = false, + .psl = false, +}, flagpd1("EB"), flagpd1("EL"), flagpd1("Eonly"), @@ -36,7 +43,14 @@ flagpd1("Q"), flagpd1("Qn"), flagpd1("Qunused-arguments"), flagpd1("Qy"), -flagpd1("S"), +.{ + .name = "S", + .syntax = .flag, + .zig_equivalent = .driver_punt, + .pd1 = true, + .pd2 = false, + .psl = false, +}, .{ .name = "", .syntax = .flag, @@ -119,7 +133,7 @@ flagpd1("###"), .{ .name = "E", .syntax = .flag, - .zig_equivalent = .other, + .zig_equivalent = .driver_punt, .pd1 = true, .pd2 = false, .psl = true, @@ -1127,7 +1141,7 @@ flagpd1("###"), .{ .name = "help", .syntax = .flag, - .zig_equivalent = .passthrough, + .zig_equivalent = .driver_punt, .pd1 = true, .pd2 = false, .psl = true, @@ -3131,7 +3145,7 @@ sepd1("header-include-file"), .{ .name = "help", .syntax = .flag, - .zig_equivalent = .passthrough, + .zig_equivalent = .driver_punt, .pd1 = true, .pd2 = true, .psl = false, diff --git a/src-self-hosted/stage2.zig b/src-self-hosted/stage2.zig index 73a053b853..45fa2ec3e1 100644 --- a/src-self-hosted/stage2.zig +++ b/src-self-hosted/stage2.zig @@ -1240,7 +1240,7 @@ pub const ClangArgIterator = extern struct { positional, l, ignore, - passthrough, + driver_punt, pic, no_pic, nostdlib, diff --git a/src/main.cpp b/src/main.cpp index fc73cb78d6..d64b8dcdbe 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -630,7 +630,7 @@ static int main0(int argc, char **argv) { break; case Stage2ClangArgIgnore: break; - case Stage2ClangArgPassthrough: + case Stage2ClangArgDriverPunt: // Never mind what we're doing, just pass the args directly. For example --help. return ZigClang_main(argc, argv); case Stage2ClangArgPIC: diff --git a/src/stage2.h b/src/stage2.h index 6b94f8780a..5f233f9fc3 100644 --- a/src/stage2.h +++ b/src/stage2.h @@ -326,7 +326,7 @@ enum Stage2ClangArg { Stage2ClangArgPositional, Stage2ClangArgL, Stage2ClangArgIgnore, - Stage2ClangArgPassthrough, + Stage2ClangArgDriverPunt, Stage2ClangArgPIC, Stage2ClangArgNoPIC, Stage2ClangArgNoStdLib, diff --git a/tools/update_clang_options.zig b/tools/update_clang_options.zig index c820ee34a3..b4cec5afd9 100644 --- a/tools/update_clang_options.zig +++ b/tools/update_clang_options.zig @@ -44,7 +44,7 @@ const known_options = [_]KnownOpt{ }, .{ .name = "help", - .ident = "passthrough", + .ident = "driver_punt", }, .{ .name = "fPIC", @@ -74,6 +74,14 @@ const known_options = [_]KnownOpt{ .name = "Wl,", .ident = "wl", }, + .{ + .name = "E", + .ident = "driver_punt", + }, + .{ + .name = "S", + .ident = "driver_punt", + }, }; const blacklisted_options = [_][]const u8{}; From 4b0ddb817bb5d4effd8cd2dd0844ac278e35e1d5 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 21 Mar 2020 20:32:48 -0400 Subject: [PATCH 5/6] zig cc: better support for the preprocessor option (-E) --- src-self-hosted/clang_options_data.zig | 8 ++-- src-self-hosted/stage2.zig | 1 + src/all_types.hpp | 2 + src/codegen.cpp | 22 +++++++--- src/main.cpp | 60 ++++++++++++++++++++++++-- src/os.cpp | 24 +++++++++++ src/os.hpp | 1 + src/stage2.h | 1 + tools/update_clang_options.zig | 10 ++++- 9 files changed, 115 insertions(+), 14 deletions(-) diff --git a/src-self-hosted/clang_options_data.zig b/src-self-hosted/clang_options_data.zig index bfd26c6de2..b1796dce75 100644 --- a/src-self-hosted/clang_options_data.zig +++ b/src-self-hosted/clang_options_data.zig @@ -7,7 +7,7 @@ flagpd1("CC"), .{ .name = "E", .syntax = .flag, - .zig_equivalent = .driver_punt, + .zig_equivalent = .preprocess, .pd1 = true, .pd2 = false, .psl = false, @@ -133,7 +133,7 @@ flagpd1("###"), .{ .name = "E", .syntax = .flag, - .zig_equivalent = .driver_punt, + .zig_equivalent = .preprocess, .pd1 = true, .pd2 = false, .psl = true, @@ -1421,7 +1421,7 @@ flagpd1("###"), .{ .name = "assemble", .syntax = .flag, - .zig_equivalent = .other, + .zig_equivalent = .driver_punt, .pd1 = false, .pd2 = true, .psl = false, @@ -1749,7 +1749,7 @@ flagpd1("###"), .{ .name = "preprocess", .syntax = .flag, - .zig_equivalent = .other, + .zig_equivalent = .preprocess, .pd1 = false, .pd2 = true, .psl = false, diff --git a/src-self-hosted/stage2.zig b/src-self-hosted/stage2.zig index 45fa2ec3e1..030e9694e8 100644 --- a/src-self-hosted/stage2.zig +++ b/src-self-hosted/stage2.zig @@ -1247,6 +1247,7 @@ pub const ClangArgIterator = extern struct { shared, rdynamic, wl, + preprocess, }; fn init(argv: []const [*:0]const u8) ClangArgIterator { diff --git a/src/all_types.hpp b/src/all_types.hpp index b1450f08da..aed03d4781 100644 --- a/src/all_types.hpp +++ b/src/all_types.hpp @@ -2003,6 +2003,7 @@ enum WantCSanitize { struct CFile { ZigList args; const char *source_path; + const char *preprocessor_only_basename; }; // When adding fields, check if they should be added to the hash computation in build_with_cache @@ -2147,6 +2148,7 @@ struct CodeGen { // As an input parameter, mutually exclusive with enable_cache. But it gets // populated in codegen_build_and_link. Buf *output_dir; + Buf *c_artifact_dir; const char **libc_include_dir_list; size_t libc_include_dir_len; diff --git a/src/codegen.cpp b/src/codegen.cpp index 7729172c2f..7b481f7c21 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -9723,13 +9723,17 @@ static void gen_c_object(CodeGen *g, Buf *self_exe_path, CFile *c_file) { buf_len(c_source_basename), 0); Buf *final_o_basename = buf_alloc(); - // We special case when doing build-obj for just one C file - if (main_output_dir_is_just_one_c_object_pre(g)) { - buf_init_from_buf(final_o_basename, g->root_out_name); + if (c_file->preprocessor_only_basename == nullptr) { + // We special case when doing build-obj for just one C file + if (main_output_dir_is_just_one_c_object_pre(g)) { + buf_init_from_buf(final_o_basename, g->root_out_name); + } else { + os_path_extname(c_source_basename, final_o_basename, nullptr); + } + buf_append_str(final_o_basename, target_o_file_ext(g->zig_target)); } else { - os_path_extname(c_source_basename, final_o_basename, nullptr); + buf_init_from_str(final_o_basename, c_file->preprocessor_only_basename); } - buf_append_str(final_o_basename, target_o_file_ext(g->zig_target)); CacheHash *cache_hash; if ((err = create_c_object_cache(g, &cache_hash, true))) { @@ -9780,13 +9784,18 @@ static void gen_c_object(CodeGen *g, Buf *self_exe_path, CFile *c_file) { args.append(buf_ptr(self_exe_path)); args.append("clang"); + if (c_file->preprocessor_only_basename != nullptr) { + args.append("-E"); + } else { + args.append("-c"); + } + Buf *out_dep_path = buf_sprintf("%s.d", buf_ptr(out_obj_path)); add_cc_args(g, args, buf_ptr(out_dep_path), false); args.append("-o"); args.append(buf_ptr(out_obj_path)); - args.append("-c"); args.append(buf_ptr(c_source_file)); for (size_t arg_i = 0; arg_i < c_file->args.length; arg_i += 1) { @@ -9841,6 +9850,7 @@ static void gen_c_object(CodeGen *g, Buf *self_exe_path, CFile *c_file) { os_path_join(artifact_dir, final_o_basename, o_final_path); } + g->c_artifact_dir = artifact_dir; g->link_objects.append(o_final_path); g->caches_to_release.append(cache_hash); diff --git a/src/main.cpp b/src/main.cpp index d64b8dcdbe..071b365d2f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -453,6 +453,7 @@ static int main0(int argc, char **argv) { const char *mcpu = nullptr; CodeModel code_model = CodeModelDefault; const char *override_soname = nullptr; + bool only_preprocess = false; ZigList llvm_argv = {0}; llvm_argv.append("zig (LLVM option parsing)"); @@ -660,6 +661,9 @@ static int main0(int argc, char **argv) { } break; } + case Stage2ClangArgPreprocess: + only_preprocess = true; + break; } } // Parse linker args @@ -715,7 +719,28 @@ static int main0(int argc, char **argv) { have_libc = true; link_libs.append("c"); } - if (!c_arg) { + if (only_preprocess) { + cmd = CmdBuild; + out_type = OutTypeObj; + emit_bin = false; + // Transfer "objects" into c_source_files + for (size_t i = 0; i < objects.length; i += 1) { + CFile *c_file = heap::c_allocator.create(); + c_file->source_path = objects.at(i); + c_source_files.append(c_file); + } + for (size_t i = 0; i < c_source_files.length; i += 1) { + Buf *src_path; + if (emit_bin_override_path != nullptr) { + src_path = buf_create_from_str(emit_bin_override_path); + } else { + src_path = buf_create_from_str(c_source_files.at(i)->source_path); + } + Buf basename = BUF_INIT; + os_path_split(src_path, nullptr, &basename); + c_source_files.at(i)->preprocessor_only_basename = buf_ptr(&basename); + } + } else if (!c_arg) { cmd = CmdBuild; if (is_shared_lib) { out_type = OutTypeLib; @@ -1464,12 +1489,41 @@ static int main0(int argc, char **argv) { return term.code; } else if (cmd == CmdBuild) { if (emit_bin_override_path != nullptr) { +#if defined(ZIG_OS_WINDOWS) + buf_replace(g->output_dir, '/', '\\'); +#endif Buf *dest_path = buf_create_from_str(emit_bin_override_path); - if ((err = os_update_file(&g->bin_file_output_path, dest_path))) { - fprintf(stderr, "unable to copy %s to %s: %s\n", buf_ptr(&g->bin_file_output_path), + Buf *source_path; + if (only_preprocess) { + source_path = buf_alloc(); + Buf *pp_only_basename = buf_create_from_str( + c_source_files.at(0)->preprocessor_only_basename); + os_path_join(g->output_dir, pp_only_basename, source_path); + + } else { + source_path = &g->bin_file_output_path; + } + if ((err = os_update_file(source_path, dest_path))) { + fprintf(stderr, "unable to copy %s to %s: %s\n", buf_ptr(source_path), buf_ptr(dest_path), err_str(err)); return main_exit(root_progress_node, EXIT_FAILURE); } + } else if (only_preprocess) { +#if defined(ZIG_OS_WINDOWS) + buf_replace(g->c_artifact_dir, '/', '\\'); +#endif + // dump the preprocessed output to stdout + for (size_t i = 0; i < c_source_files.length; i += 1) { + Buf *source_path = buf_alloc(); + Buf *pp_only_basename = buf_create_from_str( + c_source_files.at(i)->preprocessor_only_basename); + os_path_join(g->c_artifact_dir, pp_only_basename, source_path); + if ((err = os_dump_file(source_path, stdout))) { + fprintf(stderr, "unable to read %s: %s\n", buf_ptr(source_path), + err_str(err)); + return main_exit(root_progress_node, EXIT_FAILURE); + } + } } else if (g->enable_cache) { #if defined(ZIG_OS_WINDOWS) buf_replace(&g->bin_file_output_path, '/', '\\'); diff --git a/src/os.cpp b/src/os.cpp index f65a578e17..351b61cd66 100644 --- a/src/os.cpp +++ b/src/os.cpp @@ -1051,6 +1051,30 @@ static Error copy_open_files(FILE *src_f, FILE *dest_f) { } } +Error os_dump_file(Buf *src_path, FILE *dest_file) { + Error err; + + FILE *src_f = fopen(buf_ptr(src_path), "rb"); + if (!src_f) { + int err = errno; + if (err == ENOENT) { + return ErrorFileNotFound; + } else if (err == EACCES || err == EPERM) { + return ErrorAccess; + } else { + return ErrorFileSystem; + } + } + copy_open_files(src_f, dest_file); + if ((err = copy_open_files(src_f, dest_file))) { + fclose(src_f); + return err; + } + + fclose(src_f); + return ErrorNone; +} + #if defined(ZIG_OS_WINDOWS) static void windows_filetime_to_os_timestamp(FILETIME *ft, OsTimeStamp *mtime) { mtime->sec = (((ULONGLONG) ft->dwHighDateTime) << 32) + ft->dwLowDateTime; diff --git a/src/os.hpp b/src/os.hpp index 116861e8b5..e73e5e3aaa 100644 --- a/src/os.hpp +++ b/src/os.hpp @@ -129,6 +129,7 @@ void os_file_close(OsFile *file); Error ATTRIBUTE_MUST_USE os_write_file(Buf *full_path, Buf *contents); Error ATTRIBUTE_MUST_USE os_copy_file(Buf *src_path, Buf *dest_path); Error ATTRIBUTE_MUST_USE os_update_file(Buf *src_path, Buf *dest_path); +Error ATTRIBUTE_MUST_USE os_dump_file(Buf *src_path, FILE *dest_file); Error ATTRIBUTE_MUST_USE os_fetch_file(FILE *file, Buf *out_contents); Error ATTRIBUTE_MUST_USE os_fetch_file_path(Buf *full_path, Buf *out_contents); diff --git a/src/stage2.h b/src/stage2.h index 5f233f9fc3..15c4c604cd 100644 --- a/src/stage2.h +++ b/src/stage2.h @@ -333,6 +333,7 @@ enum Stage2ClangArg { Stage2ClangArgShared, Stage2ClangArgRDynamic, Stage2ClangArgWL, + Stage2ClangArgPreprocess, }; // ABI warning diff --git a/tools/update_clang_options.zig b/tools/update_clang_options.zig index b4cec5afd9..ccd4443130 100644 --- a/tools/update_clang_options.zig +++ b/tools/update_clang_options.zig @@ -76,12 +76,20 @@ const known_options = [_]KnownOpt{ }, .{ .name = "E", - .ident = "driver_punt", + .ident = "preprocess", + }, + .{ + .name = "preprocess", + .ident = "preprocess", }, .{ .name = "S", .ident = "driver_punt", }, + .{ + .name = "assemble", + .ident = "driver_punt", + }, }; const blacklisted_options = [_][]const u8{}; From 2b65dc10328cc437b21114e3c87fac2ef6ef9adc Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 21 Mar 2020 22:30:46 -0400 Subject: [PATCH 6/6] zig cc: detect optimization and debug flags --- src-self-hosted/clang_options.zig | 10 ++--- src-self-hosted/clang_options_data.zig | 54 +++++++++++++++++++------ src-self-hosted/stage2.zig | 18 ++++++--- src/codegen.cpp | 1 + src/main.cpp | 41 +++++++++++++++++++ src/stage2.h | 3 ++ tools/update_clang_options.zig | 56 ++++++++++++++++++++++++++ 7 files changed, 159 insertions(+), 24 deletions(-) diff --git a/src-self-hosted/clang_options.zig b/src-self-hosted/clang_options.zig index 538f281706..70525655de 100644 --- a/src-self-hosted/clang_options.zig +++ b/src-self-hosted/clang_options.zig @@ -46,23 +46,23 @@ pub const CliArg = struct { multi_arg: u8, }; - pub fn matchEql(self: CliArg, arg: []const u8) bool { + pub fn matchEql(self: CliArg, arg: []const u8) u2 { if (self.pd1 and arg.len >= self.name.len + 1 and mem.startsWith(u8, arg, "-") and mem.eql(u8, arg[1..], self.name)) { - return true; + return 1; } if (self.pd2 and arg.len >= self.name.len + 2 and mem.startsWith(u8, arg, "--") and mem.eql(u8, arg[2..], self.name)) { - return true; + return 2; } if (self.psl and arg.len >= self.name.len + 1 and mem.startsWith(u8, arg, "/") and mem.eql(u8, arg[1..], self.name)) { - return true; + return 1; } - return false; + return 0; } pub fn matchStartsWith(self: CliArg, arg: []const u8) usize { diff --git a/src-self-hosted/clang_options_data.zig b/src-self-hosted/clang_options_data.zig index b1796dce75..1e472f80a5 100644 --- a/src-self-hosted/clang_options_data.zig +++ b/src-self-hosted/clang_options_data.zig @@ -35,7 +35,14 @@ flagpd1("MV"), flagpd1("Mach"), flagpd1("O0"), flagpd1("O4"), -flagpd1("O"), +.{ + .name = "O", + .syntax = .flag, + .zig_equivalent = .optimize, + .pd1 = true, + .pd2 = false, + .psl = false, +}, flagpd1("ObjC"), flagpd1("ObjC++"), flagpd1("P"), @@ -1485,7 +1492,7 @@ flagpd1("###"), .{ .name = "debug", .syntax = .flag, - .zig_equivalent = .other, + .zig_equivalent = .debug, .pd1 = false, .pd2 = true, .psl = false, @@ -1701,7 +1708,7 @@ flagpd1("###"), .{ .name = "optimize", .syntax = .flag, - .zig_equivalent = .other, + .zig_equivalent = .optimize, .pd1 = false, .pd2 = true, .psl = false, @@ -2034,7 +2041,7 @@ flagpd1("fno-semantic-interposition"), .{ .name = "O1", .syntax = .flag, - .zig_equivalent = .other, + .zig_equivalent = .optimize, .pd1 = true, .pd2 = false, .psl = true, @@ -2042,7 +2049,7 @@ flagpd1("fno-semantic-interposition"), .{ .name = "O2", .syntax = .flag, - .zig_equivalent = .other, + .zig_equivalent = .optimize, .pd1 = true, .pd2 = false, .psl = true, @@ -2083,7 +2090,7 @@ flagpd1("fno-ident"), .{ .name = "Og", .syntax = .flag, - .zig_equivalent = .other, + .zig_equivalent = .optimize, .pd1 = true, .pd2 = false, .psl = true, @@ -3088,7 +3095,14 @@ flagpd1("g0"), flagpd1("g1"), flagpd1("g2"), flagpd1("g3"), -flagpd1("g"), +.{ + .name = "g", + .syntax = .flag, + .zig_equivalent = .debug, + .pd1 = true, + .pd2 = false, + .psl = false, +}, sepd1("gcc-toolchain"), flagpd1("gcodeview"), flagpd1("gcodeview-ghash"), @@ -4954,7 +4968,7 @@ joinpd1("flto-jobs="), .{ .name = "fsanitize=", .syntax = .comma_joined, - .zig_equivalent = .other, + .zig_equivalent = .sanitize, .pd1 = true, .pd2 = false, .psl = false, @@ -4997,7 +5011,7 @@ joinpd1("segs_read_"), .{ .name = "optimize=", .syntax = .joined, - .zig_equivalent = .other, + .zig_equivalent = .optimize, .pd1 = false, .pd2 = true, .psl = false, @@ -5187,7 +5201,7 @@ joinpd1("Rpass="), .{ .name = "debug=", .syntax = .joined, - .zig_equivalent = .other, + .zig_equivalent = .debug, .pd1 = false, .pd2 = true, .psl = false, @@ -5231,7 +5245,14 @@ joinpd1("mtune="), .psl = false, }, joinpd1("weak-l"), -joinpd1("Ofast"), +.{ + .name = "Ofast", + .syntax = .joined, + .zig_equivalent = .optimize, + .pd1 = true, + .pd2 = false, + .psl = false, +}, jspd1("Tdata"), jspd1("Ttext"), .{ @@ -5584,7 +5605,14 @@ jspd1("G"), jspd1("I"), jspd1("J"), jspd1("L"), -joinpd1("O"), +.{ + .name = "O", + .syntax = .joined, + .zig_equivalent = .optimize, + .pd1 = true, + .pd2 = false, + .psl = false, +}, joinpd1("R"), jspd1("T"), jspd1("U"), @@ -5619,7 +5647,7 @@ joinpd1("Z"), .{ .name = "O", .syntax = .joined, - .zig_equivalent = .other, + .zig_equivalent = .optimize, .pd1 = true, .pd2 = false, .psl = true, diff --git a/src-self-hosted/stage2.zig b/src-self-hosted/stage2.zig index 030e9694e8..f67200097c 100644 --- a/src-self-hosted/stage2.zig +++ b/src-self-hosted/stage2.zig @@ -1248,6 +1248,9 @@ pub const ClangArgIterator = extern struct { rdynamic, wl, preprocess, + optimize, + debug, + sanitize, }; fn init(argv: []const [*:0]const u8) ClangArgIterator { @@ -1284,11 +1287,14 @@ pub const ClangArgIterator = extern struct { } find_clang_arg: for (clang_args) |clang_arg| switch (clang_arg.syntax) { - .flag => if (clang_arg.matchEql(arg)) { - self.zig_equivalent = clang_arg.zig_equivalent; - self.only_arg = arg.ptr; + .flag => { + const prefix_len = clang_arg.matchEql(arg); + if (prefix_len > 0) { + self.zig_equivalent = clang_arg.zig_equivalent; + self.only_arg = arg.ptr + prefix_len; - break :find_clang_arg; + break :find_clang_arg; + } }, .joined, .comma_joined => { // joined example: --target=foo @@ -1338,7 +1344,7 @@ pub const ClangArgIterator = extern struct { break :find_clang_arg; } }, - .separate => if (clang_arg.matchEql(arg)) { + .separate => if (clang_arg.matchEql(arg) > 0) { if (self.next_index >= self.argv_len) { std.debug.warn("Expected parameter after '{}'\n", .{arg}); process.exit(1); @@ -1355,7 +1361,7 @@ pub const ClangArgIterator = extern struct { @panic("TODO"); } }, - .multi_arg => if (clang_arg.matchEql(arg)) { + .multi_arg => if (clang_arg.matchEql(arg) > 0) { @panic("TODO"); }, } diff --git a/src/codegen.cpp b/src/codegen.cpp index 7b481f7c21..a0fd984740 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -9269,6 +9269,7 @@ void add_cc_args(CodeGen *g, ZigList &args, const char *out_dep_pa case BuildModeDebug: // windows c runtime requires -D_DEBUG if using debug libraries args.append("-D_DEBUG"); + args.append("-Og"); if (g->libc_link_lib != nullptr) { args.append("-fstack-protector-strong"); diff --git a/src/main.cpp b/src/main.cpp index 071b365d2f..b47e532d9b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -580,6 +580,7 @@ static int main0(int argc, char **argv) { return stage2_fmt(argc, argv); } else if (argc >= 2 && strcmp(argv[1], "cc") == 0) { emit_h = false; + strip = true; bool c_arg = false; Stage2ClangArgIterator it; @@ -664,6 +665,42 @@ static int main0(int argc, char **argv) { case Stage2ClangArgPreprocess: only_preprocess = true; break; + case Stage2ClangArgOptimize: + // alright what release mode do they want? + if (strcmp(it.only_arg, "Os") == 0) { + build_mode = BuildModeSmallRelease; + } else if (strcmp(it.only_arg, "O2") == 0 || + strcmp(it.only_arg, "O3") == 0 || + strcmp(it.only_arg, "O4") == 0) + { + build_mode = BuildModeFastRelease; + } else if (strcmp(it.only_arg, "Og") == 0) { + build_mode = BuildModeDebug; + } else { + for (size_t i = 0; i < it.other_args_len; i += 1) { + clang_argv.append(it.other_args_ptr[i]); + } + } + break; + case Stage2ClangArgDebug: + strip = false; + if (strcmp(it.only_arg, "-g") == 0) { + // we handled with strip = false above + } else { + for (size_t i = 0; i < it.other_args_len; i += 1) { + clang_argv.append(it.other_args_ptr[i]); + } + } + break; + case Stage2ClangArgSanitize: + if (strcmp(it.only_arg, "undefined") == 0) { + want_sanitize_c = WantCSanitizeEnabled; + } else { + for (size_t i = 0; i < it.other_args_len; i += 1) { + clang_argv.append(it.other_args_ptr[i]); + } + } + break; } } // Parse linker args @@ -715,6 +752,10 @@ static int main0(int argc, char **argv) { } } + if (want_sanitize_c == WantCSanitizeEnabled && build_mode == BuildModeFastRelease) { + build_mode = BuildModeSafeRelease; + } + if (!nostdlib && !have_libc) { have_libc = true; link_libs.append("c"); diff --git a/src/stage2.h b/src/stage2.h index 15c4c604cd..a66163eceb 100644 --- a/src/stage2.h +++ b/src/stage2.h @@ -334,6 +334,9 @@ enum Stage2ClangArg { Stage2ClangArgRDynamic, Stage2ClangArgWL, Stage2ClangArgPreprocess, + Stage2ClangArgOptimize, + Stage2ClangArgDebug, + Stage2ClangArgSanitize, }; // ABI warning diff --git a/tools/update_clang_options.zig b/tools/update_clang_options.zig index ccd4443130..f65c89c258 100644 --- a/tools/update_clang_options.zig +++ b/tools/update_clang_options.zig @@ -90,6 +90,62 @@ const known_options = [_]KnownOpt{ .name = "assemble", .ident = "driver_punt", }, + .{ + .name = "O1", + .ident = "optimize", + }, + .{ + .name = "O2", + .ident = "optimize", + }, + .{ + .name = "Og", + .ident = "optimize", + }, + .{ + .name = "O", + .ident = "optimize", + }, + .{ + .name = "Ofast", + .ident = "optimize", + }, + .{ + .name = "optimize", + .ident = "optimize", + }, + .{ + .name = "g", + .ident = "debug", + }, + .{ + .name = "debug", + .ident = "debug", + }, + .{ + .name = "g-dwarf", + .ident = "debug", + }, + .{ + .name = "g-dwarf-2", + .ident = "debug", + }, + .{ + .name = "g-dwarf-3", + .ident = "debug", + }, + .{ + .name = "g-dwarf-4", + .ident = "debug", + }, + .{ + .name = "g-dwarf-5", + .ident = "debug", + }, + .{ + .name = "fsanitize", + .ident = "sanitize", + }, }; const blacklisted_options = [_][]const u8{};