mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add a tiny BorrowedAddress utility.
Determines whether an address might be inside a borrowed scope. If so, then any address substitution needs to find that scope boundary to avoid violating its basic guarantee that all uses are within scope.
This commit is contained in:
@@ -62,20 +62,6 @@ SILValue swift::getUnderlyingObject(SILValue v) {
|
||||
}
|
||||
}
|
||||
|
||||
SILValue
|
||||
swift::getUnderlyingObjectStoppingAtObjectToAddrProjections(SILValue v) {
|
||||
if (!v->getType().isAddress())
|
||||
return SILValue();
|
||||
|
||||
while (true) {
|
||||
auto v2 = lookThroughAddressToAddressProjections(v);
|
||||
v2 = stripIndexingInsts(v2);
|
||||
if (v2 == v)
|
||||
return v2;
|
||||
v = v2;
|
||||
}
|
||||
}
|
||||
|
||||
SILValue swift::getUnderlyingObjectStopAtMarkDependence(SILValue v) {
|
||||
while (true) {
|
||||
SILValue v2 = stripCastsWithoutMarkDependence(v);
|
||||
|
||||
Reference in New Issue
Block a user