Skip to content

[4.1] [ClangImporter] Handle submodule imports in bridging headers #14500

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

Conversation

jrose-apple
Copy link
Contributor

  • Explanation: If a bridging header imported a submodule but not the top-level module, the top-level module would never be made visible. This is a problem since the Clang importer makes all top-level decls available through their enclosing top-level modules, not the individual submodules. To fix this, handle imports found in bridging headers the same way as transitive imports found in regular Clang modules.
  • Scope: Affects all modular headers imported through bridging headers.
  • Issue: rdar://problem/37355259
  • Reviewed by: @graydon
  • Risk: Medium-low. This should act as a net removal of code, but it's definitely treating some things differently than they were before.
  • Testing: Added compiler regression tests, verified that the original project builds

If a bridging header imported a submodule but /not/ the top-level
module, the top-level module would never be made visible. This is a
problem since the Clang importer makes all top-level decls available
through their enclosing top-level modules, not the individual
submodules.

To fix this, stop special-casing the way we handle bridging header
imports; we can translate them from Clang Modules to Swift ModuleDecls
the same way we do for regular imports.

rdar://problem/37355259
(cherry picked from commit 6754cc6)
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test source compatibility

@jrose-apple jrose-apple merged commit ef59c7b into swiftlang:swift-4.1-branch Feb 9, 2018
@jrose-apple jrose-apple deleted the 4.1-bridge-over-troubled-modules branch February 9, 2018 03:31
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.

1 participant