[Frontend] -validate-tbd-against-ir has 3 levels of validation.

It can now:

- not validate (=none)
- validate that all symbols in the IR are also in the TBD (=missing),
- validate the above, and also that all in the TBD are in the IR (=all).

The first and last were switched between with the old boolean flag, the
second is new.
This commit is contained in:
Huon Wilson
2017-05-19 18:33:11 -07:00
parent 8fbd6ace17
commit 40ba18615b
14 changed files with 65 additions and 28 deletions

View File

@@ -191,7 +191,20 @@ static bool ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
Opts.StatsOutputDir = A->getValue();
}
Opts.ValidateTBDAgainstIR |= Args.hasArg(OPT_validate_tbd_against_ir);
if (const Arg *A = Args.getLastArg(OPT_validate_tbd_against_ir_EQ)) {
using Mode = FrontendOptions::TBDValidationMode;
StringRef value = A->getValue();
if (value == "none") {
Opts.ValidateTBDAgainstIR = Mode::None;
} else if (value == "missing") {
Opts.ValidateTBDAgainstIR = Mode::MissingFromTBD;
} else if (value == "all") {
Opts.ValidateTBDAgainstIR = Mode::All;
} else {
Diags.diagnose(SourceLoc(), diag::error_unsupported_option_argument,
A->getOption().getPrefixedName(), value);
}
}
if (const Arg *A = Args.getLastArg(OPT_warn_long_function_bodies)) {
unsigned attempt;