Skip to content

Commit a5f30e2

Browse files
authored
Merge pull request swiftlang#74803 from tshortli/remove-swift-api-extract
Driver: Remove swift-api-extract
2 parents 00e866a + c1ce404 commit a5f30e2

File tree

19 files changed

+122
-609
lines changed

19 files changed

+122
-609
lines changed

include/swift/AST/DiagnosticsFrontend.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ REMARK(warn_implicit_string_processing_import_failed,none,
183183
REMARK(warn_implicit_backtracing_import_failed,none,
184184
"unable to perform implicit import of \"_Backtracing\" module: no such module found", ())
185185

186-
ERROR(error_module_name_required,none, "-module-name is required", ())
187186
ERROR(error_bad_module_name,none,
188187
"module name \"%0\" is not a valid identifier"
189188
"%select{|; use -module-name flag to specify an alternate name}1",

include/swift/Driver/Driver.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ class Driver {
182182
AutolinkExtract, // swift-autolink-extract
183183
SwiftIndent, // swift-indent
184184
SymbolGraph, // swift-symbolgraph
185-
APIExtract, // swift-api-extract
186185
APIDigester, // swift-api-digester
187186
CacheTool, // swift-cache-tool
188187
ParseTest, // swift-parse-test

include/swift/Option/Options.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,13 @@ namespace options {
3737
ArgumentIsPath = (1 << 12),
3838
ModuleInterfaceOption = (1 << 13),
3939
SupplementaryOutput = (1 << 14),
40-
SwiftAPIExtractOption = (1 << 15),
41-
SwiftSymbolGraphExtractOption = (1 << 16),
42-
SwiftAPIDigesterOption = (1 << 17),
43-
NewDriverOnlyOption = (1 << 18),
44-
ModuleInterfaceOptionIgnorable = (1 << 19),
45-
ModuleInterfaceOptionIgnorablePrivate = (1 << 20),
46-
ArgumentIsFileList = (1 << 21),
47-
CacheInvariant = (1 << 22),
40+
SwiftSymbolGraphExtractOption = (1 << 15),
41+
SwiftAPIDigesterOption = (1 << 16),
42+
NewDriverOnlyOption = (1 << 17),
43+
ModuleInterfaceOptionIgnorable = (1 << 18),
44+
ModuleInterfaceOptionIgnorablePrivate = (1 << 19),
45+
ArgumentIsFileList = (1 << 20),
46+
CacheInvariant = (1 << 21),
4847
};
4948

5049
enum ID {

include/swift/Option/Options.td

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ def ModuleInterfaceOptionIgnorablePrivate : OptionFlag;
6666
// for a supplementary output. E.g., `-emit-module` and `-emit-module-path`.
6767
def SupplementaryOutput : OptionFlag;
6868

69-
// The option should be accepted by swift-api-extract.
70-
def SwiftAPIExtractOption : OptionFlag;
71-
7269
// The option should be accepted by swift-symbolgraph-extract.
7370
def SwiftSymbolGraphExtractOption : OptionFlag;
7471

@@ -227,7 +224,7 @@ def driver_mode : Joined<["--"], "driver-mode=">, Flags<[HelpHidden]>,
227224

228225
def help : Flag<["-", "--"], "help">,
229226
Flags<[FrontendOption, AutolinkExtractOption, ModuleWrapOption,
230-
SwiftIndentOption, SwiftAPIExtractOption,
227+
SwiftIndentOption,
231228
SwiftSymbolGraphExtractOption, SwiftAPIDigesterOption]>,
232229
HelpText<"Display available options">;
233230
def h : Flag<["-"], "h">, Alias<help>;
@@ -248,19 +245,19 @@ def parseable_output : Flag<["-"], "parseable-output">,
248245
// Windows Options
249246

250247
def windows_sdk_root : Separate<["-"], "windows-sdk-root">,
251-
Flags<[ArgumentIsPath, FrontendOption, SwiftAPIExtractOption,
248+
Flags<[ArgumentIsPath, FrontendOption,
252249
SwiftSymbolGraphExtractOption, SwiftAPIDigesterOption]>,
253250
HelpText<"Windows SDK Root">, MetaVarName<"<root>">;
254251
def windows_sdk_version : Separate<["-"], "windows-sdk-version">,
255-
Flags<[FrontendOption, SwiftAPIExtractOption,
252+
Flags<[FrontendOption,
256253
SwiftSymbolGraphExtractOption, SwiftAPIDigesterOption]>,
257254
HelpText<"Windows SDK Version">, MetaVarName<"<version>">;
258255
def visualc_tools_root : Separate<["-"], "visualc-tools-root">,
259-
Flags<[ArgumentIsPath, FrontendOption, SwiftAPIExtractOption,
256+
Flags<[ArgumentIsPath, FrontendOption,
260257
SwiftSymbolGraphExtractOption, SwiftAPIDigesterOption]>,
261258
HelpText<"VisualC++ Tools Root">, MetaVarName<"<root>">;
262259
def visualc_tools_version : Separate<["-"], "visualc-tools-version">,
263-
Flags<[FrontendOption, SwiftAPIExtractOption,
260+
Flags<[FrontendOption,
264261
SwiftSymbolGraphExtractOption, SwiftAPIDigesterOption]>,
265262
HelpText<"VisualC++ ToolSet Version">, MetaVarName<"<version>">;
266263

@@ -271,19 +268,19 @@ def _DASH_DASH : Option<["--"], "", KIND_REMAINING_ARGS>,
271268
def o : JoinedOrSeparate<["-"], "o">,
272269
Flags<[FrontendOption, AutolinkExtractOption, ModuleWrapOption,
273270
NoInteractiveOption, SwiftIndentOption, ArgumentIsPath,
274-
SwiftAPIExtractOption, SwiftAPIDigesterOption, CacheInvariant]>,
271+
SwiftAPIDigesterOption, CacheInvariant]>,
275272
HelpText<"Write output to <file>">, MetaVarName<"<file>">;
276273

277274
def j : JoinedOrSeparate<["-"], "j">, Flags<[DoesNotAffectIncrementalBuild]>,
278275
HelpText<"Number of commands to execute in parallel">, MetaVarName<"<n>">;
279276

280277
def sdk : Separate<["-"], "sdk">,
281-
Flags<[FrontendOption, ArgumentIsPath, SwiftAPIExtractOption, SwiftSymbolGraphExtractOption,
278+
Flags<[FrontendOption, ArgumentIsPath, SwiftSymbolGraphExtractOption,
282279
SwiftAPIDigesterOption]>,
283280
HelpText<"Compile against <sdk>">, MetaVarName<"<sdk>">;
284281

285282
def swift_version : Separate<["-"], "swift-version">,
286-
Flags<[FrontendOption, ModuleInterfaceOption, SwiftAPIExtractOption, SwiftSymbolGraphExtractOption,
283+
Flags<[FrontendOption, ModuleInterfaceOption, SwiftSymbolGraphExtractOption,
287284
SwiftAPIDigesterOption]>,
288285
HelpText<"Interpret input according to a specific Swift language version number">,
289286
MetaVarName<"<vers>">;
@@ -305,17 +302,17 @@ def e : Separate<["-"], "e">, Flags<[NewDriverOnlyOption]>,
305302
HelpText<"Executes a line of code provided on the command line">;
306303

307304
def F : JoinedOrSeparate<["-"], "F">,
308-
Flags<[FrontendOption, ArgumentIsPath, SwiftAPIExtractOption, SwiftSymbolGraphExtractOption, SwiftAPIDigesterOption]>,
305+
Flags<[FrontendOption, ArgumentIsPath, SwiftSymbolGraphExtractOption, SwiftAPIDigesterOption]>,
309306
HelpText<"Add directory to framework search path">;
310307
def F_EQ : Joined<["-"], "F=">, Flags<[FrontendOption, ArgumentIsPath]>,
311308
Alias<F>;
312309

313310
def Fsystem : Separate<["-"], "Fsystem">,
314-
Flags<[FrontendOption, ArgumentIsPath, SwiftAPIExtractOption, SwiftSymbolGraphExtractOption]>,
311+
Flags<[FrontendOption, ArgumentIsPath, SwiftSymbolGraphExtractOption]>,
315312
HelpText<"Add directory to system framework search path">;
316313

317314
def I : JoinedOrSeparate<["-"], "I">,
318-
Flags<[FrontendOption, ArgumentIsPath, SwiftAPIExtractOption, SwiftSymbolGraphExtractOption, SwiftAPIDigesterOption]>,
315+
Flags<[FrontendOption, ArgumentIsPath, SwiftSymbolGraphExtractOption, SwiftAPIDigesterOption]>,
319316
HelpText<"Add directory to the import search path">;
320317
def I_EQ : Joined<["-"], "I=">, Flags<[FrontendOption, ArgumentIsPath]>,
321318
Alias<I>;
@@ -484,7 +481,7 @@ def localization_path : Separate<["-"], "localization-path">,
484481
MetaVarName<"<path>">;
485482

486483
def module_cache_path : Separate<["-"], "module-cache-path">,
487-
Flags<[FrontendOption, DoesNotAffectIncrementalBuild, ArgumentIsPath, SwiftAPIExtractOption,
484+
Flags<[FrontendOption, DoesNotAffectIncrementalBuild, ArgumentIsPath,
488485
SwiftSymbolGraphExtractOption, SwiftAPIDigesterOption]>,
489486
HelpText<"Specifies the module cache path">;
490487

@@ -544,11 +541,11 @@ def library_level_EQ : Joined<["-"], "library-level=">,
544541
Alias<library_level>;
545542

546543
def module_name : Separate<["-"], "module-name">,
547-
Flags<[FrontendOption, ModuleInterfaceOption, SwiftAPIExtractOption,
544+
Flags<[FrontendOption, ModuleInterfaceOption,
548545
SwiftSymbolGraphExtractOption]>,
549546
HelpText<"Name of the module to build">;
550547
def project_name : Separate<["-"], "project-name">,
551-
Flags<[FrontendOption, ModuleInterfaceOptionIgnorable, SwiftAPIExtractOption,
548+
Flags<[FrontendOption, ModuleInterfaceOptionIgnorable,
552549
SwiftSymbolGraphExtractOption]>,
553550
HelpText<"Name of the project this module to build belongs to">;
554551

@@ -915,7 +912,7 @@ def enable_app_extension_library : Flag<["-"], "application-extension-library">,
915912
HelpText<"Restrict code to those available for App Extension Libraries">;
916913

917914
def libc : Separate<["-"], "libc">,
918-
Flags<[SwiftAPIExtractOption, SwiftSymbolGraphExtractOption]>,
915+
Flags<[SwiftSymbolGraphExtractOption]>,
919916
HelpText<"libc runtime library to use">;
920917

921918
// Linker options
@@ -930,7 +927,7 @@ def framework : Separate<["-"], "framework">, Group<linker_option_Group>,
930927
HelpText<"Specifies a framework which should be linked against">;
931928

932929
def L : JoinedOrSeparate<["-"], "L">, Group<linker_option_Group>,
933-
Flags<[FrontendOption, DoesNotAffectIncrementalBuild, ArgumentIsPath, SwiftAPIExtractOption,
930+
Flags<[FrontendOption, DoesNotAffectIncrementalBuild, ArgumentIsPath,
934931
SwiftSymbolGraphExtractOption]>,
935932
HelpText<"Add directory to library link search path">;
936933
def L_EQ : Joined<["-"], "L=">, Group<linker_option_Group>,
@@ -1347,7 +1344,7 @@ def resource_dir : Separate<["-"], "resource-dir">,
13471344
HelpText<"The directory that holds the compiler resource files">;
13481345

13491346
def target : Separate<["-"], "target">,
1350-
Flags<[FrontendOption, ModuleWrapOption, ModuleInterfaceOption, SwiftAPIExtractOption, SwiftSymbolGraphExtractOption,
1347+
Flags<[FrontendOption, ModuleWrapOption, ModuleInterfaceOption, SwiftSymbolGraphExtractOption,
13511348
SwiftAPIDigesterOption]>,
13521349
HelpText<"Generate code for the given target <triple>, such as x86_64-apple-macos10.9">, MetaVarName<"<triple>">;
13531350
def target_legacy_spelling : Joined<["--"], "target=">,
@@ -1365,7 +1362,7 @@ def target_variant : Separate<["-"], "target-variant">,
13651362
" variant target triple in addition to the main -target triple">;
13661363

13671364
def clang_target : Separate<["-"], "clang-target">,
1368-
Flags<[FrontendOption, SwiftAPIExtractOption, SwiftSymbolGraphExtractOption, SwiftAPIDigesterOption]>,
1365+
Flags<[FrontendOption, SwiftSymbolGraphExtractOption, SwiftAPIDigesterOption]>,
13691366
HelpText<"Separately set the target we should use for internal Clang instance">;
13701367

13711368
def disable_clang_target : Flag<["-"], "disable-clang-target">,
@@ -1520,7 +1517,7 @@ def allowable_client : Separate<["-"], "allowable-client">,
15201517
// VFS
15211518

15221519
def vfsoverlay : JoinedOrSeparate<["-"], "vfsoverlay">,
1523-
Flags<[FrontendOption, ArgumentIsPath, SwiftAPIExtractOption]>,
1520+
Flags<[FrontendOption, ArgumentIsPath]>,
15241521
HelpText<"Add directory to VFS overlay file">;
15251522
def vfsoverlay_EQ : Joined<["-"], "vfsoverlay=">,
15261523
Alias<vfsoverlay>;
@@ -1568,7 +1565,7 @@ def symbol_graph_minimum_access_level: Separate<["-"], "symbol-graph-minimum-acc
15681565
MetaVarName<"<level>">;
15691566

15701567
def pretty_print: Flag<["-"], "pretty-print">,
1571-
Flags<[SwiftAPIExtractOption, SwiftSymbolGraphExtractOption]>,
1568+
Flags<[SwiftSymbolGraphExtractOption]>,
15721569
HelpText<"Pretty-print the output JSON">;
15731570

15741571
def emit_extension_block_symbols: Flag<["-"], "emit-extension-block-symbols">,
@@ -1977,11 +1974,11 @@ def cache_replay_prefix_map: Separate<["-"], "cache-replay-prefix-map">,
19771974
def plugin_search_Group : OptionGroup<"<plugin search options>">;
19781975

19791976
def plugin_path : Separate<["-"], "plugin-path">, Group<plugin_search_Group>,
1980-
Flags<[FrontendOption, ArgumentIsPath, SwiftAPIExtractOption, SwiftSymbolGraphExtractOption, SwiftAPIDigesterOption]>,
1977+
Flags<[FrontendOption, ArgumentIsPath, SwiftSymbolGraphExtractOption, SwiftAPIDigesterOption]>,
19811978
HelpText<"Add directory to the plugin search path">;
19821979

19831980
def external_plugin_path : Separate<["-"], "external-plugin-path">, Group<plugin_search_Group>,
1984-
Flags<[FrontendOption, ArgumentIsPath, SwiftAPIExtractOption, SwiftSymbolGraphExtractOption, SwiftAPIDigesterOption]>,
1981+
Flags<[FrontendOption, ArgumentIsPath, SwiftSymbolGraphExtractOption, SwiftAPIDigesterOption]>,
19851982
HelpText<"Add directory to the plugin search path with a plugin server executable">,
19861983
MetaVarName<"<path>#<plugin-server-path>">;
19871984

lib/Driver/Driver.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ void Driver::parseDriverKind(ArrayRef<const char *> Args) {
110110
.Case("swift-autolink-extract", DriverKind::AutolinkExtract)
111111
.Case("swift-indent", DriverKind::SwiftIndent)
112112
.Case("swift-symbolgraph-extract", DriverKind::SymbolGraph)
113-
.Case("swift-api-extract", DriverKind::APIExtract)
114113
.Case("swift-api-digester", DriverKind::APIDigester)
115114
.Case("swift-cache-tool", DriverKind::CacheTool)
116115
.Case("swift-parse-test", DriverKind::ParseTest)
@@ -3102,7 +3101,6 @@ void Driver::printHelp(bool ShowHidden) const {
31023101
case DriverKind::AutolinkExtract:
31033102
case DriverKind::SwiftIndent:
31043103
case DriverKind::SymbolGraph:
3105-
case DriverKind::APIExtract:
31063104
case DriverKind::APIDigester:
31073105
case DriverKind::CacheTool:
31083106
case DriverKind::ParseTest:

lib/DriverTool/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ set(driver_sources_and_options
1313
swift_cache_tool_main.cpp
1414
swift_indent_main.cpp
1515
swift_symbolgraph_extract_main.cpp
16-
swift_api_extract_main.cpp
1716
swift_parse_test_main.cpp)
1817

1918
set(driver_common_libs

lib/DriverTool/driver.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,6 @@ void *MainAddr);
105105
extern int swift_api_digester_main(ArrayRef<const char *> Args,
106106
const char *Argv0, void *MainAddr);
107107

108-
/// Run 'swift-api-extract'
109-
extern int swift_api_extract_main(ArrayRef<const char *> Args,
110-
const char *Argv0, void *MainAddr);
111-
112108
/// Run 'swift-cache-tool'
113109
extern int swift_cache_tool_main(ArrayRef<const char *> Args, const char *Argv0,
114110
void *MainAddr);
@@ -398,10 +394,6 @@ static int run_driver(StringRef ExecName,
398394
argv[0], (void *)(intptr_t)getExecutablePath);
399395
case Driver::DriverKind::SymbolGraph:
400396
return swift_symbolgraph_extract_main(TheDriver.getArgsWithoutProgramNameAndDriverMode(argv), argv[0], (void *)(intptr_t)getExecutablePath);
401-
case Driver::DriverKind::APIExtract:
402-
return swift_api_extract_main(
403-
TheDriver.getArgsWithoutProgramNameAndDriverMode(argv), argv[0],
404-
(void *)(intptr_t)getExecutablePath);
405397
case Driver::DriverKind::APIDigester:
406398
return swift_api_digester_main(
407399
TheDriver.getArgsWithoutProgramNameAndDriverMode(argv), argv[0],

0 commit comments

Comments
 (0)