Skip to content

Commit 490d5d5

Browse files
committed
Use LLVMDIBuilderFinalize
1 parent ee498f6 commit 490d5d5

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

compiler/rustc_codegen_llvm/src/debuginfo/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl<'ll, 'tcx> CodegenUnitDebugContext<'ll, 'tcx> {
7979
}
8080

8181
pub(crate) fn finalize(&self, sess: &Session) {
82-
unsafe { llvm::LLVMRustDIBuilderFinalize(self.builder.as_ref()) };
82+
unsafe { llvm::LLVMDIBuilderFinalize(self.builder.as_ref()) };
8383
if !sess.target.is_like_msvc {
8484
// Debuginfo generation in LLVM by default uses a higher
8585
// version of dwarf than macOS currently understands. We can

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,6 +1631,8 @@ unsafe extern "C" {
16311631
unsafe extern "C" {
16321632
pub(crate) fn LLVMCreateDIBuilder<'ll>(M: &'ll Module) -> *mut DIBuilder<'ll>;
16331633
pub(crate) fn LLVMDisposeDIBuilder<'ll>(Builder: ptr::NonNull<DIBuilder<'ll>>);
1634+
1635+
pub(crate) fn LLVMDIBuilderFinalize<'ll>(Builder: &DIBuilder<'ll>);
16341636
}
16351637

16361638
#[link(name = "llvm-wrapper", kind = "static")]
@@ -1900,8 +1902,6 @@ unsafe extern "C" {
19001902
ValueLen: size_t,
19011903
);
19021904

1903-
pub fn LLVMRustDIBuilderFinalize(Builder: &DIBuilder<'_>);
1904-
19051905
pub fn LLVMRustDIBuilderCreateCompileUnit<'a>(
19061906
Builder: &DIBuilder<'a>,
19071907
Lang: c_uint,

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -909,10 +909,6 @@ extern "C" void LLVMRustGlobalAddMetadata(LLVMValueRef Global, unsigned Kind,
909909
unwrap<GlobalObject>(Global)->addMetadata(Kind, *unwrap<MDNode>(MD));
910910
}
911911

912-
extern "C" void LLVMRustDIBuilderFinalize(LLVMRustDIBuilderRef Builder) {
913-
Builder->finalize();
914-
}
915-
916912
extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateCompileUnit(
917913
LLVMRustDIBuilderRef Builder, unsigned Lang, LLVMMetadataRef FileRef,
918914
const char *Producer, size_t ProducerLen, bool isOptimized,

0 commit comments

Comments
 (0)