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
d621e22ffe
[Dependency Scanning] Use DEFINE_SIMPLE_CONVERSION_FUNCTIONS macro instead of defining own wrap/unwrap functions for the opaque scanner type.
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
53e53db6c0
[Dependency Scanning] Factor the shared library libSwiftScan into tools and add exports file.
...
This library now relires on a static compiler library called `swiftDependencyScan`, which is also common to being used by `swift-frontend` for its dependency scanner invocations.
2021-01-07 09:08:20 -08:00
Artem Chikin
ca1694442d
[Dependency Scanning] Export opaque types as pointers to C structs instead of void* for better type-safety and cleaner code
2021-01-07 09:08:20 -08:00
Artem Chikin
108e9da448
[Dependency Scanning] Make scanner invocation context (argc, argv, working_dir) an opaque type
2021-01-07 09:08:20 -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
c6705ad090
[Dependency Scanning] Make the batch scan entry container an opaque type
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
5cacff4d84
[Dependency Scanning] Make a module's dependency info 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
d0220e50ff
[Dependency Scanning] Add entry-point to DependencyScanningTool and the corresponding C API for a batch scan operation
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