File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -93,17 +93,24 @@ class OSSALifetimeCompletion {
93
93
// /
94
94
// / TODO: We also need to complete scoped addresses (e.g. store_borrow)!
95
95
LifetimeCompletion completeOSSALifetime (SILValue value, Boundary boundary) {
96
- if (value->getOwnershipKind () == OwnershipKind::None)
96
+ switch (value->getOwnershipKind ()) {
97
+ case OwnershipKind::None:
97
98
return LifetimeCompletion::NoLifetime;
98
-
99
- if (value->getOwnershipKind () != OwnershipKind::Owned) {
99
+ case OwnershipKind::Owned:
100
+ break ;
101
+ case OwnershipKind::Any:
102
+ llvm::report_fatal_error (" value with any ownership kind!?" );
103
+ case OwnershipKind::Guaranteed:
104
+ case OwnershipKind::Unowned: {
100
105
BorrowedValue borrowedValue (value);
101
106
if (!borrowedValue)
102
107
return LifetimeCompletion::NoLifetime;
103
108
104
109
if (!borrowedValue.isLocalScope ())
105
110
return LifetimeCompletion::AlreadyComplete;
106
111
}
112
+ }
113
+
107
114
if (!completedValues.insert (value))
108
115
return LifetimeCompletion::AlreadyComplete;
109
116
You can’t perform that action at this time.
0 commit comments