Skip to content

Commit 4c20fe8

Browse files
authored
Rollup merge of #138420 - zmodem:cfifunctionindex_fix, r=durin42
Adapt to LLVM dropping CfiFunctionIndex::begin()/end() After llvm/llvm-project#130382, RustWrapper needs to call CfiFunctionIndex::symbols() instead.
2 parents 9339bc6 + eb2e421 commit 4c20fe8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -1682,12 +1682,21 @@ extern "C" void LLVMRustComputeLTOCacheKey(RustStringRef KeyOut,
16821682
#endif
16831683

16841684
// Based on the 'InProcessThinBackend' constructor in LLVM
1685+
#if LLVM_VERSION_GE(21, 0)
1686+
for (auto &Name : Data->Index.cfiFunctionDefs().symbols())
1687+
CfiFunctionDefs.insert(
1688+
GlobalValue::getGUID(GlobalValue::dropLLVMManglingEscape(Name)));
1689+
for (auto &Name : Data->Index.cfiFunctionDecls().symbols())
1690+
CfiFunctionDecls.insert(
1691+
GlobalValue::getGUID(GlobalValue::dropLLVMManglingEscape(Name)));
1692+
#else
16851693
for (auto &Name : Data->Index.cfiFunctionDefs())
16861694
CfiFunctionDefs.insert(
16871695
GlobalValue::getGUID(GlobalValue::dropLLVMManglingEscape(Name)));
16881696
for (auto &Name : Data->Index.cfiFunctionDecls())
16891697
CfiFunctionDecls.insert(
16901698
GlobalValue::getGUID(GlobalValue::dropLLVMManglingEscape(Name)));
1699+
#endif
16911700

16921701
#if LLVM_VERSION_GE(20, 0)
16931702
Key = llvm::computeLTOCacheKey(conf, Data->Index, ModId, ImportList,

0 commit comments

Comments
 (0)