File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -272,15 +272,26 @@ static bool usesFeatureLifetimeDependence(Decl *decl) {
272272}
273273
274274static bool usesFeatureInoutLifetimeDependence (Decl *decl) {
275- for (auto attr : decl->getAttrs ().getAttributes <LifetimeAttr>()) {
276- for (auto source : attr->getLifetimeEntry ()->getSources ()) {
277- if (source.getParsedLifetimeDependenceKind () ==
278- ParsedLifetimeDependenceKind::Inout) {
279- return true ;
275+ auto hasInoutLifetimeDependence = [](Decl *decl) {
276+ for (auto attr : decl->getAttrs ().getAttributes <LifetimeAttr>()) {
277+ for (auto source : attr->getLifetimeEntry ()->getSources ()) {
278+ if (source.getParsedLifetimeDependenceKind () ==
279+ ParsedLifetimeDependenceKind::Inout) {
280+ return true ;
281+ }
280282 }
281283 }
284+ return false ;
285+ };
286+
287+ switch (decl->getKind ()) {
288+ case DeclKind::Var: {
289+ auto *var = cast<VarDecl>(decl);
290+ return llvm::any_of (var->getAllAccessors (), hasInoutLifetimeDependence);
291+ }
292+ default :
293+ return hasInoutLifetimeDependence (decl);
282294 }
283- return false ;
284295}
285296
286297UNINTERESTING_FEATURE (DynamicActorIsolation)
You can’t perform that action at this time.
0 commit comments