mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SILGen may produce a borrow accessor result from within a local borrow scope. Such as: ``` %ld = load_borrow %self %fwd = unchecked_ownership %ld %ex = struct_extract %fwd, #Struct.storedProperty end_borrow %ld return %ex ``` This is illegal OSSA, since the return uses a value outside it's borrow scope. Add a new SILGenCleanup transform, to turn this into valid OSSA: ``` %ld = load_borrow %self %ex = struct_extract %ld, #Struct.storedProperty return_borrow %ex from_scopes %ld ```
98 KiB
98 KiB