Skip to content

Optimize read accessors to just borrow yielded storage references #19790

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

Merged
merged 2 commits into from
Oct 9, 2018

Conversation

rjmccall
Copy link
Contributor

@rjmccall rjmccall commented Oct 9, 2018

No description provided.

@rjmccall
Copy link
Contributor Author

rjmccall commented Oct 9, 2018

@swift-ci Please test.

@harlanhaskins
Copy link
Contributor

Are yield lists comma separated? If so, you’ll probably need to add a production that includes an optional trailing comma, like the definition for TupleElement.

Also, can you add a round-trip test to test/Syntax/round_trip_parse_gen.swift?

@swift-ci
Copy link
Contributor

swift-ci commented Oct 9, 2018

Build failed
Swift Test OS X Platform
Git Sha - 96b59e9db59d3663aa50af95ee15653e64a87127

@rjmccall rjmccall force-pushed the read-optimizations branch from 96b59e9 to 6f1fd82 Compare October 9, 2018 19:38
@rjmccall
Copy link
Contributor Author

rjmccall commented Oct 9, 2018

@swift-ci Please test.

@rjmccall
Copy link
Contributor Author

rjmccall commented Oct 9, 2018

Are yield lists comma separated? If so, you’ll probably need to add a production that includes an optional trailing comma, like the definition for TupleElement.

The parser doesn't actually accept an optional trailing comma currently.

Also, can you add a round-trip test to test/Syntax/round_trip_parse_gen.swift?

Done.

@swift-ci
Copy link
Contributor

swift-ci commented Oct 9, 2018

Build failed
Swift Test Linux Platform
Git Sha - 96b59e9db59d3663aa50af95ee15653e64a87127

@swift-ci
Copy link
Contributor

swift-ci commented Oct 9, 2018

Build failed
Swift Test OS X Platform
Git Sha - 96b59e9db59d3663aa50af95ee15653e64a87127

if (!arg.isExpr()) return false;
auto argExpr = arg.peekExpr();
auto lvExpr = findStorageReferenceExprForBorrow(argExpr);
if (!lvExpr) return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

This whole check could be a method on ArgumentSource, then you don’t need to expose peekExpr().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point; I'll do a follow-up if this test run goes through.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rjmccall rjmccall merged commit 996e94d into swiftlang:master Oct 9, 2018
@rjmccall rjmccall deleted the read-optimizations branch October 9, 2018 23:38
rjmccall added a commit to rjmccall/swift that referenced this pull request Oct 10, 2018
modelorganism pushed a commit to modelorganism/swift that referenced this pull request Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants