-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SymbolGraph] add "memberOf" relations for remote protocol implementations #37278
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
rdar://75729692
@swift-ci Please smoke test |
@swift-ci Please build toolchain macOS platform |
macOS Toolchain Install command |
lib/SymbolGraphGen/SymbolGraph.cpp
Outdated
// If P is from a different module, and it's being added to a type | ||
// from the current module, add a `memberOf` relation to the extended | ||
// protocol. | ||
if (MemberVD->getModuleContext() != &M && VD->getDeclContext()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it safe to do a pointer comparison here? Can there be two different pointers to the same module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point. I'm not sure if it happens in practice, but it's reasonable that there may be two different instances of the same module information. I'll see about comparing some field(s) instead of the pointer itself.
Pushed a commit to compare module names instead of pointers. @swift-ci Please smoke test |
@swift-ci Please build toolchain macOS platform |
macOS tester failed with stale dependencies for SwiftPM. Trying again... @swift-ci Please smoke test macOS platform |
The toolchain build also failed in swift-driver incremental tests. Trying again... @swift-ci Please build toolchain macOS platform |
Merging before the toolchain is ready, since #37279 was able to be tested in its place. |
macOS Toolchain Install command |
Resolves rdar://75729692
When generating symbol graphs for a module that includes a default implementation for a protocol from another module, there's currently no way to relate the default implementation to the type or protocol in the current module. This PR adds an additional
memberOf
relation for these default implementations, that links them to the protocol or type in the current module that it's extending.