Skip to content

Commit 6117d4f

Browse files
committed
[SIL] add Value.hasLifetime
1 parent 87f9dbb commit 6117d4f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

SwiftCompilerSources/Sources/SIL/Value.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,16 @@ public enum Ownership {
7575
/// points in the SSA graph, where more information about the value is
7676
/// statically available on some control flow paths.
7777
case none
78-
78+
79+
public var hasLifetime: Bool {
80+
switch self {
81+
case .owned, .guaranteed:
82+
return true
83+
case .unowned, .none:
84+
return false
85+
}
86+
}
87+
7988
public init(bridged: BridgedValue.Ownership) {
8089
switch bridged {
8190
case .Unowned: self = .unowned

0 commit comments

Comments
 (0)