Skip to content

Commit 4ca55fd

Browse files
committed
[Dependency Scanning] Deprecate/Remove batch scanning capability
Batch dependency scanning was added as a mechanism to support multiple compilation contexts within a single module dependency graph. The Swift compiler and the Explicitly-built modules model has long since abandoned this approach and this code has long been stale. It is time to remove it.
1 parent bee6273 commit 4ca55fd

File tree

9 files changed

+4
-562
lines changed

9 files changed

+4
-562
lines changed

Sources/CSwiftScan/include/swiftscan_header.h

Lines changed: 4 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#include <stddef.h>
1818
#include <stdint.h>
1919

20-
#define SWIFTSCAN_VERSION_MAJOR 0
21-
#define SWIFTSCAN_VERSION_MINOR 10
20+
#define SWIFTSCAN_VERSION_MAJOR 1
21+
#define SWIFTSCAN_VERSION_MINOR 0
2222

2323
//=== Public Scanner Data Types -------------------------------------------===//
2424

@@ -66,18 +66,6 @@ typedef struct {
6666
size_t count;
6767
} swiftscan_link_library_set_t;
6868

69-
//=== Batch Scan Input Specification --------------------------------------===//
70-
71-
typedef struct swiftscan_batch_scan_entry_s *swiftscan_batch_scan_entry_t;
72-
typedef struct {
73-
swiftscan_batch_scan_entry_t *modules;
74-
size_t count;
75-
} swiftscan_batch_scan_input_t;
76-
typedef struct {
77-
swiftscan_dependency_graph_t *results;
78-
size_t count;
79-
} swiftscan_batch_scan_result_t;
80-
8169
//=== Scanner Invocation Specification ------------------------------------===//
8270

8371
typedef struct swiftscan_scan_invocation_s *swiftscan_scan_invocation_t;
@@ -198,28 +186,6 @@ typedef struct {
198186
swiftscan_string_ref_t
199187
(*swiftscan_clang_detail_get_module_cache_key)(swiftscan_module_details_t);
200188

201-
//=== Batch Scan Input Functions ------------------------------------------===//
202-
swiftscan_batch_scan_input_t *
203-
(*swiftscan_batch_scan_input_create)(void);
204-
void
205-
(*swiftscan_batch_scan_input_set_modules)(swiftscan_batch_scan_input_t *, int, swiftscan_batch_scan_entry_t *);
206-
207-
//=== Batch Scan Entry Functions ------------------------------------------===//
208-
swiftscan_batch_scan_entry_t
209-
(*swiftscan_batch_scan_entry_create)(void);
210-
void
211-
(*swiftscan_batch_scan_entry_set_module_name)(swiftscan_batch_scan_entry_t, const char *);
212-
void
213-
(*swiftscan_batch_scan_entry_set_arguments)(swiftscan_batch_scan_entry_t, const char *);
214-
void
215-
(*swiftscan_batch_scan_entry_set_is_swift)(swiftscan_batch_scan_entry_t, bool);
216-
swiftscan_string_ref_t
217-
(*swiftscan_batch_scan_entry_get_module_name)(swiftscan_batch_scan_entry_t);
218-
swiftscan_string_ref_t
219-
(*swiftscan_batch_scan_entry_get_arguments)(swiftscan_batch_scan_entry_t);
220-
bool
221-
(*swiftscan_batch_scan_entry_get_is_swift)(swiftscan_batch_scan_entry_t);
222-
223189
//=== Prescan Result Functions --------------------------------------------===//
224190
swiftscan_string_set_t *
225191
(*swiftscan_import_set_get_imports)(swiftscan_import_set_t);
@@ -249,14 +215,6 @@ typedef struct {
249215
(*swiftscan_dependency_graph_dispose)(swiftscan_dependency_graph_t);
250216
void
251217
(*swiftscan_import_set_dispose)(swiftscan_import_set_t);
252-
void
253-
(*swiftscan_batch_scan_entry_dispose)(swiftscan_batch_scan_entry_t);
254-
void
255-
(*swiftscan_batch_scan_input_dispose)(swiftscan_batch_scan_input_t *);
256-
void
257-
(*swiftscan_batch_scan_result_dispose)(swiftscan_batch_scan_result_t *);
258-
void
259-
(*swiftscan_scan_invocation_dispose)(swiftscan_scan_invocation_t);
260218

261219
//=== Target Info Functions-------- ---------------------------------------===//
262220
swiftscan_string_ref_t
@@ -274,10 +232,6 @@ typedef struct {
274232
void (*swiftscan_scanner_dispose)(swiftscan_scanner_t);
275233
swiftscan_dependency_graph_t
276234
(*swiftscan_dependency_graph_create)(swiftscan_scanner_t, swiftscan_scan_invocation_t);
277-
swiftscan_batch_scan_result_t *
278-
(*swiftscan_batch_scan_result_create)(swiftscan_scanner_t,
279-
swiftscan_batch_scan_input_t *,
280-
swiftscan_scan_invocation_t);
281235
swiftscan_import_set_t
282236
(*swiftscan_import_set_create)(swiftscan_scanner_t, swiftscan_scan_invocation_t);
283237

@@ -294,6 +248,8 @@ typedef struct {
294248
(*swiftscan_diagnostic_get_source_location)(swiftscan_diagnostic_info_t);
295249
void
296250
(*swiftscan_diagnostics_set_dispose)(swiftscan_diagnostic_set_t*);
251+
void
252+
(*swiftscan_scan_invocation_dispose)(swiftscan_scan_invocation_t);
297253

298254
//=== Source Location -----------------------------------------------------===//
299255
swiftscan_string_ref_t

Sources/SwiftDriver/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
# See http://swift.org/CONTRIBUTORS.txt for Swift project authors
88

99
add_library(SwiftDriver
10-
"ExplicitModuleBuilds/ClangVersionedDependencyResolution.swift"
1110
"ExplicitModuleBuilds/ExplicitDependencyBuildPlanner.swift"
1211
"ExplicitModuleBuilds/ModuleDependencyScanning.swift"
1312
"ExplicitModuleBuilds/SerializableModuleArtifacts.swift"

Sources/SwiftDriver/ExplicitModuleBuilds/ClangVersionedDependencyResolution.swift

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

Sources/SwiftDriver/ExplicitModuleBuilds/InterModuleDependencies/InterModuleDependencyOracle.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,6 @@ public class InterModuleDependencyOracle {
5656
diagnostics: &diagnostics)
5757
}
5858

59-
@_spi(Testing) public func getBatchDependencies(workingDirectory: AbsolutePath,
60-
moduleAliases: [String: String]? = nil,
61-
commandLine: [String],
62-
batchInfos: [BatchScanModuleInfo],
63-
diagnostics: inout [ScannerDiagnosticPayload])
64-
throws -> [ModuleDependencyId: [InterModuleDependencyGraph]] {
65-
precondition(hasScannerInstance)
66-
return try swiftScanLibInstance!.batchScanDependencies(workingDirectory: workingDirectory,
67-
moduleAliases: moduleAliases,
68-
invocationCommand: commandLine,
69-
batchInfos: batchInfos,
70-
diagnostics: &diagnostics)
71-
}
72-
7359
@_spi(Testing) public func getImports(workingDirectory: AbsolutePath,
7460
moduleAliases: [String: String]? = nil,
7561
commandLine: [String],

0 commit comments

Comments
 (0)