mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SymbolGraphGen] only include the given symbol for qualified imports (#59852)
* only include the given symbol for qualified imports rdar://96309088 * re-exporting one type should not allow unrelated types to sneak in * ensure that children of re-exported types are also re-exported
This commit is contained in:
@@ -59,13 +59,14 @@ symbolgraphgen::emitSymbolGraphForModule(ModuleDecl *M,
|
||||
swift::getTopLevelDeclsForDisplay(M, ModuleDecls, /*recursive*/true);
|
||||
|
||||
SmallPtrSet<ModuleDecl *, 4> ExportedImportedModules;
|
||||
swift::collectParsedExportedImports(M, ExportedImportedModules);
|
||||
llvm::SmallDenseMap<ModuleDecl *, SmallPtrSet<Decl *, 4>, 4> QualifiedImports;
|
||||
swift::collectParsedExportedImports(M, ExportedImportedModules, QualifiedImports);
|
||||
|
||||
if (Options.PrintMessages)
|
||||
llvm::errs() << ModuleDecls.size()
|
||||
<< " top-level declarations in this module.\n";
|
||||
|
||||
SymbolGraphASTWalker Walker(*M, ExportedImportedModules, Options);
|
||||
SymbolGraphASTWalker Walker(*M, ExportedImportedModules, QualifiedImports, Options);
|
||||
|
||||
for (auto *Decl : ModuleDecls) {
|
||||
Walker.walk(Decl);
|
||||
@@ -102,7 +103,8 @@ printSymbolGraphForDecl(const ValueDecl *D, Type BaseTy,
|
||||
|
||||
llvm::json::OStream JOS(OS, Options.PrettyPrint ? 2 : 0);
|
||||
ModuleDecl *MD = D->getModuleContext();
|
||||
SymbolGraphASTWalker Walker(*MD, {}, Options);
|
||||
llvm::SmallDenseMap<ModuleDecl *, SmallPtrSet<Decl *, 4>, 4> QualifiedImports;
|
||||
SymbolGraphASTWalker Walker(*MD, {}, QualifiedImports, Options);
|
||||
markup::MarkupContext MarkupCtx;
|
||||
SymbolGraph Graph(Walker, *MD, None, MarkupCtx, None,
|
||||
/*IsForSingleNode=*/true);
|
||||
|
||||
Reference in New Issue
Block a user