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

Commit 60ac0f4

Browse files
committed
Use LLVMDIBuilderCreateDebugLocation
1 parent 0421518 commit 60ac0f4

File tree

3 files changed

+9
-17
lines changed

3 files changed

+9
-17
lines changed

compiler/rustc_codegen_llvm/src/debuginfo/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ impl<'ll, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
570570
(line, col)
571571
};
572572

573-
unsafe { llvm::LLVMRustDIBuilderCreateDebugLocation(line, col, scope, inlined_at) }
573+
unsafe { llvm::LLVMDIBuilderCreateDebugLocation(self.llcx, line, col, scope, inlined_at) }
574574
}
575575

576576
fn create_vtable_debuginfo(

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,6 +1654,14 @@ unsafe extern "C" {
16541654
File: &'ll Metadata,
16551655
Discriminator: c_uint, // (optional "DWARF path discriminator"; default is 0)
16561656
) -> &'ll Metadata;
1657+
1658+
pub(crate) fn LLVMDIBuilderCreateDebugLocation<'ll>(
1659+
Ctx: &'ll Context,
1660+
Line: c_uint,
1661+
Column: c_uint,
1662+
Scope: &'ll Metadata,
1663+
InlinedAt: Option<&'ll Metadata>,
1664+
) -> &'ll Metadata;
16571665
}
16581666

16591667
#[link(name = "llvm-wrapper", kind = "static")]
@@ -2210,12 +2218,6 @@ unsafe extern "C" {
22102218
Params: Option<&'a DIArray>,
22112219
);
22122220

2213-
pub fn LLVMRustDIBuilderCreateDebugLocation<'a>(
2214-
Line: c_uint,
2215-
Column: c_uint,
2216-
Scope: &'a DIScope,
2217-
InlinedAt: Option<&'a DILocation>,
2218-
) -> &'a DILocation;
22192221
pub fn LLVMRustDILocationCloneWithBaseDiscriminator<'a>(
22202222
Location: &'a DILocation,
22212223
BD: c_uint,

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,16 +1211,6 @@ extern "C" void LLVMRustDICompositeTypeReplaceArrays(
12111211
DINodeArray(unwrap<MDTuple>(Params)));
12121212
}
12131213

1214-
extern "C" LLVMMetadataRef
1215-
LLVMRustDIBuilderCreateDebugLocation(unsigned Line, unsigned Column,
1216-
LLVMMetadataRef ScopeRef,
1217-
LLVMMetadataRef InlinedAt) {
1218-
MDNode *Scope = unwrapDIPtr<MDNode>(ScopeRef);
1219-
DILocation *Loc = DILocation::get(Scope->getContext(), Line, Column, Scope,
1220-
unwrapDIPtr<MDNode>(InlinedAt));
1221-
return wrap(Loc);
1222-
}
1223-
12241214
extern "C" LLVMMetadataRef
12251215
LLVMRustDILocationCloneWithBaseDiscriminator(LLVMMetadataRef Location,
12261216
unsigned BD) {

0 commit comments

Comments
 (0)