Skip to content

Commit dc9308e

Browse files
committed
Rename areUsesWithinLocalScope -> areUsesWithinTransitiveScope
1 parent ed88700 commit dc9308e

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

include/swift/SIL/OwnershipUtils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,8 +578,8 @@ struct BorrowedValue {
578578
///
579579
/// \p deadEndBlocks is optional during transition. It will be completely
580580
/// removed in an upcoming commit.
581-
bool areUsesWithinLocalScope(ArrayRef<Operand *> uses,
582-
DeadEndBlocks *deadEndBlocks) const;
581+
bool areUsesWithinTransitiveScope(ArrayRef<Operand *> uses,
582+
DeadEndBlocks *deadEndBlocks) const;
583583

584584
/// Given a local borrow scope introducer, visit all non-forwarding consuming
585585
/// users. This means that this looks through guaranteed block arguments. \p

lib/SIL/Utils/OwnershipUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ void BorrowedValue::computeLiveness(PrunedLiveness &liveness) const {
695695
});
696696
}
697697

698-
bool BorrowedValue::areUsesWithinLocalScope(
698+
bool BorrowedValue::areUsesWithinTransitiveScope(
699699
ArrayRef<Operand *> uses, DeadEndBlocks *deadEndBlocks) const {
700700
// First make sure that we actually have a local scope. If we have a non-local
701701
// scope, then we have something (like a SILFunctionArgument) where a larger
@@ -975,7 +975,7 @@ bool AddressOwnership::areUsesWithinLifetime(
975975
SILValue root = base.getOwnershipReferenceRoot();
976976
BorrowedValue borrow(root);
977977
if (borrow)
978-
return borrow.areUsesWithinLocalScope(uses, &deadEndBlocks);
978+
return borrow.areUsesWithinTransitiveScope(uses, &deadEndBlocks);
979979

980980
// --- A reference no borrow scope. Currently happens for project_box.
981981

lib/SILOptimizer/SemanticARC/CopyValueOpts.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ bool SemanticARCOptVisitor::performGuaranteedCopyValueOptimization(
155155
// TODO: There may be some way of sinking this into the loop below.
156156
//
157157
// FIXME: The haveAnyLocalScopes and destroy.empty() checks are relics of
158-
// attempts to handle dead end blocks during areUsesWithinLocalScope. If we
159-
// don't use dead end blocks at all, they should not be relevant.
158+
// attempts to handle dead end blocks during areUsesWithinTransitiveScope. If
159+
// we don't use dead end blocks at all, they should not be relevant.
160160
bool haveAnyLocalScopes =
161161
llvm::any_of(borrowScopeIntroducers, [](BorrowedValue borrowScope) {
162162
return borrowScope.isLocalScope();
@@ -182,15 +182,15 @@ bool SemanticARCOptVisitor::performGuaranteedCopyValueOptimization(
182182
// need to insert an end_borrow since all of our borrow introducers are
183183
// non-local scopes.
184184
//
185-
// The call to areUsesWithinLocalScope cannot consider dead-end blocks. A
185+
// The call to areUsesWithinTransitiveScope cannot consider dead-end blocks. A
186186
// local borrow scope requires all its inner uses to be inside the borrow
187187
// scope, regardless of whether the end of the scope is inside a dead-end
188188
// block.
189189
{
190190
SmallVector<Operand *, 8> scratchSpace;
191191
if (llvm::any_of(borrowScopeIntroducers, [&](BorrowedValue borrowScope) {
192-
return !borrowScope.areUsesWithinLocalScope(lr.getAllConsumingUses(),
193-
nullptr);
192+
return !borrowScope.areUsesWithinTransitiveScope(
193+
lr.getAllConsumingUses(), nullptr);
194194
})) {
195195
return false;
196196
}
@@ -218,7 +218,7 @@ bool SemanticARCOptVisitor::performGuaranteedCopyValueOptimization(
218218
}
219219

220220
if (llvm::any_of(borrowScopeIntroducers, [&](BorrowedValue borrowScope) {
221-
return !borrowScope.areUsesWithinLocalScope(
221+
return !borrowScope.areUsesWithinTransitiveScope(
222222
phiArgLR.getAllConsumingUses(), nullptr);
223223
})) {
224224
return false;

0 commit comments

Comments
 (0)