Skip to content

Commit 19242df

Browse files
committed
[NFC] OSSACanOwned: Extracted predicate.
1 parent 6b977dc commit 19242df

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

include/swift/SILOptimizer/Utils/CanonicalizeOSSALifetime.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,10 @@ class CanonicalizeOSSALifetime final {
465465
UserRange getUsers() const { return liveness->getAllUsers(); }
466466

467467
private:
468+
bool endingLifetimeAtExplicitEnds() const {
469+
return explicitLifetimeEnds.size() > 0;
470+
}
471+
468472
bool respectsDeinitBarriers() const {
469473
if (!currentDef->isLexical())
470474
return false;

lib/SILOptimizer/Utils/CanonicalizeOSSALifetime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ void CanonicalizeOSSALifetime::extendLivenessToDeadEnds() {
387387

388388
void CanonicalizeOSSALifetime::extendLivenessToDeinitBarriers() {
389389
SmallVector<SILInstruction *, 8> ends;
390-
if (explicitLifetimeEnds.size() > 0) {
390+
if (endingLifetimeAtExplicitEnds()) {
391391
visitExtendedUnconsumedBoundary(
392392
explicitLifetimeEnds,
393393
[&ends](auto *instruction, auto lifetimeEnding) {

0 commit comments

Comments
 (0)