Skip to content

[ASTDumper] Avoid parsing decl members #74409

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
Jun 14, 2024

Conversation

hamishknight
Copy link
Contributor

Previously we would call getMembers, which could kick delayed member parsing. Instead, propagate a parseIfNeeded flag through the ASTDumper logic, and use it to determine whether to parse a SourceFile, type/extension body, or function body. This is needed for things like -dump-parse which expects to dump the entire AST tree.

The body range may be valid; change `getStartLoc`
to fall back to the body's start loc to match
`getEndLoc`.
Previously we would call `getMembers`, which could
kick delayed member parsing. Instead, propagate a
`parseIfNeeded` flag through the ASTDumper logic,
and use it to determine whether to parse a
SourceFile, type/extension body, or function body.
This is needed for things like `-dump-parse` which
expects to dump the entire AST tree.
@hamishknight hamishknight force-pushed the no-member-parsing-in-dump branch from f4e25cf to a8c7261 Compare June 14, 2024 09:54
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight hamishknight merged commit 51205ad into swiftlang:main Jun 14, 2024
5 checks passed
@hamishknight hamishknight deleted the no-member-parsing-in-dump branch June 14, 2024 20:35
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