[Dependency Scanning] Make GlobalModuleDependenciesCache aware of the current scanning action's target triple

And only resolve cached dependencies that came from scanning actions with the same target triple.

This change means that the `GlobalModuleDependenciesCache` must be configured with a specific target triple for every scannig action, and it will only resolve previously-found dependencies from previous scannig actions using the exact same triple.

Furthermore, the `GlobalModuleDependenciesCache` separately tracks source-file-based module dependencies as those represent main Swift modules of previous scanning actions, and we must be able to resolve those regardless of the target triple.

Resolves rdar://83105455
This commit is contained in:
Artem Chikin
2021-09-14 19:01:14 -07:00
parent e64a40451b
commit 709676c20c
8 changed files with 580 additions and 389 deletions

View File

@@ -57,6 +57,7 @@ using IdentifierIDArryField = llvm::BCArray<IdentifierIDField>;
/// Identifiers used to refer to the above arrays
using FileIDArrayIDField = IdentifierIDField;
using TripleIDField = IdentifierIDField;
using DependencyIDArrayIDField = IdentifierIDField;
using FlagIDArrayIDField = IdentifierIDField;
@@ -118,6 +119,7 @@ using IdentifierArrayLayout =
using ModuleInfoLayout =
BCRecordLayout<MODULE_NODE, // ID
IdentifierIDField, // module name
TripleIDField, // target triple
DependencyIDArrayIDField // directDependencies
>;