File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -1015,7 +1015,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-08-18-a: b10b1fce14385faa6d44f6b933e95
1015
1015
refs/heads/rdar-43033749-fix-batch-mode-no-diags-swift-5.0-branch: a14e64eaad30de89f0f5f0b2a782eed7ecdcb255
1016
1016
refs/heads/revert-19006-error-bridging-integer-type: 8a9065a3696535305ea53fe9b71f91cbe6702019
1017
1017
refs/heads/revert-19050-revert-19006-error-bridging-integer-type: ecf752d54b05dd0a20f510f0bfa54a3fec3bcaca
1018
- refs/heads/rxwei-patch-1: b4483dac64121a60ee46a8f28f3c29ddf1c1abf5
1018
+ refs/heads/rxwei-patch-1: d788bba41ec71f7d42bf61d1f080c5e79a211172
1019
1019
refs/heads/shahmishal-patch-1: e58ec0f7488258d42bef51bc3e6d7b3dc74d7b2a
1020
1020
refs/heads/typelist-existential: 4046359efd541fb5c72d69a92eefc0a784df8f5e
1021
1021
refs/tags/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-08-20-a: 4319ba09e4fb8650ee86061075c74a016b6baab9
Original file line number Diff line number Diff line change @@ -2040,7 +2040,24 @@ bool Serializer::isDeclXRef(const Decl *D) const {
2040
2040
// Special-case for SIL generic parameter decls, which don't have a real
2041
2041
// DeclContext.
2042
2042
if (!isa<FileUnit>(topLevel)) {
2043
- assert (isa<GenericTypeParamDecl>(D) && " unexpected decl kind" );
2043
+ // SWIFT_ENABLE_TENSORFLOW
2044
+ // FIXME(TF-623): Find a robust way to special-casing structs/enums
2045
+ // synthesized during SIL differentiation transform.
2046
+ auto isDifferentiationDataStructure = [](const Decl *D) {
2047
+ auto *valueDecl = dyn_cast<ValueDecl>(D);
2048
+ if (!valueDecl)
2049
+ return false ;
2050
+ if (auto *structDecl =
2051
+ valueDecl->getInterfaceType ()->getStructOrBoundGenericStruct ())
2052
+ return structDecl->getNameStr ().contains (" __PB__" );
2053
+ if (auto *enumDecl =
2054
+ valueDecl->getInterfaceType ()->getEnumOrBoundGenericEnum ())
2055
+ return enumDecl->getNameStr ().contains (" __Pred__" );
2056
+ return false ;
2057
+ };
2058
+ assert (
2059
+ (isa<GenericTypeParamDecl>(D) || isDifferentiationDataStructure (D)) &&
2060
+ " unexpected decl kind" );
2044
2061
return false ;
2045
2062
}
2046
2063
return true ;
Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-frontend -emit-sib -primary-file %s
2
+
3
+ // Test AST serialization of differentiation generated structs/enums.
4
+ @differentiable
5
+ func TF_623( _ x: Float ) -> Float {
6
+ if x > 0 { }
7
+ return x
8
+ }
You can’t perform that action at this time.
0 commit comments