@@ -474,11 +474,12 @@ bool ModuleDependenciesCacheDeserializer::readGraph(SwiftDependencyScanningServi
474
474
" Unexpected SWIFT_BINARY_MODULE_DETAILS_NODE record" );
475
475
cache.configureForContextHash (getContextHash ());
476
476
unsigned compiledModulePathID, moduleDocPathID, moduleSourceInfoPathID,
477
- headerImportsArrayID, isFramework, moduleCacheKeyID;
477
+ overlayDependencyIDArrayID, headerImportsArrayID, isFramework,
478
+ moduleCacheKeyID;
478
479
SwiftBinaryModuleDetailsLayout::readRecord (
479
480
Scratch, compiledModulePathID, moduleDocPathID,
480
- moduleSourceInfoPathID, headerImportsArrayID, isFramework ,
481
- moduleCacheKeyID);
481
+ moduleSourceInfoPathID, overlayDependencyIDArrayID ,
482
+ headerImportsArrayID, isFramework, moduleCacheKeyID);
482
483
483
484
auto compiledModulePath = getIdentifier (compiledModulePathID);
484
485
if (!compiledModulePath)
@@ -503,6 +504,12 @@ bool ModuleDependenciesCacheDeserializer::readGraph(SwiftDependencyScanningServi
503
504
*currentModuleImports, *currentOptionalModuleImports,
504
505
*headerImports, isFramework, *moduleCacheKey);
505
506
507
+ // Add Swift overlay dependencies
508
+ auto overlayModuleDependencyIDs = getModuleDependencyIDArray (overlayDependencyIDArrayID);
509
+ if (!overlayModuleDependencyIDs.has_value ())
510
+ llvm::report_fatal_error (" Bad overlay dependencies: no qualified dependencies" );
511
+ moduleDep.setOverlayDependencies (overlayModuleDependencyIDs.value ());
512
+
506
513
cache.recordDependency (currentModuleName, std::move (moduleDep),
507
514
getContextHash ());
508
515
hasCurrentModule = false ;
@@ -999,6 +1006,7 @@ void ModuleDependenciesCacheSerializer::writeModuleInfo(
999
1006
getIdentifier (swiftBinDeps->compiledModulePath ),
1000
1007
getIdentifier (swiftBinDeps->moduleDocPath ),
1001
1008
getIdentifier (swiftBinDeps->sourceInfoPath ),
1009
+ getArrayID (moduleID, ModuleIdentifierArrayKind::SwiftOverlayDependencyIDs),
1002
1010
getArrayID (moduleID, ModuleIdentifierArrayKind::DependencyHeaders),
1003
1011
swiftBinDeps->isFramework ,
1004
1012
getIdentifier (swiftBinDeps->moduleCacheKey ));
@@ -1165,7 +1173,7 @@ void ModuleDependenciesCacheSerializer::collectStringsAndArrays(
1165
1173
swiftTextDeps->textualModuleDetails .bridgingModuleDependencies );
1166
1174
addDependencyIDArray (
1167
1175
moduleID, ModuleIdentifierArrayKind::SwiftOverlayDependencyIDs,
1168
- swiftTextDeps->textualModuleDetails . swiftOverlayDependencies );
1176
+ swiftTextDeps->swiftOverlayDependencies );
1169
1177
addIdentifier (swiftTextDeps->textualModuleDetails .CASFileSystemRootID );
1170
1178
addIdentifier (swiftTextDeps->textualModuleDetails
1171
1179
.CASBridgingHeaderIncludeTreeRootID );
@@ -1181,6 +1189,9 @@ void ModuleDependenciesCacheSerializer::collectStringsAndArrays(
1181
1189
addIdentifier (swiftBinDeps->moduleCacheKey );
1182
1190
addStringArray (moduleID, ModuleIdentifierArrayKind::DependencyHeaders,
1183
1191
swiftBinDeps->preCompiledBridgingHeaderPaths );
1192
+ addDependencyIDArray (
1193
+ moduleID, ModuleIdentifierArrayKind::SwiftOverlayDependencyIDs,
1194
+ swiftBinDeps->swiftOverlayDependencies );
1184
1195
break ;
1185
1196
}
1186
1197
case swift::ModuleDependencyKind::SwiftPlaceholder: {
@@ -1210,7 +1221,7 @@ void ModuleDependenciesCacheSerializer::collectStringsAndArrays(
1210
1221
swiftSourceDeps->textualModuleDetails .bridgingModuleDependencies );
1211
1222
addDependencyIDArray (
1212
1223
moduleID, ModuleIdentifierArrayKind::SwiftOverlayDependencyIDs,
1213
- swiftSourceDeps->textualModuleDetails . swiftOverlayDependencies );
1224
+ swiftSourceDeps->swiftOverlayDependencies );
1214
1225
addStringArray (
1215
1226
moduleID, ModuleIdentifierArrayKind::BuildCommandLine,
1216
1227
swiftSourceDeps->textualModuleDetails .buildCommandLine );
0 commit comments