Skip to content

Conversation

@aviralg
Copy link
Contributor

@aviralg aviralg commented Oct 8, 2025

In order to avoid issuing diagnostics for compiler-generated code, we ignore the syntax subtree rooted at an implicit node. This causes our algorithm to miss user code wrapped in implicit nodes generated during desugaring. For example, expressions in implicit returns from single-expression closures and trailing closures declarations are completely ignored by the performance analyzer right now.

This change fixes the problem by introducing a simple change to the AST walker. Instead of ignoring the entire implicit-node subtree, we only ignore the implicit node but continue to descend into its children. This enables our algorithm to access non-implicit (user code) nodes nested inside implicit (compiler-generated) nodes.

In order to avoid issuing diagnostics for compiler-generate code, we ignore the
syntax subtree rooted at an implicit node. This causes our algorithm to miss
user code wrapped in implicit nodes during desugaring. For example, expressions
in implicit returns from single-expression closures and trailing closures are
completely ignored right now.

This change fixes heproblem by introducing a simple change to the AST walker.
Instead of ignoring the entire implicit-node subtree, we only ignore the
implicit node but continue to descend into its children. This enables our
algorithm to access non-implicit (user code) nodes nested inside
implicit (compiler-generated) nodes.
@aviralg
Copy link
Contributor Author

aviralg commented Oct 8, 2025

@swift-ci test

@artemcm
Copy link
Contributor

artemcm commented Oct 8, 2025

@swift-ci smoke test

@artemcm artemcm enabled auto-merge October 8, 2025 17:28
@artemcm artemcm merged commit fe81779 into swiftlang:main Oct 8, 2025
3 checks passed
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.

2 participants