@@ -1607,8 +1607,13 @@ extern "C" void LLVMRustComputeLTOCacheKey(RustStringRef KeyOut,
16071607 const auto &ExportList = Data->ExportLists .lookup (ModId);
16081608 const auto &ResolvedODR = Data->ResolvedODR .lookup (ModId);
16091609 const auto &DefinedGlobals = Data->ModuleToDefinedGVSummaries .lookup (ModId);
1610+ #if LLVM_VERSION_GE(20, 0)
1611+ DenseSet<GlobalValue::GUID> CfiFunctionDefs;
1612+ DenseSet<GlobalValue::GUID> CfiFunctionDecls;
1613+ #else
16101614 std::set<GlobalValue::GUID> CfiFunctionDefs;
16111615 std::set<GlobalValue::GUID> CfiFunctionDecls;
1616+ #endif
16121617
16131618 // Based on the 'InProcessThinBackend' constructor in LLVM
16141619 for (auto &Name : Data->Index .cfiFunctionDefs ())
@@ -1618,9 +1623,15 @@ extern "C" void LLVMRustComputeLTOCacheKey(RustStringRef KeyOut,
16181623 CfiFunctionDecls.insert (
16191624 GlobalValue::getGUID (GlobalValue::dropLLVMManglingEscape (Name)));
16201625
1626+ #if LLVM_VERSION_GE(20, 0)
1627+ Key = llvm::computeLTOCacheKey (conf, Data->Index , ModId, ImportList,
1628+ ExportList, ResolvedODR, DefinedGlobals,
1629+ CfiFunctionDefs, CfiFunctionDecls);
1630+ #else
16211631 llvm::computeLTOCacheKey (Key, conf, Data->Index , ModId, ImportList,
16221632 ExportList, ResolvedODR, DefinedGlobals,
16231633 CfiFunctionDefs, CfiFunctionDecls);
1634+ #endif
16241635
16251636 LLVMRustStringWriteImpl (KeyOut, Key.c_str (), Key.size ());
16261637}
0 commit comments