diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index 8a6caa9b10854..aad4cbc11a417 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -1512,12 +1512,19 @@ extern "C" void LLVMRustComputeLTOCacheKey(RustStringRef KeyOut, DenseSet CfiFunctionDecls; // Based on the 'InProcessThinBackend' constructor in LLVM +#if LLVM_VERSION_GE(23, 0) + CfiFunctionDefs.insert_range( + Data->Index.cfiFunctionDefs().getExportedThinLTOGUIDs()); + CfiFunctionDecls.insert_range( + Data->Index.cfiFunctionDecls().getExportedThinLTOGUIDs()); +#else for (auto &Name : Data->Index.cfiFunctionDefs().symbols()) CfiFunctionDefs.insert(GlobalValue::getGUIDAssumingExternalLinkage( GlobalValue::dropLLVMManglingEscape(Name))); for (auto &Name : Data->Index.cfiFunctionDecls().symbols()) CfiFunctionDecls.insert(GlobalValue::getGUIDAssumingExternalLinkage( GlobalValue::dropLLVMManglingEscape(Name))); +#endif Key = llvm::computeLTOCacheKey(conf, Data->Index, ModId, ImportList, ExportList, ResolvedODR, DefinedGlobals,