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