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 {
9393 // /
9494 // / TODO: We also need to complete scoped addresses (e.g. store_borrow)!
9595 LifetimeCompletion completeOSSALifetime (SILValue value, Boundary boundary) {
96- if (value->getOwnershipKind () == OwnershipKind::None)
96+ switch (value->getOwnershipKind ()) {
97+ case OwnershipKind::None:
9798 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: {
100105 BorrowedValue borrowedValue (value);
101106 if (!borrowedValue)
102107 return LifetimeCompletion::NoLifetime;
103108
104109 if (!borrowedValue.isLocalScope ())
105110 return LifetimeCompletion::AlreadyComplete;
106111 }
112+ }
113+
107114 if (!completedValues.insert (value))
108115 return LifetimeCompletion::AlreadyComplete;
109116
You can’t perform that action at this time.
0 commit comments