@@ -227,16 +227,19 @@ bool Deserializer::readGraph(GlobalModuleDependenciesCache &cache) {
227
227
llvm::report_fatal_error (
228
228
" Unexpected SWIFT_TEXTUAL_MODULE_DETAILS_NODE record" );
229
229
cache.configureForTriple (getTriple ());
230
- unsigned interfaceFileID, compiledModuleCandidatesArrayID,
230
+ unsigned outputPathFileID, interfaceFileID, compiledModuleCandidatesArrayID,
231
231
buildCommandLineArrayID, extraPCMArgsArrayID, contextHashID,
232
232
isFramework, bridgingHeaderFileID, sourceFilesArrayID,
233
233
bridgingSourceFilesArrayID, bridgingModuleDependenciesArrayID;
234
234
SwiftInterfaceModuleDetailsLayout::readRecord (
235
- Scratch, interfaceFileID, compiledModuleCandidatesArrayID,
235
+ Scratch, outputPathFileID, interfaceFileID, compiledModuleCandidatesArrayID,
236
236
buildCommandLineArrayID, extraPCMArgsArrayID, contextHashID,
237
237
isFramework, bridgingHeaderFileID, sourceFilesArrayID,
238
238
bridgingSourceFilesArrayID, bridgingModuleDependenciesArrayID);
239
239
240
+ auto outputModulePath = getIdentifier (outputPathFileID);
241
+ if (!outputModulePath)
242
+ llvm::report_fatal_error (" Bad .swiftmodule output path" );
240
243
Optional<std::string> optionalSwiftInterfaceFile;
241
244
if (interfaceFileID != 0 ) {
242
245
auto swiftInterfaceFile = getIdentifier (interfaceFileID);
@@ -267,6 +270,7 @@ bool Deserializer::readGraph(GlobalModuleDependenciesCache &cache) {
267
270
268
271
// Form the dependencies storage object
269
272
auto moduleDep = ModuleDependencies::forSwiftInterfaceModule (
273
+ outputModulePath.getValue (),
270
274
optionalSwiftInterfaceFile.getValue (), *compiledModuleCandidates,
271
275
buildCommandRefs, extraPCMRefs, *contextHash, isFramework);
272
276
@@ -782,6 +786,8 @@ void Serializer::writeModuleInfo(ModuleDependencyID moduleID,
782
786
assert (triple.hasValue () && " Expected triple for serializing MODULE_NODE" );
783
787
auto swiftTextDeps = dependencyInfo.getAsSwiftInterfaceModule ();
784
788
assert (swiftTextDeps);
789
+ unsigned outputModulePathFileId =
790
+ getIdentifier (swiftTextDeps->moduleOutputPath );
785
791
unsigned swiftInterfaceFileId =
786
792
getIdentifier (swiftTextDeps->swiftInterfaceFile );
787
793
unsigned bridgingHeaderFileId =
@@ -791,6 +797,7 @@ void Serializer::writeModuleInfo(ModuleDependencyID moduleID,
791
797
: 0 ;
792
798
SwiftInterfaceModuleDetailsLayout::emitRecord (
793
799
Out, ScratchRecord, AbbrCodes[SwiftInterfaceModuleDetailsLayout::Code],
800
+ outputModulePathFileId,
794
801
swiftInterfaceFileId,
795
802
getArray (moduleID, ModuleIdentifierArrayKind::CompiledModuleCandidates),
796
803
getArray (moduleID, ModuleIdentifierArrayKind::BuildCommandLine),
@@ -981,6 +988,7 @@ void Serializer::collectStringsAndArrays(
981
988
case swift::ModuleDependenciesKind::SwiftInterface: {
982
989
auto swiftTextDeps = dependencyInfo.getAsSwiftInterfaceModule ();
983
990
assert (swiftTextDeps);
991
+ addIdentifier (swiftTextDeps->moduleOutputPath );
984
992
addIdentifier (swiftTextDeps->swiftInterfaceFile );
985
993
addArray (moduleID,
986
994
ModuleIdentifierArrayKind::CompiledModuleCandidates,
0 commit comments