Index: lib/LTO/ThinLTOCodeGenerator.cpp =================================================================== --- lib/LTO/ThinLTOCodeGenerator.cpp +++ lib/LTO/ThinLTOCodeGenerator.cpp @@ -952,9 +952,12 @@ // Make sure that every module has an entry in the ExportLists and // ResolvedODR maps to enable threaded access to these maps below. - for (auto &DefinedGVSummaries : ModuleToDefinedGVSummaries) { - ExportLists[DefinedGVSummaries.first()]; - ResolvedODR[DefinedGVSummaries.first()]; + for (auto &Module : Modules) { + auto ModuleIdentifier = Module.getBufferIdentifier(); + ExportLists[ModuleIdentifier]; + ImportLists[ModuleIdentifier]; + ResolvedODR[ModuleIdentifier]; + ModuleToDefinedGVSummaries[ModuleIdentifier]; } // Compute the ordering we will process the inputs: the rough heuristic here