Skip to content

Commit e05c1b4

Browse files
Reenable external categories (llvm#87357)
Reenables b31414b. Also adds a new warning for missing `--symbol-graph-dir` arg when `--emit-extension-symbol-graphs` is provided. This also reverts the commit that removed.
1 parent 7c7ce0b commit e05c1b4

File tree

80 files changed

+3892
-8845
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+3892
-8845
lines changed

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,12 @@ def err_drv_extract_api_wrong_kind : Error<
548548
"header file '%0' input '%1' does not match the type of prior input "
549549
"in api extraction; use '-x %2' to override">;
550550

551+
def err_drv_missing_symbol_graph_dir: Error<
552+
"Must provide a symbol graph output directory using --symbol-graph-dir=<directory>">;
553+
554+
def err_drv_unexpected_symbol_graph_output : Error<
555+
"Unexpected output symbol graph '%1'; please provide --symbol-graph-dir=<directory> instead">;
556+
551557
def warn_slash_u_filename : Warning<"'/U%0' treated as the '/U' option">,
552558
InGroup<DiagGroup<"slash-u-filename">>;
553559
def note_use_dashdash : Note<

clang/include/clang/Basic/DiagnosticFrontendKinds.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,4 +366,8 @@ def warn_profile_data_misexpect : Warning<
366366
def err_extract_api_ignores_file_not_found :
367367
Error<"file '%0' specified by '--extract-api-ignores=' not found">, DefaultFatal;
368368

369+
def warn_missing_symbol_graph_dir : Warning<
370+
"Missing symbol graph output directory, defaulting to working directory">,
371+
InGroup<ExtractAPIMisuse>;
372+
369373
}

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,3 +1517,5 @@ def UnsafeBufferUsage : DiagGroup<"unsafe-buffer-usage", [UnsafeBufferUsageInCon
15171517
// Warnings and notes InstallAPI verification.
15181518
def InstallAPIViolation : DiagGroup<"installapi-violation">;
15191519

1520+
// Warnings about misuse of ExtractAPI options.
1521+
def ExtractAPIMisuse : DiagGroup<"extractapi-misuse">;

clang/include/clang/Driver/Options.td

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,14 +1507,29 @@ def extract_api : Flag<["-"], "extract-api">,
15071507
def product_name_EQ: Joined<["--"], "product-name=">,
15081508
Visibility<[ClangOption, CC1Option]>,
15091509
MarshallingInfoString<FrontendOpts<"ProductName">>;
1510-
def emit_symbol_graph_EQ: JoinedOrSeparate<["--"], "emit-symbol-graph=">,
1510+
def emit_symbol_graph: Flag<["-"], "emit-symbol-graph">,
15111511
Visibility<[ClangOption, CC1Option]>,
1512-
HelpText<"Generate Extract API information as a side effect of compilation.">,
1513-
MarshallingInfoString<FrontendOpts<"SymbolGraphOutputDir">>;
1512+
HelpText<"Generate Extract API information as a side effect of compilation.">,
1513+
MarshallingInfoFlag<FrontendOpts<"EmitSymbolGraph">>;
1514+
def emit_extension_symbol_graphs: Flag<["--"], "emit-extension-symbol-graphs">,
1515+
Visibility<[ClangOption, CC1Option]>,
1516+
HelpText<"Generate additional symbol graphs for extended modules.">,
1517+
MarshallingInfoFlag<FrontendOpts<"EmitExtensionSymbolGraphs">>;
15141518
def extract_api_ignores_EQ: CommaJoined<["--"], "extract-api-ignores=">,
15151519
Visibility<[ClangOption, CC1Option]>,
15161520
HelpText<"Comma separated list of files containing a new line separated list of API symbols to ignore when extracting API information.">,
15171521
MarshallingInfoStringVector<FrontendOpts<"ExtractAPIIgnoresFileList">>;
1522+
def symbol_graph_dir_EQ: Joined<["--"], "symbol-graph-dir=">,
1523+
Visibility<[ClangOption, CC1Option]>,
1524+
HelpText<"Directory in which to emit symbol graphs.">,
1525+
MarshallingInfoString<FrontendOpts<"SymbolGraphOutputDir">>;
1526+
def emit_pretty_sgf: Flag<["--"], "pretty-sgf">,
1527+
Visibility<[ClangOption, CC1Option]>,
1528+
HelpText<"Emit pretty printed symbol graphs">,
1529+
MarshallingInfoFlag<FrontendOpts<"EmitPrettySymbolGraphs">>;
1530+
def emit_sgf_symbol_labels_for_testing: Flag<["--"], "emit-sgf-symbol-labels-for-testing">,
1531+
Visibility<[CC1Option]>,
1532+
MarshallingInfoFlag<FrontendOpts<"EmitSymbolGraphSymbolLabelsForTesting">>;
15181533
def e : Separate<["-"], "e">, Flags<[LinkerInput]>, Group<Link_Group>;
15191534
def fmax_tokens_EQ : Joined<["-"], "fmax-tokens=">, Group<f_Group>,
15201535
Visibility<[ClangOption, CC1Option]>,

0 commit comments

Comments
 (0)