Skip to content

Commit a907bc5

Browse files
committed
Use LLVMDIBuilderFinalize
1 parent 5183d0b commit a907bc5

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
@@ -1627,6 +1627,8 @@ unsafe extern "C" {
16271627
unsafe extern "C" {
16281628
pub(crate) fn LLVMCreateDIBuilder<'ll>(M: &'ll Module) -> *mut DIBuilder<'ll>;
16291629
pub(crate) fn LLVMDisposeDIBuilder<'ll>(Builder: ptr::NonNull<DIBuilder<'ll>>);
1630+
1631+
pub(crate) fn LLVMDIBuilderFinalize<'ll>(Builder: &DIBuilder<'ll>);
16301632
}
16311633

16321634
#[link(name = "llvm-wrapper", kind = "static")]
@@ -1896,8 +1898,6 @@ unsafe extern "C" {
18961898
ValueLen: size_t,
18971899
);
18981900

1899-
pub fn LLVMRustDIBuilderFinalize(Builder: &DIBuilder<'_>);
1900-
19011901
pub fn LLVMRustDIBuilderCreateCompileUnit<'a>(
19021902
Builder: &DIBuilder<'a>,
19031903
Lang: c_uint,

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

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

899-
extern "C" void LLVMRustDIBuilderFinalize(LLVMRustDIBuilderRef Builder) {
900-
Builder->finalize();
901-
}
902-
903899
extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateCompileUnit(
904900
LLVMRustDIBuilderRef Builder, unsigned Lang, LLVMMetadataRef FileRef,
905901
const char *Producer, size_t ProducerLen, bool isOptimized,

0 commit comments

Comments
 (0)