-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Overlay: Add manual Java overlay annotations & discard predicates #19813
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
base: main
Are you sure you want to change the base?
Conversation
6f5bc41
to
8672313
Compare
8672313
to
db52a3c
Compare
db52a3c
to
26896ea
Compare
bdf1bdd
to
3c2c871
Compare
052023e
to
81b677a
Compare
3c2c871
to
0ee6a78
Compare
The |
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'm happy with this if @aschackmull is happy
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 we can simplify the boilerplate somewhat.
54589c8
to
bcadf31
Compare
bcadf31
to
a9f1540
Compare
a9f1540
to
64f27e2
Compare
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.
LGTM
The base branch was changed.
@@ -221,3 +222,16 @@ | |||
not hasSourceLocation(l, _, _) and | |||
locations_default(loc, f, _, _, _, _) | |||
} | |||
|
|||
overlay[local] | |||
private predicate discardableLocation(string file, @location l) { |
Check warning
Code scanning / CodeQL
Dead code Warning
|
||
/** Discard base locations in files fully extracted in the overlay. */ | ||
overlay[discard_entity] | ||
private predicate discardLocation(@location l) { |
Check warning
Code scanning / CodeQL
Dead code Warning
/** | ||
* A local predicate that always holds for the overlay variant and | ||
* never holds for the base variant. This is used to define local | ||
* predicates that behave differently for the base and overlay variant. | ||
*/ |
Check warning
Code scanning / CodeQL
Predicate QLDoc style. Warning
} | ||
|
||
overlay[discard_entity] | ||
private predicate discardLocatable(@locatable el) { |
Check warning
Code scanning / CodeQL
Dead code Warning
} | ||
|
||
overlay[discard_entity] | ||
private predicate discardReferableLocatable(@locatable el) { |
Check warning
Code scanning / CodeQL
Dead code Warning
This PR builds on top of #19779, adding a few additional manual overlay annotations and defining entity discard predicates for Java.
The
overlay[local?]
annotations in the experimental queries are needed to ensure that virtual dispatch (which depends indirectly onActiveExperimentalModels
) becomes local. In addition to the manualoverlay[local?]
annotations, the PR adds anoverlay[global]
annotation inDataFlowImplCommon.qll
to ensure lambda flow is global.The entity discard predicates defined in this PR are not exhaustive and additional discarding may be needed. The PR adds entity discard predicates to discard the following: