Skip to content

Commit 3a1d5e0

Browse files
committed
---
yaml --- r: 311279 b: refs/heads/tensorflow-merge c: ff64467 h: refs/heads/master i: 311277: dfece55 311275: e04d227 311271: 6a1d9ab 311263: b5a60c1
1 parent 5b7a393 commit 3a1d5e0

File tree

9 files changed

+265
-145
lines changed

9 files changed

+265
-145
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ refs/heads/chase-my-tail: 8bb91443a9e81bbfac92a2621a0af887a1da8dbf
13791379
refs/heads/consider-outer-alternatives: 708bac749ec60a22a79e2eefbe734f9488a7370d
13801380
refs/heads/revert-25740-oops-i-linked-it-again: fdd41aeb682fc488572bdc1cf71b2ff6997ba576
13811381
refs/heads/swift-5.1-branch-06-12-2019: e63b7b2d3b93c48232d386099d0ec525d21d8f8d
1382-
refs/heads/tensorflow-merge: ff5d85131cca828c807dc7d95f8301140e6d679a
1382+
refs/heads/tensorflow-merge: ff644675ddbbf2c48bbb5ca8aaa771a62549c072
13831383
refs/heads/update-checkout-sha-info: 5832743c5c2a842976c42a508a4c6dcceefb0aef
13841384
refs/tags/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-06-12-a: 228f0448d9bb909aacbba4afcb7c600a405d15da
13851385
refs/tags/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-06-14-a: 922861a77b5fc2bf46bc917da70ceb15eef76836

branches/tensorflow-merge/include/swift/AST/DiagnosticsParse.def

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,13 +1454,7 @@ ERROR(attr_implements_expected_member_name,PointsToFirstBadToken,
14541454
// SWIFT_ENABLE_TENSORFLOW
14551455
// differentiable
14561456
ERROR(attr_differentiable_expected_function_name,PointsToFirstBadToken,
1457-
"expected a qualified function to differentiate", ())
1458-
1459-
ERROR(attr_differentiable_missing_lsquare,PointsToFirstBadToken,
1460-
"missing '[' for parameter index list", ())
1461-
1462-
ERROR(attr_differentiable_missing_rsquare,PointsToFirstBadToken,
1463-
"missing ']' for parameter index list", ())
1457+
"expected a qualified %0 function", (StringRef))
14641458

14651459
ERROR(attr_differentiable_expected_parameter_list,PointsToFirstBadToken,
14661460
"expected a list of parameters to differentiate with respect to, e.g. (.0, w, b)", ())

branches/tensorflow-merge/include/swift/AST/DiagnosticsSema.def

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2486,6 +2486,8 @@ ERROR(implements_attr_protocol_not_conformed_to,none,
24862486
// SWIFT_ENABLE_TENSORFLOW
24872487
ERROR(differentiable_attr_no_parameters,none,
24882488
"%0 has no parameters to differentiate with respect to", (DeclName))
2489+
ERROR(differentiable_attr_void_result,none,
2490+
"cannot differentiate void function %0", (DeclName))
24892491
ERROR(differentiable_attr_primal_overload_not_found,none,
24902492
"%0 does not have expected parameters' type %1", (DeclName, Type))
24912493
ERROR(differentiable_attr_adjoint_overload_not_found,none,
@@ -2504,13 +2506,17 @@ ERROR(differentiable_attr_cannot_diff_wrt_objects_or_existentials,none,
25042506
ERROR(differentiable_attr_function_not_same_type_context,none,
25052507
"%0 is not defined in the current type context", (DeclName))
25062508
ERROR(differentiable_attr_specified_not_function,none,
2507-
"%0 is not a function to be used as %select{primal|adjoint}1",
2509+
"%0 is not a function to be used as %select{adjoint|primal}1",
25082510
(DeclName, bool))
25092511
ERROR(differentiable_attr_ambiguous_function_identifier,none,
25102512
"ambiguous or overloaded identifier %0 cannot be used in @differentiable "
25112513
"attribute", (DeclName))
25122514
ERROR(differentiable_attr_forward_mode_unsupported,none,
25132515
"forward-mode automatic differentiation is not supported yet", ())
2516+
ERROR(differentiable_attr_invalid_access,none,
2517+
"%select{adjoint|primal}2 %0 is required to either be public or "
2518+
"@usableFromInline because the original function %1 is public or "
2519+
"@usableFromInline", (DeclName, DeclName, bool))
25142520

25152521
ERROR(compiler_evaluable_bad_context,none,
25162522
"@compilerEvaluable functions not allowed here", ())

branches/tensorflow-merge/lib/Parse/ParseDecl.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -875,12 +875,13 @@ Parser::parseDifferentiableAttribute(SourceLoc atLoc, SourceLoc loc) {
875875
parseToken(tok::colon,
876876
diag::attr_differentiable_expected_colon_after_label, label))
877877
return true;
878-
// Parse the name of the adjoint function.
878+
// Parse the name of the function.
879+
Diagnostic funcDiag(diag::attr_differentiable_expected_function_name.ID,
880+
{ label });
879881
result.Name =
880882
parseUnqualifiedDeclName(/*afterDot=*/false, result.Loc,
881-
diag::attr_implements_expected_member_name,
882-
/*allowOperators=*/true,
883-
/*allowZeroArgCompoundNames=*/true);
883+
funcDiag, /*allowOperators=*/true,
884+
/*allowZeroArgCompoundNames=*/true);
884885
return !result.Name;
885886
};
886887

0 commit comments

Comments
 (0)