[Dependency Scanning] Serialized Swift binary module serialized search paths

This commit is contained in:
Artem Chikin
2025-06-03 10:10:42 -07:00
parent 90f2fba2ae
commit aedc2fadb3
5 changed files with 183 additions and 9 deletions

View File

@@ -41,7 +41,7 @@ using llvm::BCVBR;
const unsigned char MODULE_DEPENDENCY_CACHE_FORMAT_SIGNATURE[] = {'I', 'M', 'D','C'};
const unsigned MODULE_DEPENDENCY_CACHE_FORMAT_VERSION_MAJOR = 9;
/// Increment this on every change.
const unsigned MODULE_DEPENDENCY_CACHE_FORMAT_VERSION_MINOR = 2;
const unsigned MODULE_DEPENDENCY_CACHE_FORMAT_VERSION_MINOR = 3;
/// Various identifiers in this format will rely on having their strings mapped
/// using this ID.
@@ -78,6 +78,7 @@ using ModuleCacheKeyIDField = IdentifierIDField;
using ImportArrayIDField = IdentifierIDField;
using LinkLibrariesArrayIDField = IdentifierIDField;
using MacroDependenciesArrayIDField = IdentifierIDField;
using SearchPathArrayIDField = IdentifierIDField;
using FlagIDArrayIDField = IdentifierIDField;
using DependencyIDArrayIDField = IdentifierIDField;
using SourceLocationIDArrayIDField = IdentifierIDField;
@@ -101,6 +102,8 @@ enum {
LINK_LIBRARY_ARRAY_NODE,
MACRO_DEPENDENCY_NODE,
MACRO_DEPENDENCY_ARRAY_NODE,
SEARCH_PATH_NODE,
SEARCH_PATH_ARRAY_NODE,
IMPORT_STATEMENT_NODE,
IMPORT_STATEMENT_ARRAY_NODE,
OPTIONAL_IMPORT_STATEMENT_ARRAY_NODE,
@@ -169,6 +172,17 @@ using MacroDependencyLayout =
using MacroDependencyArrayLayout =
BCRecordLayout<MACRO_DEPENDENCY_ARRAY_NODE, IdentifierIDArryField>;
// A record for a serialized search pathof a given dependency
// node (Swift binary module dependency only).
using SearchPathLayout =
BCRecordLayout<SEARCH_PATH_NODE, // ID
IdentifierIDField, // path
IsFrameworkField, // isFramework
IsSystemField // isSystem
>;
using SearchPathArrayLayout =
BCRecordLayout<SEARCH_PATH_ARRAY_NODE, IdentifierIDArryField>;
// A record capturing information about a given 'import' statement
// captured in a dependency node, including its source location.
using ImportStatementLayout =
@@ -248,6 +262,7 @@ using SwiftBinaryModuleDetailsLayout =
FileIDField, // definingInterfacePath
IdentifierIDField, // headerModuleDependencies
FileIDArrayIDField, // headerSourceFiles
SearchPathArrayIDField, // serializedSearchPaths
IsFrameworkField, // isFramework
IsStaticField, // isStatic
IdentifierIDField, // moduleCacheKey