Skip to content

Commit 39d3e65

Browse files
authored
Merge pull request #8539 from daniel-grumberg/cherry-picks/swift/6.0/categories-external-types
🍒 [clang][ExtractAPI] Categories for external types and C++ fixes
2 parents 0514f4b + bc58c59 commit 39d3e65

File tree

77 files changed

+3933
-7634
lines changed

Some content is hidden

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

77 files changed

+3933
-7634
lines changed

clang/include/clang/Basic/DiagnosticDriverKinds.td

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

524+
def err_drv_missing_symbol_graph_dir: Error<
525+
"Must provide a symbol graph output directory using --symbol-graph-dir=<directory>">;
526+
527+
def err_drv_unexpected_symbol_graph_output : Error<
528+
"Unexpected output symbol graph '%1'; please provide --symbol-graph-dir=<directory> instead">;
529+
524530
def warn_slash_u_filename : Warning<"'/U%0' treated as the '/U' option">,
525531
InGroup<DiagGroup<"slash-u-filename">>;
526532
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
@@ -360,4 +360,8 @@ def warn_profile_data_misexpect : Warning<
360360
def err_extract_api_ignores_file_not_found :
361361
Error<"file '%0' specified by '--extract-api-ignores=' not found">, DefaultFatal;
362362

363+
def warn_missing_symbol_graph_dir : Warning<
364+
"Missing symbol graph output directory, defaulting to working directory">,
365+
InGroup<ExtractAPIMisuse>;
366+
363367
}

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,3 +1455,6 @@ def ReadOnlyPlacementChecks : DiagGroup<"read-only-types">;
14551455
// Warnings and fixes to support the "safe buffers" programming model.
14561456
def UnsafeBufferUsageInContainer : DiagGroup<"unsafe-buffer-usage-in-container">;
14571457
def UnsafeBufferUsage : DiagGroup<"unsafe-buffer-usage", [UnsafeBufferUsageInContainer]>;
1458+
1459+
// Warnings about misuse of ExtractAPI options.
1460+
def ExtractAPIMisuse : DiagGroup<"extractapi-misuse">;

clang/include/clang/Driver/Options.td

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,13 +1223,30 @@ def extract_api : Flag<["-"], "extract-api">, Flags<[CC1Option]>, Group<Action_G
12231223
HelpText<"Extract API information">;
12241224
def product_name_EQ: Joined<["--"], "product-name=">, Flags<[CC1Option]>,
12251225
MarshallingInfoString<FrontendOpts<"ProductName">>;
1226-
def emit_symbol_graph_EQ: JoinedOrSeparate<["--"], "emit-symbol-graph=">, Flags<[CC1Option]>,
1227-
HelpText<"Generate Extract API information as a side effect of compilation.">,
1228-
MarshallingInfoString<FrontendOpts<"SymbolGraphOutputDir">>;
1229-
def extract_api_ignores_EQ: CommaJoined<["--"], "extract-api-ignores=">, Flags<[CC1Option]>,
1230-
HelpText<"Comma separated list of files containing a new line separated list of API symbols to ignore when extracting API information.">,
1231-
MarshallingInfoStringVector<FrontendOpts<"ExtractAPIIgnoresFileList">>;
1232-
def e : JoinedOrSeparate<["-"], "e">, Flags<[LinkerInput]>, Group<Link_Group>;
1226+
def emit_symbol_graph: Flag<["-"], "emit-symbol-graph">,
1227+
Flags<[CC1Option]>,
1228+
HelpText<"Generate Extract API information as a side effect of compilation.">,
1229+
MarshallingInfoFlag<FrontendOpts<"EmitSymbolGraph">>;
1230+
def emit_extension_symbol_graphs: Flag<["--"], "emit-extension-symbol-graphs">,
1231+
Flags<[CC1Option]>,
1232+
HelpText<"Generate additional symbol graphs for extended modules.">,
1233+
MarshallingInfoFlag<FrontendOpts<"EmitExtensionSymbolGraphs">>;
1234+
def extract_api_ignores_EQ: CommaJoined<["--"], "extract-api-ignores=">,
1235+
Flags<[CC1Option]>,
1236+
HelpText<"Comma separated list of files containing a new line separated list of API symbols to ignore when extracting API information.">,
1237+
MarshallingInfoStringVector<FrontendOpts<"ExtractAPIIgnoresFileList">>;
1238+
def symbol_graph_dir_EQ: Joined<["--"], "symbol-graph-dir=">,
1239+
Flags<[CC1Option]>,
1240+
HelpText<"Directory in which to emit symbol graphs.">,
1241+
MarshallingInfoString<FrontendOpts<"SymbolGraphOutputDir">>;
1242+
def emit_pretty_sgf: Flag<["--"], "pretty-sgf">,
1243+
Flags<[CC1Option]>,
1244+
HelpText<"Emit pretty printed symbol graphs">,
1245+
MarshallingInfoFlag<FrontendOpts<"EmitPrettySymbolGraphs">>;
1246+
def emit_sgf_symbol_labels_for_testing: Flag<["--"], "emit-sgf-symbol-labels-for-testing">,
1247+
Flags<[CC1Option]>,
1248+
MarshallingInfoFlag<FrontendOpts<"EmitSymbolGraphSymbolLabelsForTesting">>;
1249+
def e : Separate<["-"], "e">, Flags<[LinkerInput]>, Group<Link_Group>;
12331250
def fmax_tokens_EQ : Joined<["-"], "fmax-tokens=">, Group<f_Group>, Flags<[CC1Option]>,
12341251
HelpText<"Max total number of preprocessed tokens for -Wmax-tokens.">,
12351252
MarshallingInfoInt<LangOpts<"MaxTokens">>;

0 commit comments

Comments
 (0)