Skip to content

Commit d598da5

Browse files
committed
[sil] Implement SILType::isActor().
Just a helper that calls getASTType()->isActorType(). I also updated the two places in SNS that we use this.
1 parent 7b5db49 commit d598da5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

include/swift/SIL/SILType.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,8 @@ class SILType {
878878

879879
bool isMarkedAsImmortal() const;
880880

881+
bool isActor() const { return getASTType()->isActorType(); }
882+
881883
ProtocolConformanceRef conformsToProtocol(SILFunction *fn,
882884
ProtocolDecl *protocol) const;
883885

lib/SILOptimizer/Mandatory/SendNonSendable.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ class PartitionOpTranslator {
385385
auto *svi = cast<SingleValueInstruction>(iter.first->first);
386386
auto storage = AccessStorageWithBase::compute(svi->getOperand(0));
387387
if (storage.storage && isa<RefElementAddrInst>(storage.base)) {
388-
if (storage.storage.getRoot()->getType().getASTType()->isActorType()) {
388+
if (storage.storage.getRoot()->getType().isActor()) {
389389
self->neverConsumedValueIDs.push_back(iter.first->second.getID());
390390
}
391391
}
@@ -606,7 +606,7 @@ class PartitionOpTranslator {
606606
if (auto fas = FullApplySite::isa(applyInst)) {
607607
if (fas.hasSelfArgument()) {
608608
if (auto self = fas.getSelfArgument()) {
609-
hasActorSelf = self->getType().getASTType()->isActorType();
609+
hasActorSelf = self->getType().isActor();
610610
}
611611
}
612612
}

0 commit comments

Comments
 (0)