@@ -439,16 +439,22 @@ static bool endLifetimeAtBoundary(SILValue value,
439
439
return changed;
440
440
}
441
441
442
+ bool OSSALifetimeCompletion::analyzeAndUpdateLifetime (
443
+ ScopedAddressValue scopedAddress, Boundary boundary) {
444
+ SmallVector<SILBasicBlock *, 8 > discoveredBlocks;
445
+ SSAPrunedLiveness liveness (scopedAddress->getFunction (), &discoveredBlocks);
446
+ scopedAddress.computeTransitiveLiveness (liveness);
447
+ return endLifetimeAtBoundary (scopedAddress.value , liveness, boundary,
448
+ deadEndBlocks);
449
+ }
450
+
442
451
// / End the lifetime of \p value at unreachable instructions.
443
452
// /
444
453
// / Returns true if any new instructions were created to complete the lifetime.
445
454
bool OSSALifetimeCompletion::analyzeAndUpdateLifetime (SILValue value,
446
455
Boundary boundary) {
447
456
if (auto scopedAddress = ScopedAddressValue (value)) {
448
- SmallVector<SILBasicBlock *, 8 > discoveredBlocks;
449
- SSAPrunedLiveness liveness (value->getFunction (), &discoveredBlocks);
450
- scopedAddress.computeTransitiveLiveness (liveness);
451
- return endLifetimeAtBoundary (value, liveness, boundary, deadEndBlocks);
457
+ return analyzeAndUpdateLifetime (scopedAddress, boundary);
452
458
}
453
459
454
460
// Called for inner borrows, inner adjacent reborrows, inner reborrows, and
0 commit comments