Skip to content

Commit d6b2567

Browse files
committed
Use LLVMDIBuilderFinalize
1 parent d0e8be3 commit d6b2567

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
@@ -1621,6 +1621,8 @@ unsafe extern "C" {
16211621
unsafe extern "C" {
16221622
pub(crate) fn LLVMCreateDIBuilder<'ll>(M: &'ll Module) -> *mut DIBuilder<'ll>;
16231623
pub(crate) fn LLVMDisposeDIBuilder<'ll>(Builder: ptr::NonNull<DIBuilder<'ll>>);
1624+
1625+
pub(crate) fn LLVMDIBuilderFinalize<'ll>(Builder: &DIBuilder<'ll>);
16241626
}
16251627

16261628
#[link(name = "llvm-wrapper", kind = "static")]
@@ -1890,8 +1892,6 @@ unsafe extern "C" {
18901892
ValueLen: size_t,
18911893
);
18921894

1893-
pub fn LLVMRustDIBuilderFinalize(Builder: &DIBuilder<'_>);
1894-
18951895
pub fn LLVMRustDIBuilderCreateCompileUnit<'a>(
18961896
Builder: &DIBuilder<'a>,
18971897
Lang: c_uint,

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

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

989-
extern "C" void LLVMRustDIBuilderFinalize(LLVMRustDIBuilderRef Builder) {
990-
Builder->finalize();
991-
}
992-
993989
extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateCompileUnit(
994990
LLVMRustDIBuilderRef Builder, unsigned Lang, LLVMMetadataRef FileRef,
995991
const char *Producer, size_t ProducerLen, bool isOptimized,

0 commit comments

Comments
 (0)