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 @@ -271,15 +271,26 @@ static bool usesFeatureLifetimeDependence(Decl *decl) {
271271}
272272
273273static bool usesFeatureInoutLifetimeDependence (Decl *decl) {
274- for (auto attr : decl->getAttrs ().getAttributes <LifetimeAttr>()) {
275- for (auto source : attr->getLifetimeEntry ()->getSources ()) {
276- if (source.getParsedLifetimeDependenceKind () ==
277- ParsedLifetimeDependenceKind::Inout) {
278- return true ;
274+ auto hasInoutLifetimeDependence = [](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 ;
280+ }
279281 }
280282 }
283+ return false ;
284+ };
285+
286+ switch (decl->getKind ()) {
287+ case DeclKind::Var: {
288+ auto *var = cast<VarDecl>(decl);
289+ return llvm::any_of (var->getAllAccessors (), hasInoutLifetimeDependence);
290+ }
291+ default :
292+ return hasInoutLifetimeDependence (decl);
281293 }
282- return false ;
283294}
284295
285296UNINTERESTING_FEATURE (DynamicActorIsolation)
You can’t perform that action at this time.
0 commit comments