Merge pull request #39865 from apple/QuietMisdreavus/private-swiftc-symbols

[Driver][SymbolGraph] add new flag -symbol-graph-minimum-access-level

rdar://79099869
This commit is contained in:
QuietMisdreavus
2021-10-29 13:01:22 -06:00
committed by GitHub
11 changed files with 58 additions and 34 deletions

View File

@@ -5753,6 +5753,7 @@ void swift::serializeToBuffers(
void swift::serialize(ModuleOrSourceFile DC,
const SerializationOptions &options,
const symbolgraphgen::SymbolGraphOptions &symbolGraphOptions,
const SILModule *M,
const fine_grained_dependencies::SourceFileDepGraph *DG) {
assert(!withNullAsEmptyStringRef(options.OutputPath).empty());
@@ -5797,22 +5798,12 @@ void swift::serialize(ModuleOrSourceFile DC,
});
}
if (!options.SymbolGraphOutputDir.empty()) {
if (!symbolGraphOptions.OutputDir.empty()) {
if (DC.is<ModuleDecl *>()) {
auto *M = DC.get<ModuleDecl*>();
FrontendStatsTracer tracer(getContext(DC).Stats,
"Serialization, symbolgraph");
symbolgraphgen::SymbolGraphOptions SGOpts {
options.SymbolGraphOutputDir,
M->getASTContext().LangOpts.Target,
/* PrettyPrint */false,
AccessLevel::Public,
/*EmitSynthesizedMembers*/true,
/*PrintMessages*/false,
/*EmitInheritedDocs*/options.SkipSymbolGraphInheritedDocs,
/*IncludeSPISymbols*/options.IncludeSPISymbolsInSymbolGraph,
};
symbolgraphgen::emitSymbolGraphForModule(M, SGOpts);
symbolgraphgen::emitSymbolGraphForModule(M, symbolGraphOptions);
}
}
emitABIDescriptor(DC, options);