mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Ignore bad @_hasStorage in module interfaces
An objcImpl bug previously caused `@_hasStorage` to be emitted inside some extensions in module interfaces. An earlier commit in this PR created an error for this, but for backwards compatibility, it would actually be better to simply ignore the attribute in module interfaces. Modify TypeCheckStorage to emit a warning, not an error, in this situation. Additionally, modify the module interface loader to show warnings when you verify a module interface, but not for other module interface uses (like compiling or importing one). The assumption here is that if you’re verifying a module interface, you’re either the author of the module that created it or you’re investigating a problem with it, and in either case you’d like to be told about minor defects in case they’re related. Fixes rdar://144811653 thoroughly.
This commit is contained in:
@@ -1654,6 +1654,7 @@ void ModuleInterfaceLoader::collectVisibleTopLevelModuleNames(
|
||||
}
|
||||
|
||||
void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface(
|
||||
FrontendOptions::ActionType requestedAction,
|
||||
const SearchPathOptions &SearchPathOpts, const LangOptions &LangOpts,
|
||||
const ClangImporterOptions &clangImporterOpts, const CASOptions &casOpts,
|
||||
bool suppressRemarks, RequireOSSAModules_t RequireOSSAModules) {
|
||||
@@ -1741,9 +1742,12 @@ void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface(
|
||||
}
|
||||
|
||||
// Inhibit warnings from the genericSubInvocation since we are assuming the user
|
||||
// is not in a position to address them.
|
||||
genericSubInvocation.getDiagnosticOptions().SuppressWarnings = true;
|
||||
GenericArgs.push_back("-suppress-warnings");
|
||||
// is not in a position to address them. (Unless we're verifying, in which
|
||||
// case they might.)
|
||||
if (requestedAction != FrontendOptions::ActionType::Typecheck) {
|
||||
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;
|
||||
@@ -1871,8 +1875,8 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
|
||||
RequireOSSAModules_t requireOSSAModules)
|
||||
: SM(SM), Diags(Diags), ArgSaver(Allocator) {
|
||||
genericSubInvocation.setMainExecutablePath(LoaderOpts.mainExecutablePath);
|
||||
inheritOptionsForBuildingInterface(searchPathOpts, langOpts,
|
||||
clangImporterOpts, casOpts,
|
||||
inheritOptionsForBuildingInterface(LoaderOpts.requestedAction, searchPathOpts,
|
||||
langOpts, clangImporterOpts, casOpts,
|
||||
Diags->getSuppressRemarks(),
|
||||
requireOSSAModules);
|
||||
// Configure front-end input.
|
||||
|
||||
Reference in New Issue
Block a user