Skip to content

Commit c3959ad

Browse files
committed
Address review feedback.
1 parent 7c63d03 commit c3959ad

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

include/swift/AST/AutoDiff.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -388,16 +388,14 @@ template<typename T> struct DenseMapInfo;
388388
template<> struct DenseMapInfo<AutoDiffConfig> {
389389
static AutoDiffConfig getEmptyKey() {
390390
auto *ptr = llvm::DenseMapInfo<void *>::getEmptyKey();
391-
return {static_cast<IndexSubset *>(ptr),
392-
static_cast<IndexSubset *>(ptr),
391+
return {static_cast<IndexSubset *>(ptr), static_cast<IndexSubset *>(ptr),
393392
static_cast<GenericSignature *>(ptr)};
394393
}
395394

396395
static AutoDiffConfig getTombstoneKey() {
397396
auto *ptr = llvm::DenseMapInfo<void *>::getTombstoneKey();
398-
return {static_cast<IndexSubset *>(ptr),
399-
static_cast<IndexSubset *>(ptr),
400-
static_cast<GenericSignature *>(ptr)};
397+
return {static_cast<IndexSubset *>(ptr), static_cast<IndexSubset *>(ptr),
398+
static_cast<GenericSignature *>(ptr)};
401399
}
402400

403401
static unsigned getHashValue(const AutoDiffConfig &Val) {

include/swift/AST/DiagnosticsParse.def

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -689,14 +689,12 @@ ERROR(sil_witness_protocol_conformance_not_found,none,
689689
// SIL differentiability witnesses
690690
ERROR(sil_diff_witness_expected_keyword,PointsToFirstBadToken,
691691
"expected '%0' in differentiability witness", (StringRef))
692-
ERROR(sil_diff_witness_expected_parameter_list,PointsToFirstBadToken,
693-
"expected an comma-separated list of parameter indices, e.g. (0, 1)", ())
694-
ERROR(sil_diff_witness_expected_rsquare,PointsToFirstBadToken,
695-
"expected ']' to end 'differentiable' attribute", ())
692+
ERROR(sil_diff_witness_expected_index_list,PointsToFirstBadToken,
693+
"expected a space-separated list of indices, e.g. '0 1'", ())
696694
ERROR(sil_diff_witness_expected_parameter_index,PointsToFirstBadToken,
697-
"expected the index of a parameter to differentiate w.r.t.", ())
698-
ERROR(sil_diff_witness_expected_source_index,PointsToFirstBadToken,
699-
"expected the index of a result to differentiate from", ())
695+
"expected a parameter index to differentiate with respect to.", ())
696+
ERROR(sil_diff_witness_expected_result_index,PointsToFirstBadToken,
697+
"expected a result index to differentiate with respect to", ())
700698

701699
// SIL Coverage Map
702700
ERROR(sil_coverage_func_not_found, none,

lib/ParseSIL/ParseSIL.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6869,9 +6869,9 @@ bool SILParserTUState::parseSILDifferentiabilityWitness(Parser &P) {
68696869
// Function that parses an index into `paramIndices`. Returns true on error.
68706870
auto parseParam = [&]() -> bool {
68716871
unsigned index;
6872-
// TODO: Reject non-ascending parameter index lists.
6872+
// TODO: Reject non-ascending index lists.
68736873
if (P.parseUnsignedInteger(index, lastLoc,
6874-
diag::sil_diff_witness_expected_parameter_list))
6874+
diag::sil_diff_witness_expected_index_list))
68756875
return true;
68766876
paramIndices.push_back(index);
68776877
return false;

0 commit comments

Comments
 (0)