Skip to content

Commit 6a0278c

Browse files
authored
[Sema] NFC: Remove GetDistributedMethodWitnessedProtocolRequirements (#85274)
This has been unused for over a year now (since #71801), let's just remove it.
1 parent feebe6a commit 6a0278c

File tree

5 files changed

+0
-66
lines changed

5 files changed

+0
-66
lines changed

include/swift/AST/Decl.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8118,15 +8118,6 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
81188118
getSILSynthesizeKind() == SILSynthesizeKind::DistributedActorFactory;
81198119
}
81208120

8121-
/// Return a vector of distributed requirements that this distributed method
8122-
/// is implementing.
8123-
///
8124-
/// If the method is witness to multiple requirements this is incorrect and
8125-
/// should be diagnosed during type-checking as it may make remoteCalls
8126-
/// ambiguous.
8127-
llvm::ArrayRef<ValueDecl *>
8128-
getDistributedMethodWitnessedProtocolRequirements() const;
8129-
81308121
/// Determines whether this function is a 'remoteCall' function,
81318122
/// which is used as ad-hoc protocol requirement by the
81328123
/// 'DistributedActorSystem' protocol.

include/swift/AST/TypeCheckRequests.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,27 +1598,6 @@ class GetDistributedActorConcreteArgumentDecodingMethodRequest :
15981598
bool isCached() const { return true; }
15991599
};
16001600

1601-
/// Find out if a distributed method is implementing a distributed protocol
1602-
/// requirement.
1603-
class GetDistributedMethodWitnessedProtocolRequirements :
1604-
public SimpleRequest<GetDistributedMethodWitnessedProtocolRequirements,
1605-
llvm::ArrayRef<ValueDecl *> (AbstractFunctionDecl *),
1606-
RequestFlags::Cached> {
1607-
public:
1608-
using SimpleRequest::SimpleRequest;
1609-
1610-
private:
1611-
friend SimpleRequest;
1612-
1613-
llvm::ArrayRef<ValueDecl *> evaluate(
1614-
Evaluator &evaluator,
1615-
AbstractFunctionDecl *nominal) const;
1616-
1617-
public:
1618-
// Caching
1619-
bool isCached() const { return true; }
1620-
};
1621-
16221601
/// Retrieve the static "shared" property within a global actor that provides
16231602
/// the actor instance representing the global actor.
16241603
///

include/swift/AST/TypeCheckerTypeIDZone.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,6 @@ SWIFT_REQUEST(TypeChecker, GetDistributedActorSystemPropertyRequest,
160160
SWIFT_REQUEST(TypeChecker, GetDistributedRemoteCallTargetInitFunctionRequest,
161161
ConstructorDecl *(NominalTypeDecl *),
162162
Cached, NoLocationInfo)
163-
SWIFT_REQUEST(TypeChecker, GetDistributedMethodWitnessedProtocolRequirements,
164-
ArrayRef<ValueDecl *> (AbstractFunctionDecl *),
165-
Cached, NoLocationInfo)
166163
SWIFT_REQUEST(TypeChecker, GetDistributedRemoteCallArgumentInitFunctionRequest,
167164
ConstructorDecl *(NominalTypeDecl *),
168165
Cached, NoLocationInfo)

lib/AST/DistributedDecl.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -453,21 +453,6 @@ bool swift::checkDistributedSerializationRequirementIsExactlyCodable(
453453
std::count(protocols.begin(), protocols.end(), decodable) == 1;
454454
}
455455

456-
// TODO(distributed): probably can be removed?
457-
llvm::ArrayRef<ValueDecl *>
458-
AbstractFunctionDecl::getDistributedMethodWitnessedProtocolRequirements() const {
459-
auto mutableThis = const_cast<AbstractFunctionDecl *>(this);
460-
461-
// Only a 'distributed' decl can witness 'distributed' protocol
462-
if (!isDistributed()) {
463-
return llvm::ArrayRef<ValueDecl *>();
464-
}
465-
466-
return evaluateOrDefault(
467-
getASTContext().evaluator,
468-
GetDistributedMethodWitnessedProtocolRequirements(mutableThis), {});
469-
}
470-
471456
/******************************************************************************/
472457
/********************* Ad-hoc protocol requirement checks *********************/
473458
/******************************************************************************/

lib/Sema/TypeCheckDistributed.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -945,21 +945,3 @@ GetDistributedActorConcreteArgumentDecodingMethodRequest::evaluate(
945945
/// witness
946946
return nullptr;
947947
}
948-
949-
llvm::ArrayRef<ValueDecl *>
950-
GetDistributedMethodWitnessedProtocolRequirements::evaluate(
951-
Evaluator &evaluator,
952-
AbstractFunctionDecl *afd) const {
953-
// Only a 'distributed' decl can witness 'distributed' protocol
954-
assert(afd->isDistributed());
955-
auto &C = afd->getASTContext();
956-
957-
auto result = llvm::SmallVector<ValueDecl *, 1>();
958-
for (auto witnessedRequirement : afd->getSatisfiedProtocolRequirements()) {
959-
if (witnessedRequirement->isDistributed()) {
960-
result.push_back(witnessedRequirement);
961-
}
962-
}
963-
964-
return C.AllocateCopy(result);
965-
}

0 commit comments

Comments
 (0)