Skip to content

[IDE][DocSupport] Fix DocInfo missing decls when generated for clang submodules #31589

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

Conversation

nathawes
Copy link
Contributor

@nathawes nathawes commented May 6, 2020

Our handling of clang submodules was different between DocInfo and InterfaceGen. For InterfaceGen submodules were mapped back to their top-level clang modules (or their Swift overlay if it had one) before being passed into printSubmoduleInterface, along with the dot separated name of the submodule.

For DocInfo, they were not, and only the rightmost component of their name was passed. The call to retrieve the decls from a ModuleDecl doesn't work if the ModuleDecl wraps a clang submodule, so we were missing these decls.

InterfaceGen for submodules also shouldn't have been mapping it back to the Swift overlay of its top-level clang module, as that meant we ended up printing import decls from the Swift overlay in the submodule's interface. It should have stopped at the top-level clang module.

This change makes them both (and swift-ide-test) just pass in the submodule ModuleDecl directly without mapping it, and maps it within printSubmoduleInterface (now unified with printModuleInterface since it handles both) where appropriate.

Resolves rdar://problem/57338105

…submodules.

Out handling of clang submodules was handled differently between DocInfo and
InterfaceGen. For InterfaceGen submodules were mapped back to their top-level
clang modules (or their Swift overlay if it had one) before being passed
into printSubmoduleInterface, along with the dot separated name of the submodule.

For DocInfo, they were not, and only the rightmost component of their name was
passed. The call to retrieve the decls from a ModuleDecl doesn't work if the
ModuleDecl wraps a clang submodule, so we were missing these decls.

InterfaceGen for submodules also shouldn't have been mapping the module back to
the overlay of top-level clang module, as that meant we ended up printing
import decls from the Swift overlay in the submodule's interface.

Resolves rdar://problem/57338105
@nathawes nathawes requested a review from rintaro May 6, 2020 16:59
@nathawes
Copy link
Contributor Author

nathawes commented May 6, 2020

@swift-ci please test

@nathawes nathawes requested a review from akyrtzi May 6, 2020 17:23
@nathawes nathawes merged commit 709dd35 into swiftlang:master May 6, 2020
@nathawes nathawes deleted the doc-info-missing-submodule-decls branch May 6, 2020 19:41
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