@@ -526,11 +526,6 @@ static bool isGuaranteedLexicalValue(SILValue src) {
526526 src->isLexical ();
527527}
528528
529- // / Returns true if we have enough information to end the lifetime.
530- static bool canEndLexicalLifetime (LiveValues values) {
531- return values.canEndLexicalLifetime ();
532- }
533-
534529// / Begin a lexical borrow scope for the value stored into the provided
535530// / StoreInst after that instruction.
536531// /
@@ -825,7 +820,7 @@ SILInstruction *StackAllocationPromoter::promoteAllocationInBlock(
825820 if (lexicalLifetimeEnsured (asi)) {
826821 // End the lexical lifetime at a load [take]. The storage is no
827822 // longer keeping the value alive.
828- if (runningVals && canEndLexicalLifetime ( runningVals->value )) {
823+ if (runningVals && runningVals->value . canEndLexicalLifetime ( )) {
829824 // End it right now if we have enough information.
830825 endOwnedLexicalLifetimeBeforeInst (asi, /* beforeInstruction=*/ li,
831826 ctx,
@@ -908,7 +903,7 @@ SILInstruction *StackAllocationPromoter::promoteAllocationInBlock(
908903 lastStoreInst = si;
909904 if (lexicalLifetimeEnsured (asi)) {
910905 if (oldRunningVals && oldRunningVals->isStorageValid &&
911- canEndLexicalLifetime ( oldRunningVals->value )) {
906+ oldRunningVals->value . canEndLexicalLifetime ( )) {
912907 endOwnedLexicalLifetimeBeforeInst (asi, /* beforeInstruction=*/ si, ctx,
913908 oldRunningVals->value .getOwned ());
914909 }
@@ -965,7 +960,7 @@ SILInstruction *StackAllocationPromoter::promoteAllocationInBlock(
965960 }
966961 // Mark storage as invalid and mark end_borrow as a deinit point.
967962 runningVals->isStorageValid = false ;
968- if (!canEndLexicalLifetime ( runningVals->value )) {
963+ if (!runningVals->value . canEndLexicalLifetime ( )) {
969964 continue ;
970965 }
971966 endGuaranteedLexicalLifetimeBeforeInst (
@@ -1422,7 +1417,7 @@ void StackAllocationPromoter::endLexicalLifetime(BlockSetVector &phiBlocks) {
14221417 if (isa<EndBorrowInst>(inst)) {
14231418 // Not all store_borrows will have a begin_borrow [lexical] that needs
14241419 // to be ended. If the source is already lexical, we don't create it.
1425- if (!canEndLexicalLifetime (*values )) {
1420+ if (!values-> canEndLexicalLifetime ()) {
14261421 continue ;
14271422 }
14281423 endGuaranteedLexicalLifetimeBeforeInst (
@@ -1445,7 +1440,7 @@ void StackAllocationPromoter::endLexicalLifetime(BlockSetVector &phiBlocks) {
14451440 if (terminatesInUnreachable || uniqueSuccessorLacksLiveInValues ()) {
14461441 auto values = getLiveOutValues (phiBlocks, bb);
14471442 if (values->isGuaranteed ()) {
1448- if (!canEndLexicalLifetime (*values )) {
1443+ if (!values-> canEndLexicalLifetime ()) {
14491444 continue ;
14501445 }
14511446 endGuaranteedLexicalLifetimeBeforeInst (
@@ -1965,7 +1960,7 @@ void MemoryToRegisters::removeSingleBlockAllocation(AllocStackInst *asi) {
19651960 continue ;
19661961 }
19671962 runningVals->isStorageValid = false ;
1968- if (!canEndLexicalLifetime ( runningVals->value )) {
1963+ if (!runningVals->value . canEndLexicalLifetime ( )) {
19691964 continue ;
19701965 }
19711966 endGuaranteedLexicalLifetimeBeforeInst (
0 commit comments