Skip to content

Commit 6cc2a28

Browse files
committed
Use LLVMDIBuilderCreateDebugLocation
1 parent a594d49 commit 6cc2a28

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,
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
@@ -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)