Skip to content

Commit 4415a9a

Browse files
committed
Use LLVMDIBuilderCreateDebugLocation
1 parent cdaf96e commit 4415a9a

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
@@ -1656,6 +1656,14 @@ unsafe extern "C" {
16561656
File: &'ll Metadata,
16571657
Discriminator: c_uint, // (optional "DWARF path discriminator"; default is 0)
16581658
) -> &'ll Metadata;
1659+
1660+
pub(crate) fn LLVMDIBuilderCreateDebugLocation<'ll>(
1661+
Ctx: &'ll Context,
1662+
Line: c_uint,
1663+
Column: c_uint,
1664+
Scope: &'ll Metadata,
1665+
InlinedAt: Option<&'ll Metadata>,
1666+
) -> &'ll Metadata;
16591667
}
16601668

16611669
#[link(name = "llvm-wrapper", kind = "static")]
@@ -2212,12 +2220,6 @@ unsafe extern "C" {
22122220
Params: Option<&'a DIArray>,
22132221
);
22142222

2215-
pub fn LLVMRustDIBuilderCreateDebugLocation<'a>(
2216-
Line: c_uint,
2217-
Column: c_uint,
2218-
Scope: &'a DIScope,
2219-
InlinedAt: Option<&'a DILocation>,
2220-
) -> &'a DILocation;
22212223
pub fn LLVMRustDILocationCloneWithBaseDiscriminator<'a>(
22222224
Location: &'a DILocation,
22232225
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)