Skip to content

Commit 5b64ef8

Browse files
committed
Sema: Remove a bit of dead code in DerivedConformanceDifferentiable.cpp
1 parent ba23002 commit 5b64ef8

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

lib/Sema/DerivedConformanceDifferentiable.cpp

-20
Original file line numberDiff line numberDiff line change
@@ -157,24 +157,6 @@ static bool canDeriveTangentVectorAsSelf(NominalTypeDecl *nominal,
157157
return true;
158158
}
159159

160-
// Synthesizable `Differentiable` protocol requirements.
161-
enum class DifferentiableRequirement {
162-
// associatedtype TangentVector
163-
TangentVector,
164-
// mutating func move(along direction: TangentVector)
165-
MoveAlong,
166-
};
167-
168-
static DifferentiableRequirement
169-
getDifferentiableRequirementKind(ValueDecl *requirement) {
170-
auto &C = requirement->getASTContext();
171-
if (requirement->getBaseName() == C.Id_TangentVector)
172-
return DifferentiableRequirement::TangentVector;
173-
if (requirement->getBaseName() == C.Id_move)
174-
return DifferentiableRequirement::MoveAlong;
175-
llvm_unreachable("Invalid `Differentiable` protocol requirement");
176-
}
177-
178160
bool DerivedConformance::canDeriveDifferentiable(NominalTypeDecl *nominal,
179161
DeclContext *DC,
180162
ValueDecl *requirement) {
@@ -183,8 +165,6 @@ bool DerivedConformance::canDeriveDifferentiable(NominalTypeDecl *nominal,
183165
if (!isDifferentiableProgrammingEnabled(*SF))
184166
return false;
185167

186-
auto reqKind = getDifferentiableRequirementKind(requirement);
187-
188168
auto &C = nominal->getASTContext();
189169
// If there are any `TangentVector` type witness candidates, check whether
190170
// there exists only a single valid candidate.

0 commit comments

Comments
 (0)