Skip to content

Commit 7ed30c9

Browse files
refactor: stop populating SymbolGraphOptions at creation
1 parent 4ec3e52 commit 7ed30c9

File tree

2 files changed

+17
-25
lines changed

2 files changed

+17
-25
lines changed

lib/DriverTool/swift_symbolgraph_extract_main.cpp

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -162,20 +162,18 @@ int swift_symbolgraph_extract_main(ArrayRef<const char *> Args,
162162
}
163163
}
164164

165-
symbolgraphgen::SymbolGraphOptions Options{
166-
OutputDir,
167-
Target,
168-
ParsedArgs.hasArg(OPT_pretty_print),
169-
AccessLevel::Public,
170-
!ParsedArgs.hasArg(OPT_skip_synthesized_members),
171-
ParsedArgs.hasArg(OPT_v),
172-
ParsedArgs.hasArg(OPT_skip_inherited_docs),
173-
ParsedArgs.hasArg(OPT_skip_protocol_implementations),
174-
ParsedArgs.hasArg(OPT_include_spi_symbols),
175-
/*IncludeClangDocs=*/false,
165+
symbolgraphgen::SymbolGraphOptions Options;
166+
Options.OutputDir = OutputDir;
167+
Options.Target = Target;
168+
Options.PrettyPrint = ParsedArgs.hasArg(OPT_pretty_print);
169+
Options.EmitSynthesizedMembers = !ParsedArgs.hasArg(OPT_skip_synthesized_members);
170+
Options.PrintMessages = ParsedArgs.hasArg(OPT_v);
171+
Options.SkipInheritedDocs = ParsedArgs.hasArg(OPT_skip_inherited_docs);
172+
Options.SkipProtocolImplementations = ParsedArgs.hasArg(OPT_skip_protocol_implementations);
173+
Options.IncludeSPISymbols = ParsedArgs.hasArg(OPT_include_spi_symbols);
174+
Options.EmitExtensionBlockSymbols =
176175
ParsedArgs.hasFlag(OPT_emit_extension_block_symbols,
177-
OPT_omit_extension_block_symbols, /*default=*/false),
178-
};
176+
OPT_omit_extension_block_symbols, /*default=*/false);
179177

180178
if (auto *A = ParsedArgs.getLastArg(OPT_minimum_access_level)) {
181179
Options.MinimumAccessLevel =

tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,18 +1013,12 @@ fillSymbolInfo(CursorSymbolInfo &Symbol, const DeclInfo &DInfo,
10131013
if (AddSymbolGraph) {
10141014
SmallVector<symbolgraphgen::PathComponent, 4> PathComponents;
10151015
SmallVector<symbolgraphgen::FragmentInfo, 8> FragmentInfos;
1016-
symbolgraphgen::SymbolGraphOptions Options{
1017-
"",
1018-
Invoc.getLangOptions().Target,
1019-
/*PrettyPrint=*/false,
1020-
AccessLevel::Private,
1021-
/*EmitSynthesizedMembers=*/false,
1022-
/*PrintMessages=*/false,
1023-
/*SkipInheritedDocs=*/false,
1024-
/*IncludeSPISymbols=*/true,
1025-
/*IncludeClangDocs=*/true,
1026-
/*EmitExtensionBlockSymbols=*/false,
1027-
};
1016+
1017+
symbolgraphgen::SymbolGraphOptions Options;
1018+
Options.Target = Invoc.getLangOptions().Target;
1019+
Options.MinimumAccessLevel = AccessLevel::Private;
1020+
Options.IncludeSPISymbols = true;
1021+
Options.IncludeClangDocs = true;
10281022

10291023
symbolgraphgen::printSymbolGraphForDecl(DInfo.VD, DInfo.BaseType,
10301024
DInfo.InSynthesizedExtension,

0 commit comments

Comments
 (0)