-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Index] Avoid forming relations to non-indexed decls #72930
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
863ed6e
to
1d96cdc
Compare
lib/Index/Index.cpp
Outdated
|
||
if (!Entry.ActiveKey) | ||
return; | ||
SmallVector<const Decl *, 4> Containers; |
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.
Could have a bool for whether we actually allowed any decls or not and then just use f(D)
in the two if's, but if you prefer this I'd move the Containers
out of the loop.
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.
Sure, don't feel too strongly, switched to using a bool
Check to see whether we can index the given decl before reporting it as a container, walking up to a parent if we need to. This also lets us simplify the AnyPattern handling a bit. rdar://126137541
If we shouldn't index the related decl, don't record it as a relation.
1d96cdc
to
b65d8c2
Compare
@swift-ci please test |
With swiftlang/swift#72930 we can use the `containedBy` instead of `calledBy` relation for the call hierarchy, which allows us to show unapplied function references in the call hierarchy as well. rdar://123769825
With swiftlang/swift#72930 we can use the `containedBy` instead of `calledBy` relation for the call hierarchy, which allows us to show unapplied function references in the call hierarchy as well. rdar://123769825
With swiftlang/swift#72930 we can use the `containedBy` instead of `calledBy` relation for the call hierarchy, which allows us to show unapplied function references in the call hierarchy as well. rdar://123769825
With swiftlang/swift#72930 we can use the `containedBy` instead of `calledBy` relation for the call hierarchy, which allows us to show unapplied function references in the call hierarchy as well. rdar://123769825
Make sure to check whether we are able to index a decl before reporting it as a relation. Additionally for containers, walk up the stack to find the first container that we can index, avoiding treating local variables as containers when we're not indexing them.
rdar://126137541