Skip to content

Commit 79d559e

Browse files
committed
[Dependency Scanning] Deprecate and remove -scan-clang-dependencies
Since it was introduced, its use-case has been entirely subsumed by batch scanning.
1 parent 07e07a1 commit 79d559e

File tree

8 files changed

+0
-60
lines changed

8 files changed

+0
-60
lines changed

include/swift/Frontend/FrontendOptions.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ class FrontendOptions {
134134
DumpPCM, ///< Dump information about a precompiled Clang module
135135

136136
ScanDependencies, ///< Scan dependencies of Swift source files
137-
ScanClangDependencies, ///< Scan dependencies of a Clang module
138137
PrintVersion, ///< Print version information.
139138
PrintFeature, ///< Print supported feature of this compiler
140139
};

include/swift/Option/Options.td

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,10 +1121,6 @@ def scan_dependencies : Flag<["-"], "scan-dependencies">,
11211121
HelpText<"Scan dependencies of the given Swift sources">, ModeOpt,
11221122
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild]>;
11231123

1124-
def scan_clang_dependencies : Flag<["-"], "scan-clang-dependencies">,
1125-
HelpText<"Scan dependencies of the given Clang module">, ModeOpt,
1126-
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild]>;
1127-
11281124
def emit_supported_features : Flag<["-"], "emit-supported-features">,
11291125
HelpText<"Emit a JSON file including all supported compiler features">, ModeOpt,
11301126
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild]>;

include/swift/SwiftScan/ScanDependencies.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ struct BatchScanInput {
4040
/// (-scan-dependencies), where the module dependency cache is not shared.
4141
bool scanAndOutputDependencies(CompilerInstance &instance);
4242

43-
/// Scans the dependencies of the underlying clang module of the main module
44-
/// of \c instance.
45-
bool scanClangDependencies(CompilerInstance &instance);
46-
4743
/// Scans the dependencies of the main module of \c instance.
4844
bool scanDependencies(CompilerInstance &instance,
4945
ModuleDependenciesCache &cache,

lib/Frontend/ArgsToFrontendOptionsConverter.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,6 @@ ArgsToFrontendOptionsConverter::determineRequestedAction(const ArgList &args) {
379379
return FrontendOptions::ActionType::EmitImportedModules;
380380
if (Opt.matches(OPT_scan_dependencies))
381381
return FrontendOptions::ActionType::ScanDependencies;
382-
if (Opt.matches(OPT_scan_clang_dependencies))
383-
return FrontendOptions::ActionType::ScanClangDependencies;
384382
if (Opt.matches(OPT_parse))
385383
return FrontendOptions::ActionType::Parse;
386384
if (Opt.matches(OPT_resolve_imports))

lib/Frontend/FrontendOptions.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ bool FrontendOptions::needsProperModuleName(ActionType action) {
6666
case ActionType::DumpTypeInfo:
6767
case ActionType::EmitPCM:
6868
case ActionType::ScanDependencies:
69-
case ActionType::ScanClangDependencies:
7069
return true;
7170
}
7271
llvm_unreachable("Unknown ActionType");
@@ -80,7 +79,6 @@ bool FrontendOptions::shouldActionOnlyParse(ActionType action) {
8079
case ActionType::DumpInterfaceHash:
8180
case ActionType::EmitImportedModules:
8281
case ActionType::ScanDependencies:
83-
case ActionType::ScanClangDependencies:
8482
case ActionType::PrintVersion:
8583
case ActionType::PrintFeature:
8684
return true;
@@ -98,7 +96,6 @@ bool FrontendOptions::doesActionRequireSwiftStandardLibrary(ActionType action) {
9896
case ActionType::DumpInterfaceHash:
9997
case ActionType::EmitImportedModules:
10098
case ActionType::ScanDependencies:
101-
case ActionType::ScanClangDependencies:
10299
case ActionType::PrintVersion:
103100
case ActionType::EmitPCH:
104101
case ActionType::EmitPCM:
@@ -146,7 +143,6 @@ bool FrontendOptions::doesActionRequireInputs(ActionType action) {
146143
case ActionType::DumpInterfaceHash:
147144
case ActionType::EmitImportedModules:
148145
case ActionType::ScanDependencies:
149-
case ActionType::ScanClangDependencies:
150146
case ActionType::EmitPCH:
151147
case ActionType::EmitPCM:
152148
case ActionType::DumpPCM:
@@ -191,7 +187,6 @@ bool FrontendOptions::doesActionPerformEndOfPipelineActions(ActionType action) {
191187
case ActionType::DumpInterfaceHash:
192188
case ActionType::EmitImportedModules:
193189
case ActionType::ScanDependencies:
194-
case ActionType::ScanClangDependencies:
195190
case ActionType::CompileModuleFromInterface:
196191
case ActionType::TypecheckModuleFromInterface:
197192
case ActionType::ResolveImports:
@@ -308,7 +303,6 @@ FrontendOptions::formatForPrincipalOutputFileForAction(ActionType action) {
308303
return TY_ClangModuleFile;
309304

310305
case ActionType::ScanDependencies:
311-
case ActionType::ScanClangDependencies:
312306
return TY_JSONDependencies;
313307
case ActionType::PrintFeature:
314308
return TY_JSONFeatures;
@@ -352,7 +346,6 @@ bool FrontendOptions::canActionEmitDependencies(ActionType action) {
352346
case ActionType::EmitImportedModules:
353347
case ActionType::EmitPCM:
354348
case ActionType::ScanDependencies:
355-
case ActionType::ScanClangDependencies:
356349
return true;
357350
}
358351
llvm_unreachable("unhandled action");
@@ -378,7 +371,6 @@ bool FrontendOptions::canActionEmitReferenceDependencies(ActionType action) {
378371
case ActionType::EmitPCM:
379372
case ActionType::DumpPCM:
380373
case ActionType::ScanDependencies:
381-
case ActionType::ScanClangDependencies:
382374
case ActionType::PrintVersion:
383375
case ActionType::PrintFeature:
384376
return false;
@@ -432,7 +424,6 @@ bool FrontendOptions::canActionEmitModuleSummary(ActionType action) {
432424
case ActionType::EmitPCM:
433425
case ActionType::DumpPCM:
434426
case ActionType::ScanDependencies:
435-
case ActionType::ScanClangDependencies:
436427
case ActionType::Typecheck:
437428
case ActionType::MergeModules:
438429
case ActionType::EmitModuleOnly:
@@ -471,7 +462,6 @@ bool FrontendOptions::canActionEmitObjCHeader(ActionType action) {
471462
case ActionType::EmitPCM:
472463
case ActionType::DumpPCM:
473464
case ActionType::ScanDependencies:
474-
case ActionType::ScanClangDependencies:
475465
case ActionType::PrintVersion:
476466
case ActionType::PrintFeature:
477467
return false;
@@ -511,7 +501,6 @@ bool FrontendOptions::canActionEmitLoadedModuleTrace(ActionType action) {
511501
case ActionType::EmitPCM:
512502
case ActionType::DumpPCM:
513503
case ActionType::ScanDependencies:
514-
case ActionType::ScanClangDependencies:
515504
case ActionType::PrintVersion:
516505
case ActionType::PrintFeature:
517506
return false;
@@ -557,7 +546,6 @@ bool FrontendOptions::canActionEmitModule(ActionType action) {
557546
case ActionType::EmitPCM:
558547
case ActionType::DumpPCM:
559548
case ActionType::ScanDependencies:
560-
case ActionType::ScanClangDependencies:
561549
case ActionType::PrintVersion:
562550
case ActionType::PrintFeature:
563551
return false;
@@ -604,7 +592,6 @@ bool FrontendOptions::canActionEmitInterface(ActionType action) {
604592
case ActionType::EmitPCM:
605593
case ActionType::DumpPCM:
606594
case ActionType::ScanDependencies:
607-
case ActionType::ScanClangDependencies:
608595
case ActionType::PrintFeature:
609596
return false;
610597
case ActionType::Typecheck:
@@ -652,7 +639,6 @@ bool FrontendOptions::doesActionProduceOutput(ActionType action) {
652639
case ActionType::EmitPCM:
653640
case ActionType::DumpPCM:
654641
case ActionType::ScanDependencies:
655-
case ActionType::ScanClangDependencies:
656642
case ActionType::PrintFeature:
657643
return true;
658644

@@ -700,7 +686,6 @@ bool FrontendOptions::doesActionProduceTextualOutput(ActionType action) {
700686
case ActionType::DumpTypeInfo:
701687
case ActionType::DumpPCM:
702688
case ActionType::ScanDependencies:
703-
case ActionType::ScanClangDependencies:
704689
case ActionType::PrintVersion:
705690
case ActionType::PrintFeature:
706691
return true;
@@ -728,7 +713,6 @@ bool FrontendOptions::doesActionGenerateSIL(ActionType action) {
728713
case ActionType::EmitPCM:
729714
case ActionType::DumpPCM:
730715
case ActionType::ScanDependencies:
731-
case ActionType::ScanClangDependencies:
732716
case ActionType::PrintVersion:
733717
case ActionType::PrintFeature:
734718
return false;
@@ -777,7 +761,6 @@ bool FrontendOptions::doesActionGenerateIR(ActionType action) {
777761
case ActionType::EmitPCM:
778762
case ActionType::DumpPCM:
779763
case ActionType::ScanDependencies:
780-
case ActionType::ScanClangDependencies:
781764
case ActionType::PrintVersion:
782765
case ActionType::PrintFeature:
783766
return false;

lib/FrontendTool/FrontendTool.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,8 +1225,6 @@ static bool performAction(CompilerInstance &Instance,
12251225
// MARK: Dependency Scanning Actions
12261226
case FrontendOptions::ActionType::ScanDependencies:
12271227
return performScanDependencies(Instance);
1228-
case FrontendOptions::ActionType::ScanClangDependencies:
1229-
return dependencies::scanClangDependencies(Instance);
12301228

12311229
// MARK: General Compilation Actions
12321230
case FrontendOptions::ActionType::Parse:

lib/SwiftScan/ScanDependencies.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -726,15 +726,6 @@ bool swift::dependencies::executeSingleModuleScan(CompilerInstance &instance,
726726
return false;
727727
}
728728

729-
bool swift::dependencies::scanClangDependencies(CompilerInstance &instance) {
730-
ModuleDependenciesCache cache;
731-
return executeSingleModuleScan(instance, cache,
732-
instance.getMainModule()->getNameStr(),
733-
/*isClang*/true,
734-
instance.getInvocation().getFrontendOptions()
735-
.InputsAndOutputs.getSingleOutputFilename());
736-
}
737-
738729
bool
739730
swift::dependencies::batchScanDependencies(CompilerInstance &instance,
740731
llvm::StringRef batchInputFile) {

test/ScanDependencies/module_deps_clang_only.swift

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)