mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[AST] NFC: Add a convenient way to create implicit NonisolatedAttrs
This commit is contained in:
@@ -465,8 +465,7 @@ static ValueDecl *deriveDistributedActor_id(DerivedConformance &derived) {
|
||||
/*isStatic=*/false, /*isFinal=*/true);
|
||||
|
||||
// mark as nonisolated, allowing access to it from everywhere
|
||||
propDecl->getAttrs().add(
|
||||
new (C) NonisolatedAttr(/*unsafe=*/false, /*implicit=*/true));
|
||||
propDecl->getAttrs().add(NonisolatedAttr::createImplicit(C));
|
||||
|
||||
derived.addMemberToConformanceContext(pbDecl, /*insertAtHead=*/true);
|
||||
derived.addMemberToConformanceContext(propDecl, /*insertAtHead=*/true);
|
||||
@@ -496,8 +495,7 @@ static ValueDecl *deriveDistributedActor_actorSystem(
|
||||
propertyType, /*isStatic=*/false, /*isFinal=*/true);
|
||||
|
||||
// mark as nonisolated, allowing access to it from everywhere
|
||||
propDecl->getAttrs().add(
|
||||
new (C) NonisolatedAttr(/*unsafe=*/false, /*implicit=*/true));
|
||||
propDecl->getAttrs().add(NonisolatedAttr::createImplicit(C));
|
||||
|
||||
// IMPORTANT: `id` MUST be the first field of a distributed actor, and
|
||||
// `actorSystem` MUST be the second field, because for a remote instance
|
||||
@@ -795,8 +793,7 @@ static ValueDecl *deriveDistributedActor_unownedExecutor(DerivedConformance &der
|
||||
property->getAttrs().add(new (ctx) SemanticsAttr(SEMANTICS_DEFAULT_ACTOR,
|
||||
SourceLoc(), SourceRange(),
|
||||
/*implicit*/ true));
|
||||
property->getAttrs().add(
|
||||
new (ctx) NonisolatedAttr(/*unsafe=*/false, /*implicit=*/true));
|
||||
property->getAttrs().add(NonisolatedAttr::createImplicit(ctx));
|
||||
|
||||
// Make the property implicitly final.
|
||||
property->getAttrs().add(new (ctx) FinalAttr(/*IsImplicit=*/true));
|
||||
|
||||
Reference in New Issue
Block a user