Skip to content

Commit 7fb5d31

Browse files
committed
[NFC] OSSACompleteLifetime: Move function up.
Avoid a separate declaration.
1 parent 36203de commit 7fb5d31

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

lib/SIL/Utils/OSSALifetimeCompletion.cpp

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,19 @@ static bool endLifetimeAtAvailabilityBoundary(SILValue value,
422422
static bool endLifetimeAtBoundary(SILValue value,
423423
SSAPrunedLiveness const &liveness,
424424
OSSALifetimeCompletion::Boundary boundary,
425-
DeadEndBlocks &deadEndBlocks);
425+
DeadEndBlocks &deadEndBlocks) {
426+
bool changed = false;
427+
switch (boundary) {
428+
case OSSALifetimeCompletion::Boundary::Liveness:
429+
changed |= endLifetimeAtLivenessBoundary(value, liveness, deadEndBlocks);
430+
break;
431+
case OSSALifetimeCompletion::Boundary::Availability:
432+
changed |=
433+
endLifetimeAtAvailabilityBoundary(value, liveness, deadEndBlocks);
434+
break;
435+
}
436+
return changed;
437+
}
426438

427439
/// End the lifetime of \p value at unreachable instructions.
428440
///
@@ -445,23 +457,6 @@ bool OSSALifetimeCompletion::analyzeAndUpdateLifetime(SILValue value,
445457
deadEndBlocks);
446458
}
447459

448-
static bool endLifetimeAtBoundary(SILValue value,
449-
SSAPrunedLiveness const &liveness,
450-
OSSALifetimeCompletion::Boundary boundary,
451-
DeadEndBlocks &deadEndBlocks) {
452-
bool changed = false;
453-
switch (boundary) {
454-
case OSSALifetimeCompletion::Boundary::Liveness:
455-
changed |= endLifetimeAtLivenessBoundary(value, liveness, deadEndBlocks);
456-
break;
457-
case OSSALifetimeCompletion::Boundary::Availability:
458-
changed |=
459-
endLifetimeAtAvailabilityBoundary(value, liveness, deadEndBlocks);
460-
break;
461-
}
462-
return changed;
463-
}
464-
465460
namespace swift::test {
466461
// Arguments:
467462
// - SILValue: value

0 commit comments

Comments
 (0)