Skip to content

Commit a6d2617

Browse files
committed
Use LLVMDIBuilderGetOrCreateArray
1 parent b1a9f23 commit a6d2617

File tree

3 files changed

+7
-16
lines changed

3 files changed

+7
-16
lines changed

compiler/rustc_codegen_llvm/src/debuginfo/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub(crate) fn create_DIArray<'ll>(
2828
builder: &DIBuilder<'ll>,
2929
arr: &[Option<&'ll DIDescriptor>],
3030
) -> &'ll DIArray {
31-
unsafe { llvm::LLVMRustDIBuilderGetOrCreateArray(builder, arr.as_ptr(), arr.len() as u32) }
31+
unsafe { llvm::LLVMDIBuilderGetOrCreateArray(builder, arr.as_ptr(), arr.len()) }
3232
}
3333

3434
#[inline]

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1994,6 +1994,12 @@ unsafe extern "C" {
19941994
LowerBound: i64,
19951995
Count: i64,
19961996
) -> &'ll Metadata;
1997+
1998+
pub(crate) fn LLVMDIBuilderGetOrCreateArray<'ll>(
1999+
Builder: &DIBuilder<'ll>,
2000+
Data: *const Option<&'ll Metadata>,
2001+
NumElements: size_t,
2002+
) -> &'ll Metadata;
19972003
}
19982004

19992005
#[link(name = "llvm-wrapper", kind = "static")]
@@ -2375,12 +2381,6 @@ unsafe extern "C" {
23752381
AlignInBits: u32,
23762382
) -> &'a DIVariable;
23772383

2378-
pub(crate) fn LLVMRustDIBuilderGetOrCreateArray<'a>(
2379-
Builder: &DIBuilder<'a>,
2380-
Ptr: *const Option<&'a DIDescriptor>,
2381-
Count: c_uint,
2382-
) -> &'a DIArray;
2383-
23842384
pub(crate) fn LLVMRustDIBuilderInsertDeclareAtEnd<'a>(
23852385
Builder: &DIBuilder<'a>,
23862386
Val: &'a Value,

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,15 +1142,6 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateVariable(
11421142
}
11431143
}
11441144

1145-
extern "C" LLVMMetadataRef
1146-
LLVMRustDIBuilderGetOrCreateArray(LLVMDIBuilderRef Builder,
1147-
LLVMMetadataRef *Ptr, unsigned Count) {
1148-
Metadata **DataValue = unwrap(Ptr);
1149-
return wrap(unwrap(Builder)
1150-
->getOrCreateArray(ArrayRef<Metadata *>(DataValue, Count))
1151-
.get());
1152-
}
1153-
11541145
extern "C" void
11551146
LLVMRustDIBuilderInsertDeclareAtEnd(LLVMDIBuilderRef Builder, LLVMValueRef V,
11561147
LLVMMetadataRef VarInfo, uint64_t *AddrOps,

0 commit comments

Comments
 (0)