Add a -sil-opt-pass-count frontend flag.

Until our SIL printing and parsing is robust enough to round-trip, this is useful for bisecting optimizer issues.

Swift SVN r14061
This commit is contained in:
Joe Groff
2014-02-18 23:37:25 +00:00
parent 3e0c1cebcf
commit c0a0a8b584
5 changed files with 32 additions and 5 deletions

View File

@@ -618,7 +618,14 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
return true;
}
}
if (const Arg *A = Args.getLastArg(OPT_sil_opt_pass_count)) {
if (StringRef(A->getValue()).getAsInteger(10, Opts.NumOptPassesToRun)) {
Diags.diagnose(SourceLoc(), diag::error_invalid_arg_value,
A->getAsString(Args), A->getValue());
return true;
}
}
if (const Arg *A = Args.getLastArg(OPT_disable_sil_linking,
OPT_sil_link_all)) {
if (A->getOption().matches(OPT_disable_sil_linking))