-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SILGen] Add flag to skip typechecking and SIL gen for all function bodies #34489
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
[SILGen] Add flag to skip typechecking and SIL gen for all function bodies #34489
Conversation
@swift-ci please test |
Build failed |
I think these days we don't have a flag for delayed parsing anymore, we just always lazily parse function bodies in non-primary files the first time you call AbstractFunctionDecl::getBody(). So if nothing asks for the body of a function it won't be parsed. |
The test seems to only focus on checking SIL generation but there doesn't seem to be a test to check that typechecking is really avoided. |
Sorry, may not have been clear in my description there. By "another flag" I was mostly referring to eg. "-dump-parse", "-verify-syntax-tree", etc. Basically, all the conditions in The specific case I saw was the stdlib being built with "-verify-syntax-tree", which disables delayed parsing. Previous to noticing that I had actually changed |
Will do, thanks. |
ae785fc
to
a28ba39
Compare
@swift-ci please test |
Build failed |
a28ba39
to
0d5ac1e
Compare
@swift-ci please test |
Build failed |
0d5ac1e
to
75906c9
Compare
@swift-ci please test Linux platform |
Okay... well, I'm going to leave the getSourceRange change out for now. It was previously needed but isn't with the current changes, so it should have just been a small cleanup (apparently not though). The only case I could see it being different is when a Synthesized accessor has a start location, but when would that be the case? I'll collapse the two commits and re-run the tests. |
75906c9
to
b76b6f3
Compare
@swift-ci please smoke test |
@swift-ci please smoke test OS X platform |
b76b6f3
to
3598ceb
Compare
Going to wait for #34569 to be merged. I'll then rebase and add those new tests into the new combined file. |
3598ceb
to
de908d8
Compare
@swift-ci please test |
Adds a new flag "-experimental-skip-all-function-bodies" that skips typechecking and SIL generation for all function bodies (where possible). `didSet` functions are still typechecked and have SIL generated as their body is checked for the `oldValue` parameter, but are not serialized. Parsing will generally be skipped as well, but this isn't necessarily the case since other flags (eg. "-verify-syntax-tree") may force delayed parsing off.
de908d8
to
7cee600
Compare
@swift-ci please smoke test |
Forgot to run clang-format, but otherwise the same. |
Windows error is unrelated (compile error in llvm-project) and it had passed previous to the clang-format, so just going to merge. |
Adds a new flag "-experimental-skip-all-function-bodies" that skips SIL
generation entirely. Function bodies will not be type checked, but may
still be parsed if another flag forces delayed parsing off.