-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Parser: allow on-demand member decl parsing for other nominal types. #19260
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
Conversation
@swift-ci please smoke test |
The lexer diagnostics have already been emitted during token skipping.
8a28fec
to
e0c1fea
Compare
@swift-ci please smoke test |
Can you add -parse to scale_test and write some tests for this as we discussed? |
@slavapestov sure, I'm looking into that. |
@@ -186,7 +186,9 @@ void PersistentParserState::parseMembers(IterableDeclContext *IDC) { | |||
SourceFile &SF = *IDC->getDecl()->getDeclContext()->getParentSourceFile(); | |||
assert(!SF.hasInterfaceHash() && | |||
"Cannot delay parsing if we care about the interface hash."); | |||
assert(SF.Kind != SourceFileKind::SIL && "cannot delay parsing SIL"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to have a way to keep SILParserState
around till delayed parsing, which requires non-trivial work. I don't think there're fundamental blockers there, just we need to keep track more stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, fair enough. Can you add a comment somewhere to that effect? We don’t care about SIL parsing performance much anyway, I was just curious.
@swift-ci please smoke test |
@swift-ci please test |
Build failed |
Build failed |
8cdfddc
to
c0d52fd
Compare
b232e91
to
3f03202
Compare
@swift-ci please smoke test |
@slavapestov I've added a scale test. It passes when delayed body parsing is enabled and fails when it's not. |
@swift-ci please test |
Build failed |
Build failed |
… tree or verifying parse diagnostics.
@swift-ci please smoke test |
@swift-ci please test |
@swift-ci Please Test Source Compatibility |
Build failed |
Build failed |
All tests passed. Merging |
@nkcsgexi This seems to have broken a lldb test that runs only in the full run. Mind if we take a look together? |
Trying to get a reduced testcase. |
@dcci Thanks for working on a reduced test case! I think we specifically disabled delayed parsing for REPL input here: https://github.com/apple/swift/blob/master/lib/Parse/ParseDecl.cpp#L3372. |
This doesn't reproduce on the REPL from the cmdline, it could be a bug in the SBAPI.
|
This test is in test/testcases/repl/subclassing/TestREPLSubclassing.py. It doesn't run because we pass --test-subdir lang/swift to dotest. I'll move it. |
(Well, I'll set up a PR to move it; done correctly, it won't pass smoke testing until we fix the underlying issue here.) |
@vedantk thanks for the explanation! |
No description provided.