about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorJubilee <46493976+workingjubilee@users.noreply.github.com>2024-03-12 09:04:04 -0700
committerGitHub <noreply@github.com>2024-03-12 09:04:04 -0700
commit3e9c1d7253ded5dde25b548076c53e359e203f77 (patch)
tree0399e5cbd08ca57dcaa6f27a8ca32c4c2f76c068 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent8efdef69003b683c43cce760100f10ce342685d2 (diff)
parent0a2ddcd46b53cf1c1c0944fb69928af99fa05561 (diff)
downloadrust-3e9c1d7253ded5dde25b548076c53e359e203f77.tar.gz
rust-3e9c1d7253ded5dde25b548076c53e359e203f77.zip
Rollup merge of #122381 - krasimirgg:llvm-19-mar, r=durin42
llvm-wrapper: adapt for LLVM API changes

Adapts rust for https://github.com/llvm/llvm-project/commit/9997e0397156ff7e01aecbd17bdeb7bfe5fb15b0.

`@rustbot` label: +llvm-main
r? `@durin42`
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
index d76dea6f86c..1632b9e1249 100644
--- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
@@ -1112,11 +1112,16 @@ extern "C" LLVMValueRef LLVMRustDIBuilderInsertDeclareAtEnd(
     LLVMRustDIBuilderRef Builder, LLVMValueRef V, LLVMMetadataRef VarInfo,
     uint64_t *AddrOps, unsigned AddrOpsCount, LLVMMetadataRef DL,
     LLVMBasicBlockRef InsertAtEnd) {
-  return wrap(Builder->insertDeclare(
+  auto Result = Builder->insertDeclare(
       unwrap(V), unwrap<DILocalVariable>(VarInfo),
       Builder->createExpression(llvm::ArrayRef<uint64_t>(AddrOps, AddrOpsCount)),
       DebugLoc(cast<MDNode>(unwrap(DL))),
-      unwrap(InsertAtEnd)));
+      unwrap(InsertAtEnd));
+#if LLVM_VERSION_GE(19, 0)
+  return wrap(Result.get<llvm::Instruction *>());
+#else
+  return wrap(Result);
+#endif
 }
 
 extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateEnumerator(