Skip to content

Commit cdec9a0

Browse files
authored
Rollup merge of #129353 - krasimirgg:llvm20key, r=nikic
llvm-wrapper: adapt for LLVM 20 API changes No functional changes intended. Adapts llvm-wrapper for the LLVM commits llvm/llvm-project@0f22d47 and llvm/llvm-project@d6d8243. `@rustbot` label: +llvm-main r? `@nikic`
2 parents 3fb8faa + b509b42 commit cdec9a0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)