@@ -158,15 +158,15 @@ public enum AccessBase : CustomStringConvertible, Hashable {
158
158
}
159
159
}
160
160
161
- /// True, if the address is immediately produced by an allocation in its function.
161
+ /// True, if the address is produced by an allocation in its function.
162
162
public var isLocal : Bool {
163
163
switch self {
164
- case . box( let pbi) : return pbi. box is AllocBoxInst
165
- case . class( let rea) : return rea. instance is AllocRefInstBase
166
- case . tail( let rta) : return rta. instance is AllocRefInstBase
167
- case . stack: return true
168
- case . global, . argument, . yield, . pointer, . unidentified:
169
- return false
164
+ case . box( let pbi) : return pbi. box. referenceRoot is AllocBoxInst
165
+ case . class( let rea) : return rea. instance. referenceRoot is AllocRefInstBase
166
+ case . tail( let rta) : return rta. instance. referenceRoot is AllocRefInstBase
167
+ case . stack: return true
168
+ case . global, . argument, . yield, . pointer, . unidentified:
169
+ return false
170
170
}
171
171
}
172
172
@@ -241,7 +241,7 @@ public enum AccessBase : CustomStringConvertible, Hashable {
241
241
// First handle all pairs of the same kind (except `yield` and `pointer`).
242
242
case ( . box( let pb) , . box( let otherPb) ) :
243
243
return pb. fieldIndex != otherPb. fieldIndex ||
244
- isDifferentAllocation ( pb. box, otherPb. box)
244
+ isDifferentAllocation ( pb. box. referenceRoot , otherPb. box. referenceRoot )
245
245
case ( . stack( let asi) , . stack( let otherAsi) ) :
246
246
return asi != otherAsi
247
247
case ( . global( let global) , . global( let otherGlobal) ) :
@@ -542,7 +542,7 @@ extension Value {
542
542
return . base( walker. result. base)
543
543
}
544
544
545
- /// The root definition of a reference, obtained by skipping casts, etc .
545
+ /// The root definition of a reference, obtained by skipping ownership forwarding and ownership transition .
546
546
public var referenceRoot : Value {
547
547
var value : Value = self
548
548
while true {
0 commit comments