Commit e3fec6cce9

Andrew Kelley <andrew@ziglang.org>
2020-03-26 00:32:12
zig cc: add detection for `-###`
it turns on --verbose-cc and --verbose-link
1 parent 9dbfee4
src/main.cpp
@@ -708,6 +708,10 @@ static int main0(int argc, char **argv) {
                 case Stage2ClangArgLinkerScript:
                     linker_script = it.only_arg;
                     break;
+                case Stage2ClangArgVerboseCmds:
+                    verbose_cc = true;
+                    verbose_link = true;
+                    break;
             }
         }
         // Parse linker args
src/stage2.h
@@ -341,6 +341,7 @@ enum Stage2ClangArg {
     Stage2ClangArgDebug,
     Stage2ClangArgSanitize,
     Stage2ClangArgLinkerScript,
+    Stage2ClangArgVerboseCmds,
 };
 
 // ABI warning
src-self-hosted/clang_options_data.zig
@@ -96,7 +96,14 @@ sepd1("Zlinker-input"),
     .pd2 = true,
     .psl = false,
 },
-flagpd1("###"),
+.{
+    .name = "###",
+    .syntax = .flag,
+    .zig_equivalent = .verbose_cmds,
+    .pd1 = true,
+    .pd2 = false,
+    .psl = false,
+},
 .{
     .name = "Brepro",
     .syntax = .flag,
src-self-hosted/stage2.zig
@@ -1279,6 +1279,7 @@ pub const ClangArgIterator = extern struct {
         debug,
         sanitize,
         linker_script,
+        verbose_cmds,
     };
 
     fn init(argv: []const [*:0]const u8) ClangArgIterator {
tools/update_clang_options.zig
@@ -150,6 +150,10 @@ const known_options = [_]KnownOpt{
         .name = "T",
         .ident = "linker_script",
     },
+    .{
+        .name = "###",
+        .ident = "verbose_cmds",
+    },
 };
 
 const blacklisted_options = [_][]const u8{};