Skip to content

[NFC] Gardening. #27581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions include/swift/AST/KnownProtocols.def
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ PROTOCOL(ElementaryFunctions)
PROTOCOL(KeyPathIterable)
PROTOCOL(TensorArrayProtocol)
PROTOCOL(TensorGroup)
PROTOCOL_(TensorFlowDataTypeCompatible)
PROTOCOL(TensorProtocol)
PROTOCOL(VectorProtocol)
PROTOCOL(Differentiable)
PROTOCOL(EuclideanDifferentiable)
Expand Down
2 changes: 0 additions & 2 deletions lib/AST/ASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1066,8 +1066,6 @@ ProtocolDecl *ASTContext::getProtocol(KnownProtocolKind kind) const {
// SWIFT_ENABLE_TENSORFLOW
case KnownProtocolKind::TensorArrayProtocol:
case KnownProtocolKind::TensorGroup:
case KnownProtocolKind::TensorFlowDataTypeCompatible:
case KnownProtocolKind::TensorProtocol:
M = getLoadedModule(Id_TensorFlow);
break;
case KnownProtocolKind::Expression:
Expand Down
2 changes: 0 additions & 2 deletions lib/IRGen/GenMeta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4224,8 +4224,6 @@ SpecialProtocol irgen::getSpecialProtocolID(ProtocolDecl *P) {
case KnownProtocolKind::KeyPathIterable:
case KnownProtocolKind::TensorArrayProtocol:
case KnownProtocolKind::TensorGroup:
case KnownProtocolKind::TensorFlowDataTypeCompatible:
case KnownProtocolKind::TensorProtocol:
case KnownProtocolKind::VectorProtocol:
case KnownProtocolKind::Differentiable:
case KnownProtocolKind::EuclideanDifferentiable:
Expand Down
13 changes: 3 additions & 10 deletions lib/SILOptimizer/Mandatory/Differentiation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,11 @@ static CanType joinElementTypesFromValues(SILValueRange &&range,
static FuncDecl *findOperatorDeclInProtocol(DeclName operatorName,
ProtocolDecl *protocol) {
assert(operatorName.isOperator());
// Find the operator requirement in the `VectorProtocol` protocol
// declaration and cache it.
// Find the operator requirement in the given protocol declaration.
auto opLookup = protocol->lookupDirect(operatorName);
// Find the `+` with type siguature `(Self, Self) -> Self`.
for (auto *decl : opLookup) {
if (!decl->isProtocolRequirement())
continue;
auto *fd = dyn_cast<FuncDecl>(decl);
if (!fd || !fd->isStatic() || !fd->isOperator())
continue;
Expand Down Expand Up @@ -875,9 +875,6 @@ class ADContext {
/// The AdditiveArithmetic protocol in the standard library.
ProtocolDecl *additiveArithmeticProtocol =
astCtx.getProtocol(KnownProtocolKind::AdditiveArithmetic);
/// The VectorProtocol protocol in the standard library.
ProtocolDecl *vectorProtocolProtocol =
astCtx.getProtocol(KnownProtocolKind::VectorProtocol);

/// `AdditiveArithmetic.+` declaration.
mutable FuncDecl *cachedPlusFn = nullptr;
Expand Down Expand Up @@ -933,10 +930,6 @@ class ADContext {
return additiveArithmeticProtocol;
}

ProtocolDecl *getVectorProtocolProtocol() const {
return vectorProtocolProtocol;
}

FuncDecl *getPlusDecl() const {
if (!cachedPlusFn) {
cachedPlusFn = findOperatorDeclInProtocol(
Expand Down