@@ -121,9 +121,6 @@ void llvm::computeLTOCacheKey(
121121 support::endian::write64le (Data, I);
122122 Hasher.update (Data);
123123 };
124- auto AddUint8 = [&](const uint8_t I) {
125- Hasher.update (ArrayRef<uint8_t >((const uint8_t *)&I, 1 ));
126- };
127124 AddString (Conf.CPU );
128125 // FIXME: Hash more of Options. For now all clients initialize Options from
129126 // command-line flags (which is unsupported in production), but may set
@@ -159,18 +156,18 @@ void llvm::computeLTOCacheKey(
159156 auto ModHash = Index.getModuleHash (ModuleID);
160157 Hasher.update (ArrayRef<uint8_t >((uint8_t *)&ModHash[0 ], sizeof (ModHash)));
161158
162- std::vector<std::pair< uint64_t , uint8_t > > ExportsGUID;
159+ std::vector<uint64_t > ExportsGUID;
163160 ExportsGUID.reserve (ExportList.size ());
164- for (const auto &[VI, ExportType] : ExportList)
165- ExportsGUID.push_back (
166- std::make_pair (VI.getGUID (), static_cast <uint8_t >(ExportType)));
161+ for (const auto &VI : ExportList) {
162+ auto GUID = VI.getGUID ();
163+ ExportsGUID.push_back (GUID);
164+ }
167165
168166 // Sort the export list elements GUIDs.
169167 llvm::sort (ExportsGUID);
170- for (auto [ GUID, ExportType] : ExportsGUID) {
168+ for (uint64_t GUID : ExportsGUID) {
171169 // The export list can impact the internalization, be conservative here
172170 Hasher.update (ArrayRef<uint8_t >((uint8_t *)&GUID, sizeof (GUID)));
173- AddUint8 (ExportType);
174171 }
175172
176173 // Include the hash for every module we import functions from. The set of
@@ -202,21 +199,19 @@ void llvm::computeLTOCacheKey(
202199 [](const ImportModule &Lhs, const ImportModule &Rhs) -> bool {
203200 return Lhs.getHash () < Rhs.getHash ();
204201 });
205- std::vector<std::pair< uint64_t , uint8_t > > ImportedGUIDs;
202+ std::vector<uint64_t > ImportedGUIDs;
206203 for (const ImportModule &Entry : ImportModulesVector) {
207204 auto ModHash = Entry.getHash ();
208205 Hasher.update (ArrayRef<uint8_t >((uint8_t *)&ModHash[0 ], sizeof (ModHash)));
209206
210207 AddUint64 (Entry.getFunctions ().size ());
211208
212209 ImportedGUIDs.clear ();
213- for (auto &[Fn, ImportType] : Entry.getFunctions ())
214- ImportedGUIDs.push_back (std::make_pair (Fn, ImportType) );
210+ for (auto &Fn : Entry.getFunctions ())
211+ ImportedGUIDs.push_back (Fn );
215212 llvm::sort (ImportedGUIDs);
216- for (auto &[ GUID, Type] : ImportedGUIDs) {
213+ for (auto &GUID : ImportedGUIDs)
217214 AddUint64 (GUID);
218- AddUint8 (Type);
219- }
220215 }
221216
222217 // Include the hash for the resolved ODR.
@@ -286,9 +281,9 @@ void llvm::computeLTOCacheKey(
286281 // Imported functions may introduce new uses of type identifier resolutions,
287282 // so we need to collect their used resolutions as well.
288283 for (const ImportModule &ImpM : ImportModulesVector)
289- for (auto &[GUID, UnusedImportType] : ImpM.getFunctions ()) {
284+ for (auto &ImpF : ImpM.getFunctions ()) {
290285 GlobalValueSummary *S =
291- Index.findSummaryInModule (GUID , ImpM.getIdentifier ());
286+ Index.findSummaryInModule (ImpF , ImpM.getIdentifier ());
292287 AddUsedThings (S);
293288 // If this is an alias, we also care about any types/etc. that the aliasee
294289 // may reference.
@@ -1400,7 +1395,6 @@ class lto::ThinBackendProc {
14001395 llvm::StringRef ModulePath,
14011396 const std::string &NewModulePath) {
14021397 std::map<std::string, GVSummaryMapTy> ModuleToSummariesForIndex;
1403-
14041398 std::error_code EC;
14051399 gatherImportedSummariesForModule (ModulePath, ModuleToDefinedGVSummaries,
14061400 ImportList, ModuleToSummariesForIndex);
@@ -1409,8 +1403,6 @@ class lto::ThinBackendProc {
14091403 sys::fs::OpenFlags::OF_None);
14101404 if (EC)
14111405 return errorCodeToError (EC);
1412-
1413- // TODO: Serialize declaration bits to bitcode.
14141406 writeIndexToFile (CombinedIndex, OS, &ModuleToSummariesForIndex);
14151407
14161408 if (ShouldEmitImportsFiles) {
0 commit comments