mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Frontend: Suppress some unsupported option warnings when verifying interfaces.
The following warnings get emitted every time we build the compiler libraries that are implemented in Swift: ``` <unknown>:0: warning: ignoring -allow-non-resilient-access (overriden by -compile-module-from-interface or -typecheck-module-from-interface) <unknown>:0: warning: ignoring -package-cmo (requires -allow-non-resilient-access) <unknown>:0: warning: ignoring -allow-non-resilient-access (overriden by -compile-module-from-interface or -typecheck-module-from-interface) <unknown>:0: warning: ignoring -package-cmo (requires -allow-non-resilient-access) ``` These warnings are generated because `-allow-non-resilient-access` and `-package-cmo` are being passed in with `-Xfrontend` and are therefore copied into the interface verification jobs, even though they don't apply. Suppress the warnings under these circumstances; they aren't going to help anyone understand a problem, so they're just spam. Resolves rdar://151616909.
This commit is contained in:
@@ -1455,10 +1455,11 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
if (Opts.AllowNonResilientAccess &&
|
||||
FrontendOptions::doesActionBuildModuleFromInterface(
|
||||
FrontendOpts.RequestedAction)) {
|
||||
Diags.diagnose(
|
||||
SourceLoc(), diag::warn_ignore_option_overriden_by,
|
||||
"-allow-non-resilient-access",
|
||||
"-compile-module-from-interface or -typecheck-module-from-interface");
|
||||
if (FrontendOpts.RequestedAction !=
|
||||
FrontendOptions::ActionType::TypecheckModuleFromInterface)
|
||||
Diags.diagnose(SourceLoc(), diag::warn_ignore_option_overriden_by,
|
||||
"-allow-non-resilient-access",
|
||||
"-compile-module-from-interface");
|
||||
Opts.AllowNonResilientAccess = false;
|
||||
}
|
||||
}
|
||||
@@ -2988,9 +2989,10 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
|
||||
Args.hasArg(OPT_PackageCMO) ||
|
||||
LangOpts.hasFeature(Feature::PackageCMO)) {
|
||||
if (!LangOpts.AllowNonResilientAccess) {
|
||||
Diags.diagnose(SourceLoc(), diag::ignoring_option_requires_option,
|
||||
"-package-cmo",
|
||||
"-allow-non-resilient-access");
|
||||
if (FEOpts.RequestedAction !=
|
||||
FrontendOptions::ActionType::TypecheckModuleFromInterface)
|
||||
Diags.diagnose(SourceLoc(), diag::ignoring_option_requires_option,
|
||||
"-package-cmo", "-allow-non-resilient-access");
|
||||
} else if (!FEOpts.EnableLibraryEvolution) {
|
||||
Diags.diagnose(SourceLoc(), diag::package_cmo_requires_library_evolution);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user