mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Diagnostics] Add -suppress-notes flag
We already have -suppress-warnings and -suppress-remarks; this patch adds support for suppressing notes too. Doing so is useful for -verify tests where we don't really care about the emitted notes.
This commit is contained in:
@@ -2652,6 +2652,7 @@ static bool ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
|
||||
}
|
||||
|
||||
Opts.SuppressWarnings |= Args.hasArg(OPT_suppress_warnings);
|
||||
Opts.SuppressNotes |= Args.hasArg(OPT_suppress_notes);
|
||||
Opts.SuppressRemarks |= Args.hasArg(OPT_suppress_remarks);
|
||||
for (const Arg *arg : Args.filtered(OPT_warning_treating_Group)) {
|
||||
Opts.WarningsAsErrorsRules.push_back([&] {
|
||||
@@ -2732,6 +2733,9 @@ static void configureDiagnosticEngine(
|
||||
if (Options.SuppressWarnings) {
|
||||
Diagnostics.setSuppressWarnings(true);
|
||||
}
|
||||
if (Options.SuppressNotes) {
|
||||
Diagnostics.setSuppressNotes(true);
|
||||
}
|
||||
if (Options.SuppressRemarks) {
|
||||
Diagnostics.setSuppressRemarks(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user