swiftlang / swift-driver

Swift compiler driver reimplementation in Swift
Apache License 2.0
795 stars 192 forks source link

Re-land: Allow for non-external lookup of libSwiftScan symbols and centralize the scanning instance use in the driver. #1703

Open artemcm opened 1 week ago

artemcm commented 1 week ago
  • The driver now holds a reference to the 'swiftScanLibInstance' which is shared with the 'interModuleDependencyOracle', but is also used for target info and supported compiler feature queries. This means a single SwiftScan instance is shared across all uses in a given driver instance.
  • Allow SwiftScan to be instantiated without a path to an external 'libSwiftScan.dylib', which will cause it to 'dlopen' with a NULL argument, and expect the scanner symbols to be found in the image that the driver code is a part of. This is useful for when compiler-based tooling (SourceKit) links the driver directly and uses its C API.

Added a deprecation for the prior version of verifyOrCreateScannerInstance.

artemcm commented 1 week ago

@swift-ci test