Skip to content

api-digester: avoid looking up node update table to collect renamed declarations. NFC #24817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/api-digester/Outputs/Cake-abi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cake1: InfixOperator ..*.. has been changed to a PrefixOperator
cake1: Protocol ProtocolToEnum has been changed to a Enum

/* Renamed Decls */
cake1: Func S1.foo5(x:y:) has been renamed to Func S1.foo5(x:y:z:)
cake1: Func S1.foo5(x:y:) has been renamed to Func foo5(x:y:z:)
cake1: Struct Somestruct2 has been renamed to Struct NSSomestruct2

/* Type Changes */
Expand Down
2 changes: 1 addition & 1 deletion test/api-digester/Outputs/Cake.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cake1: InfixOperator ..*.. has been changed to a PrefixOperator
cake1: Protocol ProtocolToEnum has been changed to a Enum

/* Renamed Decls */
cake1: Func S1.foo5(x:y:) has been renamed to Func S1.foo5(x:y:z:)
cake1: Func S1.foo5(x:y:) has been renamed to Func foo5(x:y:z:)
cake1: Struct Somestruct2 has been renamed to Struct NSSomestruct2

/* Type Changes */
Expand Down
5 changes: 2 additions & 3 deletions tools/swift-api-digester/swift-api-digester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1942,10 +1942,9 @@ void DiagnosisEmitter::handle(const SDKNodeDecl *Node, NodeAnnotation Anno) {
return;
}
case NodeAnnotation::Rename: {
auto *Count = UpdateMap.findUpdateCounterpart(Node)->getAs<SDKNodeDecl>();
Node->emitDiag(diag::renamed_decl,
Ctx.buffer((Twine(getDeclKindStr(Count->getDeclKind())) + " " +
Count->getFullyQualifiedName()).str()));
Ctx.buffer((Twine(getDeclKindStr(Node->getDeclKind())) + " " +
Node->getAnnotateComment(NodeAnnotation::RenameNewName)).str()));
return;
}
default:
Expand Down