swift
eebebd9a - [Dependency Scanning] Do not persist cached Clang module dependencies between scans.

Commit
3 years ago
[Dependency Scanning] Do not persist cached Clang module dependencies between scans. This change tweaks the 'GlobalModuleDependenciesCache', which persists across scanner invocations with the same 'DependencyScanningTool' to no longer cache discovered Clang modules. Doing so felt like a premature optimization, and we should instead attempt to share as much state as possible by keeping around the actual Clang scanner's state, which performs its own caching. Caching discovered dependencies both in the Clang scanner instance, and in our own cache is much more error-prone - the Clang scanner has a richer context for what is okay and not okay to cache/re-use. Instead, we still cache discovered Clang dependencies *within* a given scan, since those are discovered using a common Clang scanner instance and should be safe to keep for the duration of the scan. This change should make it simpler to pin down the core functionality and correctness of the scanner. Once we turn our attention to the scanner's performance, we can revisit this strategy and optimize the caching behaviour.
Author
Committer
Parents
Loading