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:
@@ -1663,7 +1663,7 @@ void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface(
|
||||
FrontendOptions::ActionType requestedAction,
|
||||
const SearchPathOptions &SearchPathOpts, const LangOptions &LangOpts,
|
||||
const ClangImporterOptions &clangImporterOpts, const CASOptions &casOpts,
|
||||
bool suppressRemarks) {
|
||||
bool suppressNotes, bool suppressRemarks) {
|
||||
GenericArgs.push_back("-frontend");
|
||||
// Start with a genericSubInvocation that copies various state from our
|
||||
// invoking ASTContext.
|
||||
@@ -1752,6 +1752,12 @@ void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface(
|
||||
genericSubInvocation.getDiagnosticOptions().SuppressWarnings = true;
|
||||
GenericArgs.push_back("-suppress-warnings");
|
||||
|
||||
// Inherit the parent invocation's setting on whether to suppress remarks
|
||||
if (suppressNotes) {
|
||||
genericSubInvocation.getDiagnosticOptions().SuppressNotes = true;
|
||||
GenericArgs.push_back("-suppress-notes");
|
||||
}
|
||||
|
||||
// Inherit the parent invocation's setting on whether to suppress remarks
|
||||
if (suppressRemarks) {
|
||||
genericSubInvocation.getDiagnosticOptions().SuppressRemarks = true;
|
||||
@@ -1863,6 +1869,7 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
|
||||
genericSubInvocation.setMainExecutablePath(LoaderOpts.mainExecutablePath);
|
||||
inheritOptionsForBuildingInterface(LoaderOpts.requestedAction, searchPathOpts,
|
||||
langOpts, clangImporterOpts, casOpts,
|
||||
Diags->getSuppressNotes(),
|
||||
Diags->getSuppressRemarks());
|
||||
// Configure front-end input.
|
||||
auto &SubFEOpts = genericSubInvocation.getFrontendOptions();
|
||||
|
||||
Reference in New Issue
Block a user