File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -1076,10 +1076,10 @@ void findTransitiveReborrowBaseValuePairs(
1076
1076
BorrowingOperand initialScopeOperand, SILValue origBaseValue,
1077
1077
function_ref<void (SILPhiArgument *, SILValue)> visitReborrowBaseValuePair);
1078
1078
1079
- // / Given a begin_borrow visit all end_borrow users of the borrow or its
1080
- // / reborrows.
1079
+ // / Given a begin of a borrow scope, visit all end_borrow users of the borrow or
1080
+ // / its reborrows.
1081
1081
void visitTransitiveEndBorrows (
1082
- BeginBorrowInst *borrowInst ,
1082
+ BorrowedValue beginBorrow ,
1083
1083
function_ref<void (EndBorrowInst *)> visitEndBorrow);
1084
1084
1085
1085
} // namespace swift
Original file line number Diff line number Diff line change @@ -1327,10 +1327,10 @@ void swift::findTransitiveReborrowBaseValuePairs(
1327
1327
}
1328
1328
1329
1329
void swift::visitTransitiveEndBorrows (
1330
- BeginBorrowInst *borrowInst ,
1330
+ BorrowedValue beginBorrow ,
1331
1331
function_ref<void (EndBorrowInst *)> visitEndBorrow) {
1332
1332
SmallSetVector<SILValue, 4 > worklist;
1333
- worklist.insert (borrowInst );
1333
+ worklist.insert (beginBorrow. value );
1334
1334
1335
1335
while (!worklist.empty ()) {
1336
1336
auto val = worklist.pop_back_val ();
Original file line number Diff line number Diff line change @@ -282,10 +282,10 @@ void DCE::markLive() {
282
282
OwnershipKind::Owned) {
283
283
markInstructionLive (borrowInst);
284
284
// Visit all end_borrows and mark them live
285
- auto visitEndBorrow = [&](EndBorrowInst *endBorrow) {
286
- markInstructionLive ( endBorrow);
287
- } ;
288
- visitTransitiveEndBorrows (borrowInst, visitEndBorrow );
285
+ visitTransitiveEndBorrows ( BorrowedValue (borrowInst),
286
+ [&](EndBorrowInst * endBorrow) {
287
+ markInstructionLive (endBorrow) ;
288
+ } );
289
289
continue ;
290
290
}
291
291
// If not populate reborrowDependencies for this borrow
You can’t perform that action at this time.
0 commit comments