Skip to content

Commit 154ab48

Browse files
committed
Make _Differentiable protocol compiler-known.
The `_Differentiable` protocol is compiler-known and will be used during type-checking, SILGen, and the SIL differentiation transform.
1 parent 6bbc63b commit 154ab48

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

include/swift/AST/KnownProtocols.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ PROTOCOL_(DestructorSafeContainer)
8383

8484
PROTOCOL(StringInterpolationProtocol)
8585

86+
PROTOCOL_(Differentiable)
87+
8688
EXPRESSIBLE_BY_LITERAL_PROTOCOL(ExpressibleByArrayLiteral, "Array", false)
8789
EXPRESSIBLE_BY_LITERAL_PROTOCOL(ExpressibleByBooleanLiteral, "BooleanLiteralType", true)
8890
EXPRESSIBLE_BY_LITERAL_PROTOCOL(ExpressibleByDictionaryLiteral, "Dictionary", false)

lib/IRGen/GenMeta.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4217,6 +4217,7 @@ SpecialProtocol irgen::getSpecialProtocolID(ProtocolDecl *P) {
42174217
case KnownProtocolKind::Encodable:
42184218
case KnownProtocolKind::Decodable:
42194219
case KnownProtocolKind::StringInterpolationProtocol:
4220+
case KnownProtocolKind::Differentiable:
42204221
return SpecialProtocol::None;
42214222
}
42224223

0 commit comments

Comments
 (0)