Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 9fd398a

Browse files
committed
Use LLVMDIBuilderFinalize
1 parent 5f46729 commit 9fd398a

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
@@ -80,7 +80,7 @@ impl<'ll, 'tcx> CodegenUnitDebugContext<'ll, 'tcx> {
8080
}
8181

8282
pub(crate) fn finalize(&self, sess: &Session) {
83-
unsafe { llvm::LLVMRustDIBuilderFinalize(self.builder.as_ref()) };
83+
unsafe { llvm::LLVMDIBuilderFinalize(self.builder.as_ref()) };
8484
if !sess.target.is_like_msvc {
8585
// Debuginfo generation in LLVM by default uses a higher
8686
// 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
@@ -1629,6 +1629,8 @@ unsafe extern "C" {
16291629
unsafe extern "C" {
16301630
pub(crate) fn LLVMCreateDIBuilder<'ll>(M: &'ll Module) -> *mut DIBuilder<'ll>;
16311631
pub(crate) fn LLVMDisposeDIBuilder<'ll>(Builder: ptr::NonNull<DIBuilder<'ll>>);
1632+
1633+
pub(crate) fn LLVMDIBuilderFinalize<'ll>(Builder: &DIBuilder<'ll>);
16321634
}
16331635

16341636
#[link(name = "llvm-wrapper", kind = "static")]
@@ -1898,8 +1900,6 @@ unsafe extern "C" {
18981900
ValueLen: size_t,
18991901
);
19001902

1901-
pub fn LLVMRustDIBuilderFinalize(Builder: &DIBuilder<'_>);
1902-
19031903
pub fn LLVMRustDIBuilderCreateCompileUnit<'a>(
19041904
Builder: &DIBuilder<'a>,
19051905
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)