Skip to content

Commit e8f3af5

Browse files
committed
Use LLVMDIBuilderCreateDebugLocation
1 parent cca9d3f commit e8f3af5

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
@@ -1652,6 +1652,14 @@ unsafe extern "C" {
16521652
File: &'ll Metadata,
16531653
Discriminator: c_uint,
16541654
) -> &'ll Metadata;
1655+
1656+
pub(crate) fn LLVMDIBuilderCreateDebugLocation<'ll>(
1657+
Ctx: &'ll Context,
1658+
Line: c_uint,
1659+
Column: c_uint,
1660+
Scope: &'ll Metadata,
1661+
InlinedAt: Option<&'ll Metadata>,
1662+
) -> &'ll Metadata;
16551663
}
16561664

16571665
#[link(name = "llvm-wrapper", kind = "static")]
@@ -2208,12 +2216,6 @@ unsafe extern "C" {
22082216
Params: Option<&'a DIArray>,
22092217
);
22102218

2211-
pub fn LLVMRustDIBuilderCreateDebugLocation<'a>(
2212-
Line: c_uint,
2213-
Column: c_uint,
2214-
Scope: &'a DIScope,
2215-
InlinedAt: Option<&'a DILocation>,
2216-
) -> &'a DILocation;
22172219
pub fn LLVMRustDILocationCloneWithBaseDiscriminator<'a>(
22182220
Location: &'a DILocation,
22192221
BD: c_uint,

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

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

1201-
extern "C" LLVMMetadataRef
1202-
LLVMRustDIBuilderCreateDebugLocation(unsigned Line, unsigned Column,
1203-
LLVMMetadataRef ScopeRef,
1204-
LLVMMetadataRef InlinedAt) {
1205-
MDNode *Scope = unwrapDIPtr<MDNode>(ScopeRef);
1206-
DILocation *Loc = DILocation::get(Scope->getContext(), Line, Column, Scope,
1207-
unwrapDIPtr<MDNode>(InlinedAt));
1208-
return wrap(Loc);
1209-
}
1210-
12111201
extern "C" LLVMMetadataRef
12121202
LLVMRustDILocationCloneWithBaseDiscriminator(LLVMMetadataRef Location,
12131203
unsigned BD) {

0 commit comments

Comments
 (0)