mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SymbolGraphGen] Emit symbols from exported modules
When emitting a symbol graph file for a module that import modules via `@_exported import`, emits those modules' symbols as well. SR-15753 rdar://89547374
This commit is contained in:
@@ -55,13 +55,17 @@ int serializeSymbolGraph(SymbolGraph &SG,
|
||||
int
|
||||
symbolgraphgen::emitSymbolGraphForModule(ModuleDecl *M,
|
||||
const SymbolGraphOptions &Options) {
|
||||
SymbolGraphASTWalker Walker(*M, Options);
|
||||
SmallVector<Decl *, 64> ModuleDecls;
|
||||
swift::getTopLevelDeclsForDisplay(M, ModuleDecls, /*recursive*/true);
|
||||
|
||||
SmallPtrSet<ModuleDecl *, 4> ExportedImportedModules;
|
||||
swift::collectParsedExportedImports(M, ExportedImportedModules);
|
||||
|
||||
if (Options.PrintMessages)
|
||||
llvm::errs() << ModuleDecls.size()
|
||||
<< " top-level declarations in this module.\n";
|
||||
|
||||
SymbolGraphASTWalker Walker(*M, ExportedImportedModules, Options);
|
||||
|
||||
for (auto *Decl : ModuleDecls) {
|
||||
Walker.walk(Decl);
|
||||
@@ -98,7 +102,7 @@ printSymbolGraphForDecl(const ValueDecl *D, Type BaseTy,
|
||||
|
||||
llvm::json::OStream JOS(OS, Options.PrettyPrint ? 2 : 0);
|
||||
ModuleDecl *MD = D->getModuleContext();
|
||||
SymbolGraphASTWalker Walker(*MD, Options);
|
||||
SymbolGraphASTWalker Walker(*MD, {}, Options);
|
||||
markup::MarkupContext MarkupCtx;
|
||||
SymbolGraph Graph(Walker, *MD, None, MarkupCtx, None,
|
||||
/*IsForSingleNode=*/true);
|
||||
|
||||
Reference in New Issue
Block a user