zig cc: add detection for -###

it turns on --verbose-cc and --verbose-link
This commit is contained in:
Andrew Kelley 2020-03-25 19:32:12 -04:00
parent 9dbfee49d7
commit e3fec6cce9
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
5 changed files with 18 additions and 1 deletions

View File

@ -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,

View File

@ -1279,6 +1279,7 @@ pub const ClangArgIterator = extern struct {
debug,
sanitize,
linker_script,
verbose_cmds,
};
fn init(argv: []const [*:0]const u8) ClangArgIterator {

View File

@ -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

View File

@ -341,6 +341,7 @@ enum Stage2ClangArg {
Stage2ClangArgDebug,
Stage2ClangArgSanitize,
Stage2ClangArgLinkerScript,
Stage2ClangArgVerboseCmds,
};
// ABI warning

View File

@ -150,6 +150,10 @@ const known_options = [_]KnownOpt{
.name = "T",
.ident = "linker_script",
},
.{
.name = "###",
.ident = "verbose_cmds",
},
};
const blacklisted_options = [_][]const u8{};