Skip to content

Conversation

@redsun82
Copy link
Contributor

For consistency with the C/C++ QL library, getters of AST elements within the hidden AST should not themselves skip other hidden AST elements.

For consistency with the C/C++ QL library, getters of AST elements
within the hidden AST should not themselves skip other hidden AST
elements.
@redsun82 redsun82 requested review from MathiasVP and d10c May 22, 2023 08:01
@redsun82 redsun82 requested a review from a team as a code owner May 22, 2023 08:01
@github-actions github-actions bot added the Swift label May 22, 2023
Copy link
Contributor

@geoffw0 geoffw0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of things I'd like to discuss.

Definitely want to see a DCA run to be confident there are no unintended consequences here.

exists(AvailabilitySpec immediate |
immediate = this.getImmediateSpec(index) and
if exists(this.getResolveStep()) then result = immediate else result = immediate.resolve()
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This additional and not-quite-trivial QL is repeated many, many times in the diff. I suppose at code generation time we don't know whether this.getResolveStep() will exist or not, so we can't just generate one or the other case. Still, I wonder if there's a way we can simplify / take out any common code here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think one way to limit that is the other thing I propose doing, that is limit this kind of machinery to when the return type of the getter is an Expr or a Pattern. But not something to be tackled in this PR I think.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

As long as the DCA run looks good performance-wise, I'm OK that we wait for that.

Copy link
Contributor

@d10c d10c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I'm in favour of merging this before the release, and then changing the modifiers separately. Can we still do a DCA run first?

@redsun82
Copy link
Contributor Author

DCA looks good 👍

@redsun82 redsun82 merged commit f56ffbc into main May 22, 2023
@redsun82 redsun82 deleted the redsun82/swift-hidden-ast branch May 22, 2023 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants