Skip to content

Commit e2c53dd

Browse files
authored
Merge pull request #62570 from meg-gupta/fixossaapi
[OSSA] Minor fixes to swift::findTransitiveUsesForAddress
2 parents a98621c + 9360b7b commit e2c53dd

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

lib/SIL/Utils/OwnershipUtils.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,8 @@ swift::findTransitiveUsesForAddress(SILValue projectedAddress,
10181018
isa<EndUnpairedAccessInst>(user) || isa<WitnessMethodInst>(user) ||
10191019
isa<SwitchEnumAddrInst>(user) || isa<CheckedCastAddrBranchInst>(user) ||
10201020
isa<SelectEnumAddrInst>(user) || isa<InjectEnumAddrInst>(user) ||
1021-
isa<IsUniqueInst>(user) || isa<ValueMetatypeInst>(user)) {
1021+
isa<IsUniqueInst>(user) || isa<ValueMetatypeInst>(user) ||
1022+
isa<DebugValueInst>(user) || isa<EndBorrowInst>(user)) {
10221023
leafUse(op);
10231024
continue;
10241025
}
@@ -1052,14 +1053,12 @@ swift::findTransitiveUsesForAddress(SILValue projectedAddress,
10521053

10531054
// If we have a load_borrow, add it's end scope to the liveness requirement.
10541055
if (auto *lbi = dyn_cast<LoadBorrowInst>(user)) {
1055-
if (foundUses) {
1056-
// FIXME: if we can assume complete lifetimes, then this should be
1057-
// as simple as:
1058-
// for (Operand *use : lbi->getUses()) {
1059-
// if (use->endsLocalBorrowScope()) {
1060-
if (!findInnerTransitiveGuaranteedUses(lbi, foundUses)) {
1061-
result = meet(result, AddressUseKind::PointerEscape);
1062-
}
1056+
// FIXME: if we can assume complete lifetimes, then this should be
1057+
// as simple as:
1058+
// for (Operand *use : lbi->getUses()) {
1059+
// if (use->endsLocalBorrowScope()) {
1060+
if (!findInnerTransitiveGuaranteedUses(lbi, foundUses)) {
1061+
result = meet(result, AddressUseKind::PointerEscape);
10631062
}
10641063
continue;
10651064
}

0 commit comments

Comments
 (0)