Commit Graph

63 Commits

Author SHA1 Message Date
Artem Chikin
e1b3ad8b10 [Dependency Scanning] Reset LLVM option occurences for each libSwiftScan query
We must reset option occurences on each individual query because when an instance of the scanning tool is re-used in different contexts/different scans, we will be creating multiple compilation instances and re-parsing various (potentially-repeating) arguments.

Resolves rdar://75247030
2021-04-14 16:40:09 -07:00
Artem Chikin
39483f0a91 [Dependency Scanning] Cache compiler instance/module depenency cache used for batched versioned-PCM scans. 2021-01-07 09:08:21 -08:00
Artem Chikin
41a09a4092 [Dependency Scanning] Establish object ownership convention by using a Foundation-style ownership signals naming scheme across the API surface.
Foundation-style ownership signals documentation:
https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFMemoryMgmt/Concepts/Ownership.html#//apple_ref/doc/uid/20001148-CJBEJBHH
2021-01-07 09:08:21 -08:00
Artem Chikin
f91c8a8574 [Dependency Scanning] Refactor string implementation to always malloc and tie lifetime to owning object. 2021-01-07 09:08:21 -08:00
Artem Chikin
cff741b60f [Dependency Scanning] Make the prescan dependency scan result (import set) an opaque structure 2021-01-07 09:08:20 -08:00
Artem Chikin
409de733f7 [Dependency Scanning] Make the overall dependency scan result (inter-module dependency graph) an opaque structure 2021-01-07 09:08:20 -08:00
Artem Chikin
fcf943370e [Dependency Scanning] Change C API prefix to: swiftscan from ds and adopt query method naming scheme of:
`<prefix>_<object>_<action>`
2021-01-07 09:08:20 -08:00
Artem Chikin
2ad960083a [Dependency Scanning] Use an opaque type for dependency module details with API query functions for individual fields 2021-01-07 09:08:20 -08:00
Artem Chikin
75b8a0ea44 [Dependency Scanning] Add entry-point to DependencyScanningTool and the corresponding C API for an import prescan operation 2021-01-07 09:08:20 -08:00
Artem Chikin
75a8cfa048 [Dependency Scanning] Add a C API layer for dependency scanning tool, scanning actions, and scan results.
Adds a C API layer consisting of:
- Data structures used to represent in-memory result of dependency scanning
- Opaque dependency scanner tool (C wrapper for `DependencyScanningTool`)

Refactors `ScanDependencies.cpp` to produce dependency scanning result in the form of the above binary format.
2021-01-07 09:08:20 -08:00
Artem Chikin
082fc48b25 [Dependency Scanning] Refactor dependency scanner to return an in-memory format as a result
This commit refactors ScanDependencies.cpp to split the functionality into two functional groups:
- Scan execution code that performs the mechanics of the scan and produces an in-memory result
- Dependency scanner entry-points used when the scanning action is invoked as a `swift-frontend` execution mode
This commit also adds the aforementioned in-memory dependency scanning result in `FullDependencies.h`, modeled after the InterModuleDependencyGraph representation in swift-driver
2021-01-07 09:08:20 -08:00
Artem Chikin
dad14358fb [Dependency Scanning] Factor out import prescan into separate utility 2021-01-07 09:08:20 -08:00
Artem Chikin
aabcb22df1 Rename SwiftScan directory into DependencyScan 2021-01-07 09:08:20 -08:00