[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.
This commit is contained in:
Artem Chikin
2024-11-20 13:02:22 -08:00
parent 0234f7ab4a
commit 9055a401a3
13 changed files with 279 additions and 540 deletions

View File

@@ -145,18 +145,6 @@ void swiftscan_dependency_set_dispose(swiftscan_dependency_set_t *set) {
//=== Scanner Cache Operations --------------------------------------------===//
void swiftscan_scanner_cache_serialize(swiftscan_scanner_t scanner,
const char * path) {
DependencyScanningTool *ScanningTool = unwrap(scanner);
ScanningTool->serializeCache(path);
}
bool swiftscan_scanner_cache_load(swiftscan_scanner_t scanner,
const char * path) {
DependencyScanningTool *ScanningTool = unwrap(scanner);
return ScanningTool->loadCache(path);
}
void swiftscan_scanner_cache_reset(swiftscan_scanner_t scanner) {
DependencyScanningTool *ScanningTool = unwrap(scanner);
ScanningTool->resetCache();