File tree Expand file tree Collapse file tree 4 files changed +13
-5
lines changed Expand file tree Collapse file tree 4 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -911,8 +911,16 @@ class SILType {
911
911
912
912
bool isMarkedAsImmortal () const ;
913
913
914
+ // / Returns true if this type is an actor type. Returns false if this is any
915
+ // / other type. This includes distributed actors. To check for distributed
916
+ // / actors and actors, use isAnyActor().
914
917
bool isActor () const { return getASTType ()->isActorType (); }
915
918
919
+ bool isDistributedActor () const { return getASTType ()->isDistributedActor (); }
920
+
921
+ // / Returns true if this type is an actor or a distributed actor.
922
+ bool isAnyActor () const { return getASTType ()->isAnyActorType (); }
923
+
916
924
// / Returns true if this function conforms to the Sendable protocol.
917
925
bool isSendable (SILFunction *fn) const ;
918
926
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ class SILIsolationInfo {
130
130
isolatedValue (isolatedValue), actorInstance(actorInstance) {
131
131
assert ((!actorInstance ||
132
132
(actorIsolation.getKind () == ActorIsolation::ActorInstance &&
133
- actorInstance->getType ().isActor ())) &&
133
+ actorInstance->getType ().isAnyActor ())) &&
134
134
" actorInstance must be an actor if it is non-empty" );
135
135
}
136
136
@@ -211,7 +211,7 @@ class SILIsolationInfo {
211
211
static SILIsolationInfo getActorIsolated (SILValue isolatedValue,
212
212
SILValue actorInstance,
213
213
NominalTypeDecl *typeDecl) {
214
- if (typeDecl->isActor ())
214
+ if (typeDecl->isAnyActor ())
215
215
return {ActorIsolation::forActorInstanceSelf (typeDecl), isolatedValue,
216
216
actorInstance};
217
217
auto isolation = swift::getActorIsolation (typeDecl);
Original file line number Diff line number Diff line change @@ -3262,7 +3262,7 @@ TrackableValue RegionAnalysisValueMap::getTrackableValue(
3262
3262
// underlying object, use that. It is never wrong.
3263
3263
if (info.actorIsolation ) {
3264
3264
SILValue actorInstance =
3265
- info.value ->getType ().isActor () ? info.value : SILValue ();
3265
+ info.value ->getType ().isAnyActor () ? info.value : SILValue ();
3266
3266
iter.first ->getSecond ().mergeIsolationRegionInfo (
3267
3267
SILIsolationInfo::getActorIsolated (value, actorInstance,
3268
3268
*info.actorIsolation ));
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ SILIsolationInfo SILIsolationInfo::get(SILInstruction *inst) {
122
122
auto *nomDecl =
123
123
rei->getOperand ()->getType ().getNominalOrBoundGenericNominal ();
124
124
SILValue actorInstance =
125
- nomDecl->isActor () ? rei->getOperand () : SILValue ();
125
+ nomDecl->isAnyActor () ? rei->getOperand () : SILValue ();
126
126
return SILIsolationInfo::getActorIsolated (rei, actorInstance, nomDecl);
127
127
}
128
128
@@ -181,7 +181,7 @@ SILIsolationInfo SILIsolationInfo::get(SILInstruction *inst) {
181
181
if (isolation.isActorIsolated () &&
182
182
(isolation.getKind () != ActorIsolation::ActorInstance ||
183
183
isolation.getActorInstanceParameter () == 0 )) {
184
- auto actor = cmi->getOperand ()->getType ().isActor ()
184
+ auto actor = cmi->getOperand ()->getType ().isAnyActor ()
185
185
? cmi->getOperand ()
186
186
: SILValue ();
187
187
return SILIsolationInfo::getActorIsolated (cmi, actor, isolation);
You can’t perform that action at this time.
0 commit comments