-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Go: Make the models-as-data subtypes column do something more sensible for promoted methods #17618
Go: Make the models-as-data subtypes column do something more sensible for promoted methods #17618
Conversation
32631e2
to
7b99389
Compare
042346c
to
963ba98
Compare
963ba98
to
da5268d
Compare
@smowton Do you think the performance of
|
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.
Code changes otherwise lgtm if performance is good. Haven't reviewed test changes.
5ce8902
to
d17329d
Compare
I ran QA on 5213 go repos. There were two lost alerts. One is due to a model which has subtypes set to false - I will fix this in a follow-up PR setting subtypes = true for all models. The second is due to a bug in our logic about promoted fields and methods of struct types. The underlying problem is that we only consider promoted fields and methods if their embedded parent has a name which doesn't clash with a direct field of the struct type. So if struct type However, there are some performances issues that I think need to be dealt with. |
@smowton Any ideas for how to deal with this bad join order on
|
It's the How about we try that call-target -> result mapping happening last? Currently you have bindingset[sse, qual]
pragma[inline_late]
private predicate elementAppliesToQualifier(SourceOrSinkElement sse, DataFlow::Node qual) { which implies that we want to constrain both Note that messing with bindingset will likely do the trick for the |
@smowton After much work I managed to get the join order you recommended. Repos like |
I have run QA and the alert changes are fine and there are no noticeable performance changes. This PR is ready to be reviewed. |
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.
Also wants a change note. Otherwise LGTM.
* qualifier `qual`. | ||
* | ||
* Note that naively checking `e`'s qualified name is not correct, because | ||
* `Method`s and `Field`s may have multiple qualified names due to embedding. |
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.
I think I was wrong about this -- I think it's only Methods that can have multiple qnames like this, and field embedding is represented more explicitly
* `Method`s and `Field`s may have multiple qualified names due to embedding. | |
* `Method`s may have multiple qualified names due to embedding. |
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.
I looked into it and actually it is true for fields as well. In our code this is clear because Field.hasQualifiedName calls Type.getField, whose qldoc says "This includes fields promoted from an embedded field."
This improves performance.
This improves performance.
This is needed for performance when there are lots of embeddings.
3f4c6ba
to
fd4a6d4
Compare
I had to rebase because #17941 was merged. The only merge conflicts were removing the workaround for the bug that that PR fixed (which was to mention |
This is feature-complete now, I think. I don't think it needs a change note as models-as-data isn't a feature that we've publicly announced yet.