Skip to content

Refactor delayed member parsing and fix a bug #21879

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 9 commits into from
Jan 18, 2019

Conversation

slavapestov
Copy link
Contributor

There was a bad interaction between the old delayed function body parsing, and the new delayed member parsing that was added post-4.2.

When delayed member parsing parses a nominal type or extension body, it would create a new parser instance without delayed parsing callbacks. Since right now, nominal type bodies are parsed a lot more often than needed due to global operator lookup, this actually manifested as a regression because we were once again parsing function bodies in non-primary files.

Clean this up so that the delayed parsing callbacks are only used for code completion, with a new flag controlling skipping of function bodies, which is what we want in non-code completion, non-primary file frontend jobs.

Add a scale_test to ensure that delayed function body parsing is kicking in for methods defined inside types, not just top-level functions like the old test was testing.

@slavapestov slavapestov requested a review from nkcsgexi January 15, 2019 18:57
@slavapestov
Copy link
Contributor Author

@nkcsgexi There's still a bug I need to fix here and the 'test' patch will be squashed with the right commit. Other than that if you want to take a look please go ahead.

@slavapestov slavapestov force-pushed the fix-delayed-member-parsing branch from 446f5ad to 1c30353 Compare January 16, 2019 02:39
@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov
Copy link
Contributor Author

apple/swift-lldb#1230
@swift-ci Please smoke test

@slavapestov slavapestov merged commit 5cd7404 into swiftlang:master Jan 18, 2019
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.

1 participant