Skip to content

Commit 6f31d00

Browse files
authored
Rollup merge of #115563 - krasimirgg:llvm-18-bitcodereader, r=nikic
llvm-wrapper: adapt for LLVM API change No functional changes intended. Adapts the wrapper for llvm/llvm-project@bbe8cd1. Found by our experimental rust + llvm @ HEAD CI: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/22055#018a6495-8dd9-41df-9381-5e7b0009ce0a/274-575
2 parents 9381e5b + bdfa08a commit 6f31d00

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,11 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
12021202

12031203
Ret->ModuleMap[module->identifier] = mem_buffer;
12041204

1205+
#if LLVM_VERSION_GE(18, 0)
1206+
if (Error Err = readModuleSummaryIndex(mem_buffer, Ret->Index)) {
1207+
#else
12051208
if (Error Err = readModuleSummaryIndex(mem_buffer, Ret->Index, i)) {
1209+
#endif
12061210
LLVMRustSetLastError(toString(std::move(Err)).c_str());
12071211
return nullptr;
12081212
}

0 commit comments

Comments
 (0)