[SR-10972] swift-api-digester: avoid diagnosing the removal of __derived_enum_equals and __derived_struct_equals

These functions are compiler implementation details and diagnosing
them is redundant and may be confusing to framework authors.
This commit is contained in:
Xi Ge
2019-06-20 16:08:06 -07:00
parent f4f2e2cd59
commit 2160f65283
6 changed files with 36 additions and 0 deletions

View File

@@ -1959,6 +1959,18 @@ void DiagnosisEmitter::handle(const SDKNodeDecl *Node, NodeAnnotation Anno) {
}
if (FoundInSuperclass)
return;
// When diagnosing API changes, avoid complaining the removal of these
// synthesized functions since they are compiler implementation details.
// If an enum is no longer equatable, another diagnostic about removing
// conforming protocol will be emitted.
if (!Ctx.checkingABI()) {
if (Node->getName() == Ctx.Id_derived_struct_equals ||
Node->getName() == Ctx.Id_derived_enum_equals) {
return;
}
}
Node->emitDiag(diag::removed_decl, Node->isDeprecated());
return;
}