@@ -22,12 +22,6 @@ using namespace swift::dependencies;
22
22
23
23
DEFINE_SIMPLE_CONVERSION_FUNCTIONS (DependencyScanningTool, swiftscan_scanner_t );
24
24
25
- // === String Functions ----------------------------------------------------===//
26
-
27
- const char *swiftscan_get_C_string (swiftscan_string_ref_t string) {
28
- return static_cast <const char *>(string.data );
29
- }
30
-
31
25
// === Private Cleanup Functions -------------------------------------------===//
32
26
33
27
// / Free the given string.
@@ -124,7 +118,7 @@ swiftscan_dependency_graph_create(swiftscan_scanner_t scanner,
124
118
int argc = invocation->argv ->count ;
125
119
std::vector<const char *> Compilation;
126
120
for (int i = 0 ; i < argc; ++i)
127
- Compilation.push_back (swiftscan_get_C_string (invocation->argv ->strings [i]));
121
+ Compilation.push_back (get_C_string (invocation->argv ->strings [i]));
128
122
129
123
// Execute the scan and bridge the result
130
124
auto ScanResult = ScanningTool->getDependencies (Compilation, {});
@@ -142,13 +136,13 @@ swiftscan_batch_scan_result_create(swiftscan_scanner_t scanner,
142
136
int argc = invocation->argv ->count ;
143
137
std::vector<const char *> Compilation;
144
138
for (int i = 0 ; i < argc; ++i)
145
- Compilation.push_back (swiftscan_get_C_string (invocation->argv ->strings [i]));
139
+ Compilation.push_back (get_C_string (invocation->argv ->strings [i]));
146
140
147
141
std::vector<BatchScanInput> BatchInput;
148
142
for (size_t i = 0 ; i < batch_input->count ; ++i) {
149
143
swiftscan_batch_scan_entry_s *Entry = batch_input->modules [i];
150
- BatchInput.push_back ({swiftscan_get_C_string (Entry->module_name ),
151
- swiftscan_get_C_string (Entry->arguments ),
144
+ BatchInput.push_back ({get_C_string (Entry->module_name ),
145
+ get_C_string (Entry->arguments ),
152
146
/* outputPath*/ " " , Entry->is_swift });
153
147
}
154
148
@@ -176,7 +170,7 @@ swiftscan_import_set_create(swiftscan_scanner_t scanner,
176
170
int argc = invocation->argv ->count ;
177
171
std::vector<const char *> Compilation;
178
172
for (int i = 0 ; i < argc; ++i)
179
- Compilation.push_back (swiftscan_get_C_string (invocation->argv ->strings [i]));
173
+ Compilation.push_back (get_C_string (invocation->argv ->strings [i]));
180
174
181
175
// Execute the scan and bridge the result
182
176
auto PreScanResult = ScanningTool->getImports (Compilation);
0 commit comments