Commit Graph

18 Commits

Author SHA1 Message Date
Artem Chikin
5eb85acad5 Merge pull request #82031 from artemcm/RemovePlaceholdersInDepScanner
[Dependency Scanning] Remove obsolete placeholder module concept
2025-06-18 12:40:30 -07:00
Artem Chikin
a78ee29692 [Dependency Scanning] Remove obsolete placeholder module concept
This was used a long time ago for a design of a scanner which could rely on the client to specify that some modules *will be* present at a given location but are not yet during the scan. We have long ago determined that the scanner must have all modules available to it at the time of scan for soundness. This code has been stale for a couple of years and it is time to simplify things a bit by deleting it.
2025-06-12 08:32:25 -07:00
Artem Chikin
c3ce91e071 [Dependency Scanning] Add libSwiftScan API and JSON output for source import information 2025-06-12 06:56:33 -07:00
Artem Chikin
c1991d7e7e [Dependency Scanning][libSwiftScan] Deprecate scanner-global diagnostic collection
All clients are expected to have switched to the per-scan-query diagnostics using 'swiftscan_dependency_graph_get_diagnostics'
2025-05-05 10:33:15 -07:00
Artem Chikin
7c5d8b24d3 [Dependency Scanning] Add a field of source-imported dependencies
For the main source module, provide info on which dependencies are directly imported into the user program, explicitly ('import' statement) or implicitly (e.g. stdlib). Thist list does not include Swift overlay dependencies, cross-import dependencies, bridging header dependencies.
2025-04-30 10:15:20 -07:00
Ben Barham
7f67eb3fc5 [SwiftScan] Move lib_InternalSwiftScan from host into host/compiler
... to match the move of the swift-syntax libs.

Resolves rdar://145002415.
2025-02-20 17:08:59 -08:00
Saleem Abdulrasool
9c85fbc8da AST,DependencyScan,IRGen,Serialization,Tooling: track library style (#78777)
Track if the dependency is static or dynamic. This is in preparation for
helping rename the static library to differentiate it from import
libraries.
2025-02-06 13:22:56 -08:00
Steven Wu
9d59044bb1 [BrdigingHeader] Auto bridging header chaining
Add ability to automatically chaining the bridging headers discovered from all
dependencies module when doing swift caching build. This will eliminate all
implicit bridging header imports from the build and make the bridging header
importing behavior much more reliable, while keep the compatibility at maximum.

For example, if the current module A depends on module B and C, and both B and
C are binary modules that uses bridging header, when building module A,
dependency scanner will construct a new header that chains three bridging
headers together with the option to build a PCH from it. This will make all
importing errors more obvious while improving the performance.
2025-02-05 09:41:04 -08:00
Artem Chikin
9e5c40092e [Dependency Scanning] Make deprecated PCM arg libSwiftScan stubs return empty sets instead of nullptr
Recent change deprecated these methods and made the stubs return nullptr instead of empty sets, which will still trigger an error in a driver which pre-dates the change.
2025-01-31 10:25:34 -08:00
Artem Chikin
477ba0dd97 [Dependency Scanning] Remove references to per-triple PCM variant compilation 2025-01-29 11:32:07 -08:00
Artem Chikin
41e471288a [Dependency Scanning] Deprecate/Remove batch scanning capability
Batch dependency scanning was added as a mechanism to support multiple compilation contexts within a single module dependency graph.
The Swift compiler and the Explicitly-built modules model has long since abandoned this approach and this code has long been stale. It is time to remove it and its associated C API.
2025-01-28 15:30:39 -08:00
Artem Chikin
a46e33143a [Dependency Scanning] Modernize and revive the module dependencies cache serialization format
This format has gotten stale and been not in use for many months. This commit restores primary functionality of the format.
2025-01-06 09:09:27 -08:00
Steven Wu
627c64f391 [Caching][NFC] Unify the two cache replay code path
There were two cache replay code exists, one for cache replay from
swift-frontend, the other for replay using C API from libSwiftScan. It
is easy to forget to update one copy when new specialized cache replay
logic is added for some output kinds. Now unify the replay logics to a
single location to avoid confusion. This is a rewrite of the existing
logic and NFCI.
2024-12-19 14:10:46 -08:00
Steven Wu
f073d16c43 [Caching] Fix symbol graph output from driver APIs
Add the logics to replay symbol graph output from driver APIs.
2024-12-18 14:44:01 -08:00
Steven Wu
a22bd3ad80 [MCCAS] Simplify MCCAS replay logic. NFC 2024-12-18 14:44:01 -08:00
Steven Wu
58d71379aa [Caching] Fix cache replay logics for makefile dependency file
Make sure the driver replay logics from C API can replay makefile
dependency file correctly.

rdar://141567785
2024-12-18 14:44:00 -08:00
Artem Chikin
9055a401a3 [Dependency Scanner] Refactor the global scanning service to no longer maintain scanner cache state
Instead, each scan's 'ModuleDependenciesCache' will hold all of the data corresponding to discovered module dependencies.

The initial design presumed the possibility of sharing a global scanning cache amongs different scanner invocations, possibly even different concurrent scanner invocations.

This change also deprecates two libSwiftScan entry-points: 'swiftscan_scanner_cache_load' and 'swiftscan_scanner_cache_serialize'. They never ended up getting used, and since this code has been largely stale, we are confident they have not otherwise had users, and they do not fit with this design.

A follow-up change will re-introduce moduele dependency cache serialization on a per-query basis and bring the binary format up-to-date.
2024-12-04 11:13:05 -08:00
Artem Chikin
338b9141e3 Move libSwiftScan from 'tools' to 'lib/Tooling'
'tools' should be reserved for executable tools.
2024-11-14 08:44:32 -08:00