Skip to content

Commit adb7aaa

Browse files
committed
[AST] NFC: Rename SpecialDistributedProperty -> SpecialDistributedActorProperty
Disambiguate from `distributed var`.
1 parent 3a2f47e commit adb7aaa

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

include/swift/AST/Decl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ bool conflicting(ASTContext &ctx,
376376

377377
/// The kind of special compiler synthesized property in a \c distributed actor,
378378
/// currently this includes \c id and \c actorSystem.
379-
enum class SpecialDistributedProperty {
379+
enum class SpecialDistributedActorProperty {
380380
Id, ActorSystem
381381
};
382382

@@ -3065,8 +3065,8 @@ class ValueDecl : public Decl {
30653065
/// Whether this is the special synthesized 'id' or 'actorSystem' property
30663066
/// of a distributed actor. If \p onlyCheckName is set, then any
30673067
/// matching user-defined property with the name is also considered.
3068-
std::optional<SpecialDistributedProperty>
3069-
isSpecialDistributedProperty(bool onlyCheckName = false) const;
3068+
std::optional<SpecialDistributedActorProperty>
3069+
isSpecialDistributedActorProperty(bool onlyCheckName = false) const;
30703070

30713071
bool hasName() const { return bool(Name); }
30723072
bool isOperator() const { return Name.isOperator(); }

lib/AST/DistributedDecl.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,20 +1358,20 @@ bool ValueDecl::isDistributedGetAccessor() const {
13581358
return false;
13591359
}
13601360

1361-
std::optional<SpecialDistributedProperty>
1362-
ValueDecl::isSpecialDistributedProperty(bool onlyCheckName) const {
1361+
std::optional<SpecialDistributedActorProperty>
1362+
ValueDecl::isSpecialDistributedActorProperty(bool onlyCheckName) const {
13631363
if (!isa<VarDecl>(this))
13641364
return std::nullopt;
13651365

13661366
auto *DC = getDeclContext();
13671367
auto &ctx = DC->getASTContext();
13681368

1369-
auto kind = [&]() -> std::optional<SpecialDistributedProperty> {
1369+
auto kind = [&]() -> std::optional<SpecialDistributedActorProperty> {
13701370
auto name = getName();
13711371
if (name.isSimpleName(ctx.Id_id))
1372-
return SpecialDistributedProperty::Id;
1372+
return SpecialDistributedActorProperty::Id;
13731373
if (name.isSimpleName(ctx.Id_actorSystem))
1374-
return SpecialDistributedProperty::ActorSystem;
1374+
return SpecialDistributedActorProperty::ActorSystem;
13751375

13761376
return std::nullopt;
13771377
}();

lib/SILGen/SILGenDestructor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void SILGenFunction::emitDistributedRemoteActorDeinit(
7474
continue;
7575

7676
// Just to double-check, we only want to destroy `id` and `actorSystem`
77-
if (vd->isSpecialDistributedProperty())
77+
if (vd->isSpecialDistributedActorProperty())
7878
destroyClassMember(cleanupLoc, borrowedSelf, vd);
7979
}
8080

lib/Sema/AssociatedTypeInference.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,7 @@ AssociatedTypeInference::getPotentialTypeWitnessesFromRequirement(
16611661
// witnesses already being resolved.
16621662
if (auto *nominal = dc->getSelfNominalTypeDecl()) {
16631663
if (nominal->isDistributedActor() &&
1664-
req->isSpecialDistributedProperty(/*onlyCheckName*/ true)) {
1664+
req->isSpecialDistributedActorProperty(/*onlyCheckName*/ true)) {
16651665
LLVM_DEBUG(llvm::dbgs() << "skipping special distributed property\n");
16661666
return {};
16671667
}

lib/Sema/TypeCheckAttr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7852,7 +7852,7 @@ void AttributeChecker::visitNonisolatedAttr(NonisolatedAttr *attr) {
78527852
// The synthesized "id" and "actorSystem" are the only exceptions,
78537853
// because the implementation mirrors them.
78547854
if (nominal->isDistributedActor() &&
7855-
!var->isSpecialDistributedProperty()) {
7855+
!var->isSpecialDistributedActorProperty()) {
78567856
diagnoseAndRemoveAttr(attr,
78577857
diag::nonisolated_distributed_actor_storage);
78587858
return;

lib/Sema/TypeCheckDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2948,7 +2948,7 @@ static ArrayRef<Decl *> evaluateMembersRequest(
29482948
// be in a specific order that is different from ordering by their
29492949
// mangled name, so preserve the order
29502950
// they were added in.
2951-
if (vd->isSynthesized() && !vd->isSpecialDistributedProperty()) {
2951+
if (vd->isSynthesized() && !vd->isSpecialDistributedActorProperty()) {
29522952
synthesizedMembers.add(vd);
29532953
return;
29542954
}

lib/Sema/TypeCheckDeclPrimary.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ CheckRedeclarationRequest::evaluate(Evaluator &eval, ValueDecl *current,
10651065
});
10661066
}
10671067
auto *conflictDecl = current == declToDiagnose ? other : current;
1068-
if (conflictDecl->isSpecialDistributedProperty()) {
1068+
if (conflictDecl->isSpecialDistributedActorProperty()) {
10691069
declToDiagnose->diagnose(
10701070
diag::distributed_actor_user_defined_special_property,
10711071
other->getName());

lib/Sema/TypeCheckStorage.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,13 +390,13 @@ MemberwiseInitPropertiesRequest::evaluate(Evaluator &evaluator,
390390
static Type getLazyInterfaceTypeForSynthesizedVar(VarDecl *var) {
391391
// For DistributedActor, the `id` and `actorSystem` properties have their
392392
// types computed lazily.
393-
if (auto distPropKind = var->isSpecialDistributedProperty()) {
393+
if (auto distPropKind = var->isSpecialDistributedActorProperty()) {
394394
auto *NTD = var->getDeclContext()->getSelfNominalTypeDecl();
395395
ASSERT(NTD);
396396
switch (distPropKind.value()) {
397-
case SpecialDistributedProperty::Id:
397+
case SpecialDistributedActorProperty::Id:
398398
return getDistributedActorIDType(NTD);
399-
case SpecialDistributedProperty::ActorSystem:
399+
case SpecialDistributedActorProperty::ActorSystem:
400400
return getDistributedActorSystemType(NTD);
401401
}
402402
llvm_unreachable("Unhandled case in switch!");

0 commit comments

Comments
 (0)