about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorKrasimir Georgiev <krasimir@google.com>2023-09-05 10:04:25 +0000
committerKrasimir Georgiev <krasimir@google.com>2023-09-05 10:04:25 +0000
commitbdfa08a3459870e7abdd5442ac8e9d20e64cc288 (patch)
treee84a88d759d0c7f18217f92cde988a90078a00db /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parent15e52b05ca8f63e0da27c808680388717e5b997e (diff)
downloadrust-bdfa08a3459870e7abdd5442ac8e9d20e64cc288.tar.gz
rust-bdfa08a3459870e7abdd5442ac8e9d20e64cc288.zip
llvm-wrapper: adapt for LLVM API change
No functional changes intended.

Adapts the wrapper for https://github.com/llvm/llvm-project/commit/bbe8cd13335300958b04db5318c31ff52714f96f.

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
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
index 6af5c24c458..8f8f1d8c04f 100644
--- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
@@ -1202,7 +1202,11 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
 
     Ret->ModuleMap[module->identifier] = mem_buffer;
 
+#if LLVM_VERSION_GE(18, 0)
+    if (Error Err = readModuleSummaryIndex(mem_buffer, Ret->Index)) {
+#else
     if (Error Err = readModuleSummaryIndex(mem_buffer, Ret->Index, i)) {
+#endif
       LLVMRustSetLastError(toString(std::move(Err)).c_str());
       return nullptr;
     }