Skip to content

Commit b60a737

Browse files
committed
Use LLVMDIBuilderCreateDebugLocation
1 parent 94a7e6e commit b60a737

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
@@ -569,7 +569,7 @@ impl<'ll, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
569569
(line, col)
570570
};
571571

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

575575
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
@@ -1646,6 +1646,14 @@ unsafe extern "C" {
16461646
File: &'ll Metadata,
16471647
Discriminator: c_uint, // (optional "DWARF path discriminator"; default is 0)
16481648
) -> &'ll Metadata;
1649+
1650+
pub(crate) fn LLVMDIBuilderCreateDebugLocation<'ll>(
1651+
Ctx: &'ll Context,
1652+
Line: c_uint,
1653+
Column: c_uint,
1654+
Scope: &'ll Metadata,
1655+
InlinedAt: Option<&'ll Metadata>,
1656+
) -> &'ll Metadata;
16491657
}
16501658

16511659
#[link(name = "llvm-wrapper", kind = "static")]
@@ -2202,12 +2210,6 @@ unsafe extern "C" {
22022210
Params: Option<&'a DIArray>,
22032211
);
22042212

2205-
pub fn LLVMRustDIBuilderCreateDebugLocation<'a>(
2206-
Line: c_uint,
2207-
Column: c_uint,
2208-
Scope: &'a DIScope,
2209-
InlinedAt: Option<&'a DILocation>,
2210-
) -> &'a DILocation;
22112213
pub fn LLVMRustDILocationCloneWithBaseDiscriminator<'a>(
22122214
Location: &'a DILocation,
22132215
BD: c_uint,

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

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

1291-
extern "C" LLVMMetadataRef
1292-
LLVMRustDIBuilderCreateDebugLocation(unsigned Line, unsigned Column,
1293-
LLVMMetadataRef ScopeRef,
1294-
LLVMMetadataRef InlinedAt) {
1295-
MDNode *Scope = unwrapDIPtr<MDNode>(ScopeRef);
1296-
DILocation *Loc = DILocation::get(Scope->getContext(), Line, Column, Scope,
1297-
unwrapDIPtr<MDNode>(InlinedAt));
1298-
return wrap(Loc);
1299-
}
1300-
13011291
extern "C" LLVMMetadataRef
13021292
LLVMRustDILocationCloneWithBaseDiscriminator(LLVMMetadataRef Location,
13031293
unsigned BD) {

0 commit comments

Comments
 (0)