Skip to content

Commit 9ac8ed6

Browse files
authored
Merge pull request swiftlang#63181 from nkcsgexi/abi-onone-rename
2 parents ca1f3f7 + 3b189a5 commit 9ac8ed6

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

lib/DriverTool/swift_api_digester_main.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,16 @@ class SDKTreeDiffPass {
546546
}// End of anonymous namespace
547547

548548
namespace {
549+
550+
static bool isMissingDeclAcceptable(const SDKNodeDecl *D) {
551+
// Don't complain about removing importation of SwiftOnoneSupport.
552+
if (D->getKind() == SDKNodeKind::DeclImport &&
553+
D->getName() == "SwiftOnoneSupport") {
554+
return true;
555+
}
556+
return false;
557+
}
558+
549559
static void diagnoseRemovedDecl(const SDKNodeDecl *D) {
550560
if (D->getSDKContext().checkingABI()) {
551561
// Don't complain about removing @_alwaysEmitIntoClient if we are checking ABI.
@@ -559,9 +569,7 @@ static void diagnoseRemovedDecl(const SDKNodeDecl *D) {
559569
if (Ctx.getOpts().SkipRemoveDeprecatedCheck &&
560570
D->isDeprecated())
561571
return;
562-
// Don't complain about removing importation of SwiftOnoneSupport.
563-
if (D->getKind() == SDKNodeKind::DeclImport &&
564-
D->getName() == "SwiftOnoneSupport") {
572+
if (isMissingDeclAcceptable(D)) {
565573
return;
566574
}
567575
D->emitDiag(SourceLoc(), diag::removed_decl, false);
@@ -1705,6 +1713,8 @@ void DiagnosisEmitter::handle(const SDKNodeDecl *Node, NodeAnnotation Anno) {
17051713
.findUpdateCounterpart(Node))) {
17061714
DiagLoc = CD->getLoc();
17071715
}
1716+
if (isMissingDeclAcceptable(Node))
1717+
return;
17081718
Node->emitDiag(DiagLoc, diag::renamed_decl,
17091719
Ctx.buffer((Twine(getDeclKindStr(Node->getDeclKind(),
17101720
Ctx.getOpts().CompilerStyle)) + " " +

0 commit comments

Comments
 (0)