mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add option to suppress emission of remarks ('-suppress-remarks')
And enforce it especially in downstream contexts such as building interfaces of SDK dependencies, where the remarks are not actionable by the user.
This commit is contained in:
@@ -1405,7 +1405,7 @@ void ModuleInterfaceLoader::collectVisibleTopLevelModuleNames(
|
||||
|
||||
void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface(
|
||||
const SearchPathOptions &SearchPathOpts, const LangOptions &LangOpts,
|
||||
RequireOSSAModules_t RequireOSSAModules) {
|
||||
bool suppressRemarks, RequireOSSAModules_t RequireOSSAModules) {
|
||||
GenericArgs.push_back("-frontend");
|
||||
// Start with a genericSubInvocation that copies various state from our
|
||||
// invoking ASTContext.
|
||||
@@ -1458,9 +1458,14 @@ void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface(
|
||||
}
|
||||
|
||||
// Inhibit warnings from the genericSubInvocation since we are assuming the user
|
||||
// is not in a position to fix them.
|
||||
// is not in a position to address them.
|
||||
genericSubInvocation.getDiagnosticOptions().SuppressWarnings = true;
|
||||
GenericArgs.push_back("-suppress-warnings");
|
||||
// Inherit the parent invocation's setting on whether to suppress remarks
|
||||
if (suppressRemarks) {
|
||||
genericSubInvocation.getDiagnosticOptions().SuppressRemarks = true;
|
||||
GenericArgs.push_back("-suppress-remarks");
|
||||
}
|
||||
|
||||
// Inherit this setting down so that it can affect error diagnostics (mostly
|
||||
// by making them non-fatal).
|
||||
@@ -1538,6 +1543,7 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
|
||||
: SM(SM), Diags(Diags), ArgSaver(Allocator) {
|
||||
genericSubInvocation.setMainExecutablePath(LoaderOpts.mainExecutablePath);
|
||||
inheritOptionsForBuildingInterface(searchPathOpts, langOpts,
|
||||
Diags->getSuppressRemarks(),
|
||||
requireOSSAModules);
|
||||
// Configure front-end input.
|
||||
auto &SubFEOpts = genericSubInvocation.getFrontendOptions();
|
||||
|
||||
Reference in New Issue
Block a user