rustc_codegen_llvm: avoid converting between DILocation and Value.

This commit is contained in:
Eduard-Mihai Burtescu 2020-02-10 22:52:20 +02:00
parent fa2b381ec8
commit 88d874de63
4 changed files with 16 additions and 13 deletions

View file

@ -931,12 +931,12 @@ LLVMRustDIBuilderGetOrCreateArray(LLVMRustDIBuilderRef Builder,
extern "C" LLVMValueRef LLVMRustDIBuilderInsertDeclareAtEnd(
LLVMRustDIBuilderRef Builder, LLVMValueRef V, LLVMMetadataRef VarInfo,
int64_t *AddrOps, unsigned AddrOpsCount, LLVMValueRef DL,
int64_t *AddrOps, unsigned AddrOpsCount, LLVMMetadataRef DL,
LLVMBasicBlockRef InsertAtEnd) {
return wrap(Builder->insertDeclare(
unwrap(V), unwrap<DILocalVariable>(VarInfo),
Builder->createExpression(llvm::ArrayRef<int64_t>(AddrOps, AddrOpsCount)),
DebugLoc(cast<MDNode>(unwrap<MetadataAsValue>(DL)->getMetadata())),
DebugLoc(cast<MDNode>(DL)),
unwrap(InsertAtEnd)));
}
@ -1003,7 +1003,7 @@ LLVMRustDICompositeTypeReplaceArrays(LLVMRustDIBuilderRef Builder,
DINodeArray(unwrap<MDTuple>(Params)));
}
extern "C" LLVMValueRef
extern "C" LLVMMetadataRef
LLVMRustDIBuilderCreateDebugLocation(LLVMContextRef ContextRef, unsigned Line,
unsigned Column, LLVMMetadataRef Scope,
LLVMMetadataRef InlinedAt) {
@ -1012,7 +1012,7 @@ LLVMRustDIBuilderCreateDebugLocation(LLVMContextRef ContextRef, unsigned Line,
DebugLoc debug_loc = DebugLoc::get(Line, Column, unwrapDIPtr<MDNode>(Scope),
unwrapDIPtr<MDNode>(InlinedAt));
return wrap(MetadataAsValue::get(Context, debug_loc.getAsMDNode()));
return wrap(debug_loc.getAsMDNode());
}
extern "C" int64_t LLVMRustDIBuilderCreateOpDeref() {