Skip to content

SILDebugScopes: Don't ignore ConditionalClauseInitializerScope. #66692

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 3 commits into from
Jun 17, 2023

Conversation

adrian-prantl
Copy link
Contributor

@adrian-prantl adrian-prantl commented Jun 16, 2023

ConditionalClauseInitializerScope often create redundant scopes, however, they are needed to correctly represent the scopes in an expression such as:

if case .something(let foo), let foo = foo.

This patch changes SILGen to lower them 1:1 from ASTScopes.

Compute VarDeclScopeMap up front.
The previous lazy discovery did not always work because sometimes a debug_value
is emitted before the first SIL instruction in the variable's scope.

rdar://110841130

@adrian-prantl
Copy link
Contributor Author

@swift-ci test and merge

ConditionalClauseInitializerScope often create redundant scopes, however, they
are needed to correctly represent the scopes in an expression such as:

  if case .something(let foo), let foo = foo.

This patch changes SILGen to lower them 1:1 from ASTScopes.

rdar://110841130
The previous lazy discovery did not always work because sometimes a debug_value
is emitted before the first SIL instruction in the variable's scope.

rdar://110841130
@adrian-prantl
Copy link
Contributor Author

@swift-ci test

@adrian-prantl
Copy link
Contributor Author

@swift-ci test

@adrian-prantl adrian-prantl merged commit c2f164d into swiftlang:main Jun 17, 2023
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