File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
test/SymbolGraph/ClangImporter Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -963,6 +963,14 @@ void ModuleDecl::getDisplayDecls(SmallVectorImpl<Decl*> &Results) const {
963963#ifndef NDEBUG
964964 llvm::DenseSet<Decl *> visited;
965965 for (auto *D : Results) {
966+ // decls synthesized from implicit clang decls may appear multiple times;
967+ // e.g. if multiple modules with underlying clang modules are re-exported.
968+ // including duplicates of these is harmless, so skip them when counting
969+ // this assertion
970+ if (const auto *CD = D->getClangDecl ()) {
971+ if (CD->isImplicit ()) continue ;
972+ }
973+
966974 auto inserted = visited.insert (D).second ;
967975 assert (inserted && " there should be no duplicate decls" );
968976 }
Original file line number Diff line number Diff line change 11// RUN: %empty-directory(%t)
2- // RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/Inputs/Submodules -emit-module-path %t/Submodules.swiftmodule -enable-objc-interop -module-name Submodules %s -emit-symbol-graph -emit-symbol-graph-dir %t
2+ // RUN: cp -r %S/Inputs/EmitWhileBuilding/EmitWhileBuilding.framework %t
3+ // RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-objc-interop -emit-module-path %t/EmitWhileBuilding.framework/Modules/EmitWhileBuilding.swiftmodule/%target-swiftmodule-name -import-underlying-module -F %t -module-name EmitWhileBuilding -disable-objc-attr-requires-foundation-module %S/EmitWhileBuilding.swift
4+ // RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/Inputs/Submodules -emit-module-path %t/Submodules.swiftmodule -enable-objc-interop -module-name Submodules -F %t %s -emit-symbol-graph -emit-symbol-graph-dir %t
35
46// REQUIRES: objc_interop
57
810@_exported import Mixed
911@_exported import Mixed. Submodule
1012
13+ @_exported import EmitWhileBuilding
14+
1115public func someFunc( ) { }
You can’t perform that action at this time.
0 commit comments