@@ -526,11 +526,6 @@ static bool isGuaranteedLexicalValue(SILValue src) {
526
526
src->isLexical ();
527
527
}
528
528
529
- // / Returns true if we have enough information to end the lifetime.
530
- static bool canEndLexicalLifetime (LiveValues values) {
531
- return values.canEndLexicalLifetime ();
532
- }
533
-
534
529
// / Begin a lexical borrow scope for the value stored into the provided
535
530
// / StoreInst after that instruction.
536
531
// /
@@ -825,7 +820,7 @@ SILInstruction *StackAllocationPromoter::promoteAllocationInBlock(
825
820
if (lexicalLifetimeEnsured (asi)) {
826
821
// End the lexical lifetime at a load [take]. The storage is no
827
822
// longer keeping the value alive.
828
- if (runningVals && canEndLexicalLifetime ( runningVals->value )) {
823
+ if (runningVals && runningVals->value . canEndLexicalLifetime ( )) {
829
824
// End it right now if we have enough information.
830
825
endOwnedLexicalLifetimeBeforeInst (asi, /* beforeInstruction=*/ li,
831
826
ctx,
@@ -908,7 +903,7 @@ SILInstruction *StackAllocationPromoter::promoteAllocationInBlock(
908
903
lastStoreInst = si;
909
904
if (lexicalLifetimeEnsured (asi)) {
910
905
if (oldRunningVals && oldRunningVals->isStorageValid &&
911
- canEndLexicalLifetime ( oldRunningVals->value )) {
906
+ oldRunningVals->value . canEndLexicalLifetime ( )) {
912
907
endOwnedLexicalLifetimeBeforeInst (asi, /* beforeInstruction=*/ si, ctx,
913
908
oldRunningVals->value .getOwned ());
914
909
}
@@ -965,7 +960,7 @@ SILInstruction *StackAllocationPromoter::promoteAllocationInBlock(
965
960
}
966
961
// Mark storage as invalid and mark end_borrow as a deinit point.
967
962
runningVals->isStorageValid = false ;
968
- if (!canEndLexicalLifetime ( runningVals->value )) {
963
+ if (!runningVals->value . canEndLexicalLifetime ( )) {
969
964
continue ;
970
965
}
971
966
endGuaranteedLexicalLifetimeBeforeInst (
@@ -1422,7 +1417,7 @@ void StackAllocationPromoter::endLexicalLifetime(BlockSetVector &phiBlocks) {
1422
1417
if (isa<EndBorrowInst>(inst)) {
1423
1418
// Not all store_borrows will have a begin_borrow [lexical] that needs
1424
1419
// to be ended. If the source is already lexical, we don't create it.
1425
- if (!canEndLexicalLifetime (*values )) {
1420
+ if (!values-> canEndLexicalLifetime ()) {
1426
1421
continue ;
1427
1422
}
1428
1423
endGuaranteedLexicalLifetimeBeforeInst (
@@ -1445,7 +1440,7 @@ void StackAllocationPromoter::endLexicalLifetime(BlockSetVector &phiBlocks) {
1445
1440
if (terminatesInUnreachable || uniqueSuccessorLacksLiveInValues ()) {
1446
1441
auto values = getLiveOutValues (phiBlocks, bb);
1447
1442
if (values->isGuaranteed ()) {
1448
- if (!canEndLexicalLifetime (*values )) {
1443
+ if (!values-> canEndLexicalLifetime ()) {
1449
1444
continue ;
1450
1445
}
1451
1446
endGuaranteedLexicalLifetimeBeforeInst (
@@ -1965,7 +1960,7 @@ void MemoryToRegisters::removeSingleBlockAllocation(AllocStackInst *asi) {
1965
1960
continue ;
1966
1961
}
1967
1962
runningVals->isStorageValid = false ;
1968
- if (!canEndLexicalLifetime ( runningVals->value )) {
1963
+ if (!runningVals->value . canEndLexicalLifetime ( )) {
1969
1964
continue ;
1970
1965
}
1971
1966
endGuaranteedLexicalLifetimeBeforeInst (
0 commit comments