[Dependency Scanning] Key into a global (shared) dependency scanning cache via context hash

Introduces a concept of a dependency scanning action context hash, which is used to select an instance of a global dependency scanning cache which gets re-used across dependency scanning actions.
This commit is contained in:
Artem Chikin
2022-12-05 13:51:21 -08:00
parent 91f7ea1ced
commit 990b95e9d8
14 changed files with 148 additions and 88 deletions

View File

@@ -35,9 +35,8 @@ using llvm::BCRecordLayout;
using llvm::BCVBR;
/// Every .moddepcache file begins with these 4 bytes, for easy identification.
const unsigned char MODULE_DEPENDENCY_CACHE_FORMAT_SIGNATURE[] = {'I', 'M', 'D',
'C'};
const unsigned MODULE_DEPENDENCY_CACHE_FORMAT_VERSION_MAJOR = 2;
const unsigned char MODULE_DEPENDENCY_CACHE_FORMAT_SIGNATURE[] = {'I', 'M', 'D','C'};
const unsigned MODULE_DEPENDENCY_CACHE_FORMAT_VERSION_MAJOR = 3;
/// Increment this on every change.
const unsigned MODULE_DEPENDENCY_CACHE_FORMAT_VERSION_MINOR = 0;
@@ -56,7 +55,7 @@ using IdentifierIDArryField = llvm::BCArray<IdentifierIDField>;
/// Identifiers used to refer to the above arrays
using FileIDArrayIDField = IdentifierIDField;
using TripleIDField = IdentifierIDField;
using ContextHashIDField = IdentifierIDField;
using DependencyIDArrayIDField = IdentifierIDField;
using FlagIDArrayIDField = IdentifierIDField;
@@ -118,7 +117,7 @@ using IdentifierArrayLayout =
using ModuleInfoLayout =
BCRecordLayout<MODULE_NODE, // ID
IdentifierIDField, // module name
TripleIDField, // target triple
ContextHashIDField, //
DependencyIDArrayIDField // directDependencies
>;