[Dependency Scanning] Break out Swift overlay dependencies into separate output category

Instead of being a part of 'directDependencies' on a module dependency info, make them a separate array of dependency IDs for Swift Source and Textual modules.

This will allow clients to still distinguish direct module dependencies imported from a given module, versus dependencies added because direct/transitive Clang module dependencies have Swift overlays.

This change does *not* remove overlay dependencies from 'directDependencies' yet, just adds them as a separate field on the module details info. A followup change will remove overlay and bridging header dependencies from 'directDependencies' once the clients have had a chance to adopt to this change.
This commit is contained in:
Artem Chikin
2023-05-19 12:02:14 -07:00
parent 878066bcd2
commit 5ca91786ec
12 changed files with 277 additions and 140 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 = 4;
/// Increment this on every change.
const unsigned MODULE_DEPENDENCY_CACHE_FORMAT_VERSION_MINOR = 0;
const unsigned MODULE_DEPENDENCY_CACHE_FORMAT_VERSION_MINOR = 1;
/// Various identifiers in this format will rely on having their strings mapped
/// using this ID.
@@ -139,7 +139,8 @@ using SwiftInterfaceModuleDetailsLayout =
FileIDField, // bridgingHeaderFile
FileIDArrayIDField, // sourceFiles
FileIDArrayIDField, // bridgingSourceFiles
FileIDArrayIDField // bridgingModuleDependencies
FileIDArrayIDField, // bridgingModuleDependencies
DependencyIDArrayIDField // swiftOverlayDependencies
>;
using SwiftSourceModuleDetailsLayout =
@@ -148,7 +149,8 @@ using SwiftSourceModuleDetailsLayout =
FileIDField, // bridgingHeaderFile
FileIDArrayIDField, // sourceFiles
FileIDArrayIDField, // bridgingSourceFiles
FileIDArrayIDField // bridgingModuleDependencies
FileIDArrayIDField, // bridgingModuleDependencies
DependencyIDArrayIDField // swiftOverlayDependencies
>;
using SwiftBinaryModuleDetailsLayout =