@@ -46,8 +46,7 @@ public enum DependencyScanningError: Error, DiagnosticData {
46
46
}
47
47
}
48
48
49
- /// Wrapper for libSwiftScan, taking care of initialization, shutdown, and dependency scanning
50
- /// queries.
49
+ /// Wrapper for libSwiftScan, taking care of initialization, shutdown, and dispatching dependency scanning queries.
51
50
internal final class SwiftScan {
52
51
/// The path to the libSwiftScan dylib.
53
52
let path : AbsolutePath
@@ -66,6 +65,7 @@ internal final class SwiftScan {
66
65
67
66
init ( dylib path: AbsolutePath ) throws {
68
67
self . path = path
68
+ print ( " OPENINGNG : \( path. description) " )
69
69
#if os(Windows)
70
70
self . dylib = try dlopen ( path. pathString, mode: [ ] )
71
71
#else
@@ -169,10 +169,8 @@ internal final class SwiftScan {
169
169
let resultGraphMap = try constructBatchResultGraphs ( for: batchInfos,
170
170
from: batchResultRef. pointee)
171
171
// Free the memory allocated for the in-memory representation of the batch scan
172
- // restult, now that we have translated it.
173
-
174
- // TODO: This segfaults, WHY?
175
- //api.swiftscan_batch_scan_result_dispose(batchResultRefOrNull)
172
+ // result, now that we have translated it.
173
+ api. swiftscan_batch_scan_result_dispose ( batchResultRefOrNull)
176
174
return resultGraphMap
177
175
}
178
176
}
@@ -184,15 +182,15 @@ private extension swiftscan_functions_t {
184
182
// MARK: Optional Methods
185
183
// Future optional methods can be queried here
186
184
185
+
186
+ // MARK: Required Methods
187
187
func loadRequired< T> ( _ symbol: String ) throws -> T {
188
188
guard let sym: T = dlsym ( swiftscan, symbol: symbol) else {
189
189
throw DependencyScanningError . missingRequiredSymbol ( symbol)
190
190
}
191
191
return sym
192
192
}
193
193
194
- // MARK: Required Methods
195
-
196
194
self . swiftscan_scanner_create =
197
195
try loadRequired ( " swiftscan_scanner_create " )
198
196
self . swiftscan_scanner_dispose =
0 commit comments