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:
Andrew Trick
2025-01-07 17:04:24 -08:00
parent 49136f237f
commit 195ca7ceae
5 changed files with 18 additions and 10 deletions

View File

@@ -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)
}