-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add a request to lazily parse function bodies. #26972
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
Add a request to lazily parse function bodies. #26972
Conversation
Rework the lazy function body parsing mechanism to use the request-evaluator, so that asking for the body of a function will initiate parsing. Clean up a number of callers to AbstractFunctionDecl::getBody() that don't actually need the body, so we don't perform unnecessary parsing. This change does not delay parsing of function bodies in the general case; rather, it sets up the infrastructure to always delay parsing of function bodies.
@swift-ci please smoke test |
@swift-ci please test source compatibility |
The recent lazy parsing of IterableTypeContexts PR turned out to break lazy ASTScopes because the MemberCount is zero, until getMembers has been called. I've worked around it. Let me know if I need to do something similar for this PR. I.e. if getBody() will return null until some other call is made, I'll need to adjust ASTScopes. |
@davidungar with this pull request, |
Hi @DougGregor – How is this supposed to build? Are the "stable" branches of llvm and clang no longer the right branches to use with swift's "master" branch?
|
I reverted this PR because we are seeing this compiler error on all CI bots. |
If you click on the list of commits, you’ll see a red X which means that the status checks didn’t all pass. I’d wager that Doug didn’t notice and merged it anyway |
The Linux failure was not related to that. What happened here is that I ran the tests earlier in the day, and they passed (as they should). https://github.com/apple/swift/pull/26888/files#diff-363ae01084185dad84858de454e6bc95 got merged after my tests ran, but before my merge, and removed the API in question ( |
#26981 is the redo |
Rework the lazy function body parsing mechanism to use the
request-evaluator, so that asking for the body of a function will
initiate parsing. Clean up a number of callers to
AbstractFunctionDecl::getBody() that don't actually need the body, so
we don't perform unnecessary parsing.
This change does not delay parsing of function bodies in the general
case; rather, it sets up the infrastructure to always delay parsing of
function bodies.