Skip to content

Commit d962656

Browse files
committed
swift-api-digester: lessen some assertions.
1 parent 46b8ad3 commit d962656

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
@@ -630,7 +630,8 @@ void SDKNode::removeChild(NodePtr C) {
630630
}
631631

632632
void SDKNode::annotate(NodeAnnotation Anno, StringRef Comment) {
633-
assert(!isAnnotatedAs(Anno) && "already annotated");
633+
assert(!Comment.empty());
634+
assert(!isAnnotatedAs(Anno) || AnnotateComments[Anno] == Comment);
634635
annotate(Anno);
635636
AnnotateComments[Anno] = Comment;
636637
}
@@ -2364,8 +2365,8 @@ static void detectFuncDeclChange(NodePtr L, NodePtr R) {
23642365
}
23652366

23662367
static void detectRename(NodePtr L, NodePtr R) {
2367-
assert(L->getKind() == R->getKind());
2368-
if (isa<SDKNodeDecl>(L) && L->getPrintedName() != R->getPrintedName()) {
2368+
if (L->getKind() == R->getKind() && isa<SDKNodeDecl>(L) &&
2369+
L->getPrintedName() != R->getPrintedName()) {
23692370
L->annotate(NodeAnnotation::Rename);
23702371
L->annotate(NodeAnnotation::RenameOldName, L->getPrintedName());
23712372
L->annotate(NodeAnnotation::RenameNewName, R->getPrintedName());

0 commit comments

Comments
 (0)