-
Notifications
You must be signed in to change notification settings - Fork 1.7k
C++: resolveElement #7
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
JavaScript: Fix `ArgumentsRedefined` to do what its name says.
|
||
cached @element underlyingElement(Element e) { | ||
result = e | ||
} |
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.
Please add QLDoc to these four predicates to explain how they are supposed to be used. New code might easily get these calls wrong, especially if we don't all understand how to use them. In particular, how do I choose between using unresolveElement
and underlyingElement
?
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.
Done
if isClass(e) | ||
then result = resolve(e) | ||
else result = e | ||
} |
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.
If this predicate is only for use in this file, shouldn't we make it private?
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.
Done
|
||
cached @element underlyingElement(Element e) { | ||
result = e | ||
} |
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.
Why make all four predicates cached
? Do they compute more than they seem to because of the casts between @element
and Element
? At least unresolveElement
wouldn't have to be cached if it were defined in terms of mkElement
, right?
I don't know how the optimizer turns these cached
annotations into stages, but I'm guessing it will create a stage per predicate here. We can prevent that by grouping the predicates into a cached private module
and importing that.
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 did some experiments, and found that performance drop is none are cached, but only resolveElement
needs to be cached.
76a4660
to
0e16df6
Compare
For example, if you have 3 types called T, where t1 and t2 are defined but t3 isn't, then you will have unspecifiedtype(t1, t1) unspecifiedtype(t2, t2) unspecifiedtype(t3, t3) t1 = resolve(t1) t1 = resolve(t3) t2 = resolve(t2) t2 = resolve(t3) so given Type getUnspecifiedType() { unspecifiedtype(unresolve(this), unresolve(result)) } you get t1.getUnspecifiedType() = t2. I think that in general the best thing to do is to not unresolve 'this', but to just take the underlying value.
e80089c
to
99dbbdf
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 apart from a typo. There's of course no need to advance the submodule when fixing the typo, so the PR in the internal repo can be merged as is.
* Get the `@element` that this `Element` extends. This should normally | ||
* only be called from member predicates, where `e` is `this` and you | ||
* need the result for an argument to a database extensional. | ||
* See `unresolveElement` for when `e` is `this`. |
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.
Missing "not" in the last sentence.
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 going to merge this without the typo fix so we don't risk getting another submodule conflict.
Refactor dbscheme generator to use intermediate representation
Extract type variable references
lecture notes for oauth2 proxy workshop
New features: Shipping model. 9 new features, remove the old ones that have been replaced by new ones. The codeql PR has been rebased on top of main. #7 (with a fixed package version) https://ml.azure.com/runs/classification_1663364335_afeafbe1?wsid=/subscriptions/91095667-e119-4555-acea-1826488492f0/resourcegroups/ATM-CodeML/workspaces/ATM-Workspace&tid=398a6654-997b-47e9-b12b-9515b896b4de
New features: Shipping model. 9 new features, remove the old ones that have been replaced by new ones. The codeql PR has been rebased on top of main. #7 (with a fixed package version) https://ml.azure.com/runs/classification_1663364335_afeafbe1?wsid=/subscriptions/91095667-e119-4555-acea-1826488492f0/resourcegroups/ATM-CodeML/workspaces/ATM-Workspace&tid=398a6654-997b-47e9-b12b-9515b896b4de
Better handling of input and output expressions
Fix incorrect source for dorny path filters
This should make it easier to experiment with ideas such as linker awareness in QL.