Skip to content

Conversation

@eeckstein
Copy link
Contributor

This is a follow-up of #84905, which handles non-copyable enums with a deinit correctly. Also, for copyable enums it's more efficient to use end_lifetime than destroy_value, because we already know that the enum contains a trivial case. Therefore no destroy operation is needed.

@eeckstein
Copy link
Contributor Author

@swift-ci smoke test

…tch_enum`

This is a follow-up of swiftlang#84905, which handles non-copyable enums with a deinit correctly.
Also, for copyable enums it's more efficient to use `end_lifetime` than `destroy_value`, because we already know that the enum contains a trivial case.
Therefore no destroy operation is needed.
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test

@eeckstein eeckstein requested a review from meg-gupta October 20, 2025 15:40
@meg-gupta
Copy link
Contributor

lgtm

@eeckstein
Copy link
Contributor Author

@swift-ci smoke test windows

@eeckstein eeckstein merged commit 28535a6 into swiftlang:main Oct 21, 2025
3 checks passed
@eeckstein eeckstein deleted the fix-simplify-cfg2 branch October 21, 2025 05:25
ktoso pushed a commit to ktoso/swift that referenced this pull request Oct 21, 2025
SimplifyCFG: insert compensating `end_lifetime` when replacing a `switch_enum`
ktoso pushed a commit to ktoso/swift that referenced this pull request Oct 21, 2025
SimplifyCFG: insert compensating `end_lifetime` when replacing a `switch_enum`
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