swift
82e566a2 - SILGen: Treat Optional `x!` force unwrapping as a forwarding operation.

Commit
1 year ago
SILGen: Treat Optional `x!` force unwrapping as a forwarding operation. Like `?` or property access, `x!` can be borrowing, consuming, or mutated through depending on the use site and the ownership of the base value. Alter SILGen to emit `x!` as a borrowing operation when the result is only used as a borrow. Fix the move-only checker not to treat the unreachable branch as a dead path for values and try to destroy the value unnecessarily and possibly out-of-order with cleanups on the value. Fixes rdar://127459955.
Author
Parents
Loading