mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Improve LifetimeDependence.Scope for mutable trivial variables.
Recognize dependence on the address of a trivial 'var' as an "access" dependence instead of an "unknown" dependence. This allows the mark_dependence to be resolved as "[nonescaping]".
This commit is contained in:
@@ -394,6 +394,8 @@ extension LifetimeDependence.Scope {
|
||||
self = .borrowed(BeginBorrowValue(bbi)!)
|
||||
case is MoveValueInst:
|
||||
self = .owned(introducer)
|
||||
case let bai as BeginAccessInst:
|
||||
self = .access(bai)
|
||||
default:
|
||||
self = .unknown(introducer)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user