Skip to content

[DebugInfo][SIL] Introduce the 'implicit' attribute for debug variable #38735

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
Aug 6, 2021

Conversation

mshockwave
Copy link
Contributor

@mshockwave mshockwave commented Aug 3, 2021

Debug variables that are marked 'implicit' on its debug_value instruction mean that they were generated by compiler. Optimizers are free to remove them (if it becomes a dead code, for instance) even in -Onone. Since they are barely used by users and keeping them might lead to incorrect IRGen results.

NOTE: This PR is only for code review. It depends on and includes #38734 . DO NOT MERGE. Please merge #38736 instead when everything is done.

@mshockwave
Copy link
Contributor Author

@swift-ci please test

The `alloc_stack` instruction now can carry advanced debug info like
source-variable-specific SIL location, type, and SIL DIExpression.
Debug variables that are marked 'implicit' on its `debug_value`
instruction mean that they were generated by compiler. Optimizers are
free to remove them (if it becomes a dead code, for instance) even in
-Onone. Since they are barely used by users and keeping them might lead
to incorrect IRGen results.
@mshockwave mshockwave force-pushed the dev-sil-debug-value-implicit branch from 4534b1a to e63632f Compare August 4, 2021 22:13
@mshockwave
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Aug 5, 2021

Build failed
Swift Test Linux Platform
Git Sha - e63632f

Copy link
Contributor

@adrian-prantl adrian-prantl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now. Can you add a test (in a separate PR) that tests what happens when we exceed name_length?

@mshockwave mshockwave merged commit e63632f into swiftlang:main Aug 6, 2021
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.

3 participants