@@ -1607,8 +1607,13 @@ extern "C" void LLVMRustComputeLTOCacheKey(RustStringRef KeyOut,
1607
1607
const auto &ExportList = Data->ExportLists .lookup (ModId);
1608
1608
const auto &ResolvedODR = Data->ResolvedODR .lookup (ModId);
1609
1609
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
1610
1614
std::set<GlobalValue::GUID> CfiFunctionDefs;
1611
1615
std::set<GlobalValue::GUID> CfiFunctionDecls;
1616
+ #endif
1612
1617
1613
1618
// Based on the 'InProcessThinBackend' constructor in LLVM
1614
1619
for (auto &Name : Data->Index .cfiFunctionDefs ())
@@ -1618,9 +1623,15 @@ extern "C" void LLVMRustComputeLTOCacheKey(RustStringRef KeyOut,
1618
1623
CfiFunctionDecls.insert (
1619
1624
GlobalValue::getGUID (GlobalValue::dropLLVMManglingEscape (Name)));
1620
1625
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
1621
1631
llvm::computeLTOCacheKey (Key, conf, Data->Index , ModId, ImportList,
1622
1632
ExportList, ResolvedODR, DefinedGlobals,
1623
1633
CfiFunctionDefs, CfiFunctionDecls);
1634
+ #endif
1624
1635
1625
1636
LLVMRustStringWriteImpl (KeyOut, Key.c_str (), Key.size ());
1626
1637
}
0 commit comments