@@ -227,16 +227,19 @@ bool Deserializer::readGraph(GlobalModuleDependenciesCache &cache) {
227227 llvm::report_fatal_error (
228228 " Unexpected SWIFT_TEXTUAL_MODULE_DETAILS_NODE record" );
229229 cache.configureForTriple (getTriple ());
230- unsigned interfaceFileID, compiledModuleCandidatesArrayID,
230+ unsigned outputPathFileID, interfaceFileID, compiledModuleCandidatesArrayID,
231231 buildCommandLineArrayID, extraPCMArgsArrayID, contextHashID,
232232 isFramework, bridgingHeaderFileID, sourceFilesArrayID,
233233 bridgingSourceFilesArrayID, bridgingModuleDependenciesArrayID;
234234 SwiftInterfaceModuleDetailsLayout::readRecord (
235- Scratch, interfaceFileID, compiledModuleCandidatesArrayID,
235+ Scratch, outputPathFileID, interfaceFileID, compiledModuleCandidatesArrayID,
236236 buildCommandLineArrayID, extraPCMArgsArrayID, contextHashID,
237237 isFramework, bridgingHeaderFileID, sourceFilesArrayID,
238238 bridgingSourceFilesArrayID, bridgingModuleDependenciesArrayID);
239239
240+ auto outputModulePath = getIdentifier (outputPathFileID);
241+ if (!outputModulePath)
242+ llvm::report_fatal_error (" Bad .swiftmodule output path" );
240243 Optional<std::string> optionalSwiftInterfaceFile;
241244 if (interfaceFileID != 0 ) {
242245 auto swiftInterfaceFile = getIdentifier (interfaceFileID);
@@ -267,6 +270,7 @@ bool Deserializer::readGraph(GlobalModuleDependenciesCache &cache) {
267270
268271 // Form the dependencies storage object
269272 auto moduleDep = ModuleDependencies::forSwiftInterfaceModule (
273+ outputModulePath.getValue (),
270274 optionalSwiftInterfaceFile.getValue (), *compiledModuleCandidates,
271275 buildCommandRefs, extraPCMRefs, *contextHash, isFramework);
272276
@@ -782,6 +786,8 @@ void Serializer::writeModuleInfo(ModuleDependencyID moduleID,
782786 assert (triple.hasValue () && " Expected triple for serializing MODULE_NODE" );
783787 auto swiftTextDeps = dependencyInfo.getAsSwiftInterfaceModule ();
784788 assert (swiftTextDeps);
789+ unsigned outputModulePathFileId =
790+ getIdentifier (swiftTextDeps->moduleOutputPath );
785791 unsigned swiftInterfaceFileId =
786792 getIdentifier (swiftTextDeps->swiftInterfaceFile );
787793 unsigned bridgingHeaderFileId =
@@ -791,6 +797,7 @@ void Serializer::writeModuleInfo(ModuleDependencyID moduleID,
791797 : 0 ;
792798 SwiftInterfaceModuleDetailsLayout::emitRecord (
793799 Out, ScratchRecord, AbbrCodes[SwiftInterfaceModuleDetailsLayout::Code],
800+ outputModulePathFileId,
794801 swiftInterfaceFileId,
795802 getArray (moduleID, ModuleIdentifierArrayKind::CompiledModuleCandidates),
796803 getArray (moduleID, ModuleIdentifierArrayKind::BuildCommandLine),
@@ -981,6 +988,7 @@ void Serializer::collectStringsAndArrays(
981988 case swift::ModuleDependenciesKind::SwiftInterface: {
982989 auto swiftTextDeps = dependencyInfo.getAsSwiftInterfaceModule ();
983990 assert (swiftTextDeps);
991+ addIdentifier (swiftTextDeps->moduleOutputPath );
984992 addIdentifier (swiftTextDeps->swiftInterfaceFile );
985993 addArray (moduleID,
986994 ModuleIdentifierArrayKind::CompiledModuleCandidates,
0 commit comments