Skip to content

CrossModuleOptimization: fix crash when importing a module as implementationOnly #35472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 20, 2021

Conversation

eeckstein
Copy link
Contributor

@eeckstein eeckstein commented Jan 18, 2021

If a function uses a type imported as implementationOnly (or similar), it cannot be serialized.

I added a new API in ModuleDecl (canBeUsedForCrossModuleOptimization), which performs this check.

https://bugs.swift.org/browse/SR-14006
rdar://72864719

…ntationOnly

If a function uses a type imported as implementationOnly (or similar), it cannot be serialized.

I added a new API in ModuleDecl (canBeUsedForCrossModuleOptimization), which performs this check.

rdar://72864719
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test

ModuleDecl::ImportFilterKind::Exported,
ModuleDecl::ImportFilterKind::Default};
SmallVector<ImportedModule, 4> results;
getImportedModules(results, filter);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also include ModuleDecl::ImportFilterKind::SPIAccessControl here, in this context they are just normal imports that includes more things. I think ShadowedByCrossImportOverlay should be safe too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, thanks. I'll let it as it is for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants