Skip to content

Commit

Permalink
llvm-wrapper: adapt for LLVM API changes
Browse files Browse the repository at this point in the history
Adapts rust for llvm/llvm-project@9997e03.
  • Loading branch information
krasimirgg committed Mar 12, 2024
1 parent 5b7343b commit 0a2ddcd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 0a2ddcd

Please sign in to comment.