Skip to content

Commit 955d19c

Browse files
committed
Use LLVMDIBuilderGetOrCreateArray
1 parent c6c82ec commit 955d19c

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
@@ -1778,6 +1778,12 @@ unsafe extern "C" {
17781778
LowerBound: i64,
17791779
Count: i64,
17801780
) -> &'ll Metadata;
1781+
1782+
pub(crate) fn LLVMDIBuilderGetOrCreateArray<'ll>(
1783+
Builder: &DIBuilder<'ll>,
1784+
Data: *const Option<&'ll Metadata>,
1785+
NumElements: size_t,
1786+
) -> &'ll Metadata;
17811787
}
17821788

17831789
#[link(name = "llvm-wrapper", kind = "static")]
@@ -2156,12 +2162,6 @@ unsafe extern "C" {
21562162
AlignInBits: u32,
21572163
) -> &'a DIVariable;
21582164

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

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,14 +1058,6 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateVariable(
10581058
}
10591059
}
10601060

1061-
extern "C" LLVMMetadataRef
1062-
LLVMRustDIBuilderGetOrCreateArray(LLVMRustDIBuilderRef Builder,
1063-
LLVMMetadataRef *Ptr, unsigned Count) {
1064-
Metadata **DataValue = unwrap(Ptr);
1065-
return wrap(
1066-
Builder->getOrCreateArray(ArrayRef<Metadata *>(DataValue, Count)).get());
1067-
}
1068-
10691061
extern "C" void LLVMRustDIBuilderInsertDeclareAtEnd(
10701062
LLVMRustDIBuilderRef Builder, LLVMValueRef V, LLVMMetadataRef VarInfo,
10711063
uint64_t *AddrOps, unsigned AddrOpsCount, LLVMMetadataRef DL,

0 commit comments

Comments
 (0)