Skip to content

Commit 2330dab

Browse files
committed
swift-api-digester: lessen some assertions.
1 parent 7cf5e50 commit 2330dab

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tools/swift-api-digester/swift-api-digester.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,8 @@ void SDKNode::removeChild(NodePtr C) {
622622
}
623623

624624
void SDKNode::annotate(NodeAnnotation Anno, StringRef Comment) {
625-
assert(!isAnnotatedAs(Anno) && "already annotated");
625+
assert(!Comment.empty());
626+
assert(!isAnnotatedAs(Anno) || AnnotateComments[Anno] == Comment);
626627
annotate(Anno);
627628
AnnotateComments[Anno] = Comment;
628629
}
@@ -2357,8 +2358,8 @@ static void detectFuncDeclChange(NodePtr L, NodePtr R) {
23572358
}
23582359

23592360
static void detectRename(NodePtr L, NodePtr R) {
2360-
assert(L->getKind() == R->getKind());
2361-
if (isa<SDKNodeDecl>(L) && L->getPrintedName() != R->getPrintedName()) {
2361+
if (L->getKind() == R->getKind() && isa<SDKNodeDecl>(L) &&
2362+
L->getPrintedName() != R->getPrintedName()) {
23622363
L->annotate(NodeAnnotation::Rename);
23632364
L->annotate(NodeAnnotation::RenameOldName, L->getPrintedName());
23642365
L->annotate(NodeAnnotation::RenameNewName, R->getPrintedName());

0 commit comments

Comments
 (0)