Skip to content

ABIChecker: don't fail when hitting EnumCaseDecl #39167

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
Sep 4, 2021
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
7 changes: 6 additions & 1 deletion lib/APIDigester/ModuleAnalyzerNodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1797,12 +1797,17 @@ SwiftDeclCollector::addMembersToRoot(SDKNode *Root, IterableDeclContext *Context
Root->addChild(constructSubscriptDeclNode(SD));
} else if (isa<PatternBindingDecl>(Member)) {
// All containing variables should have been handled.
} else if (isa<EnumCaseDecl>(Member)) {
// All containing variables should have been handled.
} else if (isa<IfConfigDecl>(Member)) {
// All containing members should have been handled.
} else if (isa<DestructorDecl>(Member)) {
// deinit has no impact.
} else if (isa<MissingMemberDecl>(Member)) {
// avoid adding MissingMemberDecl
} else {
llvm_unreachable("unhandled member decl kind.");
llvm::errs() << "Unhandled decl:\n";
Member->dump(llvm::errs());
}
}
}
Expand Down
1 change: 1 addition & 0 deletions test/ModuleInterface/emit-abi-descriptor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RUN: %empty-directory(%t/Foo.swiftmodule)
// RUN: %empty-directory(%t/ResourceDir/%target-sdk-name/prebuilt-modules/Foo.swiftmodule)
// RUN: echo "public func foo() {}" > %t/Foo.swift
// RUN: echo "public enum DisplayStyle { case tuple, optional, collection }" > %t/Foo.swift

// RUN: %target-swift-frontend -emit-module %t/Foo.swift -module-name Foo -emit-module-interface-path %t/Foo.swiftinterface
// RUN: %target-swift-frontend -compile-module-from-interface %t/Foo.swiftinterface -o %t/Foo.swiftmodule -module-name Foo -emit-abi-descriptor-path %t/Foo.json
Expand Down