Skip to content

Conversation

@meg-gupta
Copy link
Contributor

@meg-gupta meg-gupta commented Dec 12, 2025

This change fixes crashes in SILGenCleanup and EscapeUtils for borrow accessors.
Also a adds a diagnostic for borrow/mutate accessors in enums.

We don't have support for borrowing switch on Copyable types.
It is supported for ~Copyable types, but the return expression emission for borrow accessors is not yet implemented.
Diagnose instead of crashing the compiler.
@meg-gupta meg-gupta changed the title Miscborrowfixes Minor fixes to borrow accessors Dec 12, 2025
@meg-gupta
Copy link
Contributor Author

@swift-ci test

return %2
}

sil [ossa] @call_mutate_accessor : $@convention(thin) (@inout Wrapper, @owned Klass) -> () {
Copy link
Contributor

Choose a reason for hiding this comment

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

The CHECK lines are missing here.
(Note that the main test file for EscapeUtils is SILOptimizer/escape_info.sil. But testing the change here is also fine).

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