@@ -57,18 +57,18 @@ swiftscan_batch_scan_dependencies(swiftscan_scanner_t *scanner,
57
57
58
58
std::vector<BatchScanInput> BatchInput;
59
59
for (int i = 0 ; i < batch_input->count ; ++i) {
60
- swiftscan_batch_scan_entry_t &Entry = batch_input->modules [i];
61
- BatchInput.push_back ({swiftscan_get_C_string (Entry.module_name ),
62
- swiftscan_get_C_string (Entry.arguments ),
63
- /* outputPath*/ " " , Entry.is_swift });
60
+ swiftscan_impl_batch_scan_entry_t *Entry =
61
+ unwrap_batch_entry (batch_input->modules [i]);
62
+ BatchInput.push_back ({swiftscan_get_C_string (Entry->module_name ),
63
+ swiftscan_get_C_string (Entry->arguments ),
64
+ /* outputPath*/ " " , Entry->is_swift });
64
65
}
65
66
66
67
// Execute the scan and bridge the result
67
68
auto BatchScanResult =
68
69
ScanningTool->getDependencies (Compilation, BatchInput, {});
69
70
swiftscan_batch_scan_result_t *Result = new swiftscan_batch_scan_result_t ;
70
- auto ResultGraphs =
71
- new swiftscan_dependency_result_t [BatchScanResult.size ()];
71
+ auto ResultGraphs = new swiftscan_dependency_result_t [BatchScanResult.size ()];
72
72
for (size_t i = 0 ; i < BatchScanResult.size (); ++i) {
73
73
auto &ResultOrErr = BatchScanResult[i];
74
74
if (ResultOrErr.getError ())
@@ -237,6 +237,23 @@ swiftscan_clang_detail_get_command_line(swiftscan_module_details_t details) {
237
237
return unwrap_details (details)->clang_details .command_line ;
238
238
}
239
239
240
+ // === Batch Scan Entry Functions ------------------------------------------===//
241
+
242
+ swiftscan_string_t
243
+ swiftscan_batch_scan_entry_get_module_name (swiftscan_batch_scan_entry_t entry) {
244
+ return unwrap_batch_entry (entry)->module_name ;
245
+ }
246
+
247
+ swiftscan_string_t
248
+ swiftscan_batch_scan_entry_get_arguments (swiftscan_batch_scan_entry_t entry) {
249
+ return unwrap_batch_entry (entry)->arguments ;
250
+ }
251
+
252
+ bool swiftscan_batch_scan_entry_get_is_swift (
253
+ swiftscan_batch_scan_entry_t entry) {
254
+ return unwrap_batch_entry (entry)->is_swift ;
255
+ }
256
+
240
257
// === Cleanup Functions ---------------------------------------------------===//
241
258
242
259
void swiftscan_dependency_info_details_dispose (
@@ -285,12 +302,14 @@ void swiftscan_dependency_info_details_dispose(
285
302
delete details_impl;
286
303
}
287
304
288
- void swiftscan_dependency_info_dispose (swiftscan_dependency_info_t *info) {
289
- swiftscan_string_dispose (unwrap_info (info)->module_name );
290
- swiftscan_string_dispose (unwrap_info (info)->module_path );
291
- swiftscan_string_set_dispose (unwrap_info (info)->source_files );
292
- swiftscan_string_set_dispose (unwrap_info (info)->direct_dependencies );
293
- swiftscan_dependency_info_details_dispose (unwrap_info (info)->details );
305
+ void swiftscan_dependency_info_dispose (swiftscan_dependency_info_t info) {
306
+ swiftscan_impl_dependency_info_t *info_impl = unwrap_info (info);
307
+ swiftscan_string_dispose (info_impl->module_name );
308
+ swiftscan_string_dispose (info_impl->module_path );
309
+ swiftscan_string_set_dispose (info_impl->source_files );
310
+ swiftscan_string_set_dispose (info_impl->direct_dependencies );
311
+ swiftscan_dependency_info_details_dispose (info_impl->details );
312
+ delete info_impl;
294
313
}
295
314
296
315
void swiftscan_dependency_set_dispose (swiftscan_dependency_set_t *set) {
@@ -301,8 +320,7 @@ void swiftscan_dependency_set_dispose(swiftscan_dependency_set_t *set) {
301
320
delete set;
302
321
}
303
322
304
- void swiftscan_dependency_result_dispose (
305
- swiftscan_dependency_result_t result) {
323
+ void swiftscan_dependency_result_dispose (swiftscan_dependency_result_t result) {
306
324
swiftscan_impl_dependency_result_t *result_impl = unwrap_result (result);
307
325
swiftscan_string_dispose (result_impl->main_module_name );
308
326
swiftscan_dependency_set_dispose (result_impl->module_set );
@@ -314,10 +332,11 @@ void swiftscan_prescan_result_dispose(swiftscan_prescan_result_t *result) {
314
332
delete result;
315
333
}
316
334
317
- void swiftscan_batch_scan_entry_dispose (swiftscan_batch_scan_entry_t *entry) {
318
- swiftscan_string_dispose (entry->module_name );
319
- swiftscan_string_dispose (entry->arguments );
320
- delete entry;
335
+ void swiftscan_batch_scan_entry_dispose (swiftscan_batch_scan_entry_t entry) {
336
+ swiftscan_impl_batch_scan_entry_t *entry_impl = unwrap_batch_entry (entry);
337
+ swiftscan_string_dispose (entry_impl->module_name );
338
+ swiftscan_string_dispose (entry_impl->arguments );
339
+ delete entry_impl;
321
340
}
322
341
323
342
void swiftscan_batch_scan_input_dispose (swiftscan_batch_scan_input_t *input) {
0 commit comments