@@ -59,18 +59,18 @@ extension Driver {
59
59
fileSystem: FileSystem ,
60
60
executor: DriverExecutor , env: [ String : String ] )
61
61
throws -> Set < String > {
62
- // TODO: Once we are sure libSwiftScan is deployed across supported platforms and architectures
63
- // we should deploy it here .
64
- // let swiftScanLibPath = try Self.getScanLibPath(of: toolchain,
65
- // hostTriple: hostTriple,
66
- // env: env)
67
- //
68
- // if fileSystem.exists(swiftScanLibPath) {
69
- // let libSwiftScanInstance = try SwiftScan(dylib: swiftScanLibPath)
70
- // if libSwiftScanInstance.canQuerySupportedArguments() {
71
- // return try libSwiftScanInstance.querySupportedArguments()
72
- // }
73
- // }
62
+ // if libSwiftScan is present in the toolchain, query the compiler supported features
63
+ // using the SwiftScan interface, instead of calling out to swift-frontend .
64
+ let swiftScanLibPath = try Self . getScanLibPath ( of: toolchain,
65
+ hostTriple: hostTriple,
66
+ env: env)
67
+
68
+ if fileSystem. exists ( swiftScanLibPath) {
69
+ let libSwiftScanInstance = try SwiftScan ( dylib: swiftScanLibPath)
70
+ if libSwiftScanInstance. canQuerySupportedArguments ( ) {
71
+ return try libSwiftScanInstance. querySupportedArguments ( )
72
+ }
73
+ }
74
74
75
75
// Invoke `swift-frontend -emit-supported-features`
76
76
let frontendOverride = try FrontendOverride ( & parsedOptions, diagnosticsEngine)
0 commit comments