Skip to content

Commit cd63070

Browse files
committed
Use LLVMDIBuilderGetOrCreateArray
1 parent 51ac4aa commit cd63070

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
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
@@ -1776,6 +1776,12 @@ unsafe extern "C" {
17761776
LowerBound: i64,
17771777
Count: i64,
17781778
) -> &'ll Metadata;
1779+
1780+
pub(crate) fn LLVMDIBuilderGetOrCreateArray<'ll>(
1781+
Builder: &DIBuilder<'ll>,
1782+
Data: *const Option<&'ll Metadata>,
1783+
NumElements: size_t,
1784+
) -> &'ll Metadata;
17791785
}
17801786

17811787
#[link(name = "llvm-wrapper", kind = "static")]
@@ -2154,12 +2160,6 @@ unsafe extern "C" {
21542160
AlignInBits: u32,
21552161
) -> &'a DIVariable;
21562162

2157-
pub fn LLVMRustDIBuilderGetOrCreateArray<'a>(
2158-
Builder: &DIBuilder<'a>,
2159-
Ptr: *const Option<&'a DIDescriptor>,
2160-
Count: c_uint,
2161-
) -> &'a DIArray;
2162-
21632163
pub fn LLVMRustDIBuilderInsertDeclareAtEnd<'a>(
21642164
Builder: &DIBuilder<'a>,
21652165
Val: &'a Value,

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,14 +1045,6 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateVariable(
10451045
}
10461046
}
10471047

1048-
extern "C" LLVMMetadataRef
1049-
LLVMRustDIBuilderGetOrCreateArray(LLVMRustDIBuilderRef Builder,
1050-
LLVMMetadataRef *Ptr, unsigned Count) {
1051-
Metadata **DataValue = unwrap(Ptr);
1052-
return wrap(
1053-
Builder->getOrCreateArray(ArrayRef<Metadata *>(DataValue, Count)).get());
1054-
}
1055-
10561048
extern "C" void LLVMRustDIBuilderInsertDeclareAtEnd(
10571049
LLVMRustDIBuilderRef Builder, LLVMValueRef V, LLVMMetadataRef VarInfo,
10581050
uint64_t *AddrOps, unsigned AddrOpsCount, LLVMMetadataRef DL,

0 commit comments

Comments
 (0)