Skip to content

Commit c364181

Browse files
committed
Add MarkDependenceInst::hasScopedLifetime
1 parent dc8778f commit c364181

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/swift/SIL/SILInstruction.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8815,6 +8815,14 @@ class MarkDependenceInst
88158815
uint8_t(MarkDependenceKind::Escaping);
88168816
}
88178817

8818+
// True if the dependence is limited to the scope of an OSSA lifetime. Only
8819+
// for nonescaping dependencies with owned escapable values.
8820+
bool hasScopedLifetime() const {
8821+
return isNonEscaping() && getType().isObject()
8822+
&& getOwnershipKind() == OwnershipKind::Owned
8823+
&& getType().isEscapable(*getFunction());
8824+
}
8825+
88188826
/// Visit the instructions that end the lifetime the dependent value.
88198827
///
88208828
/// Preconditions:

0 commit comments

Comments
 (0)