From 8ddd9c38f6165d40ca1ab82e1d2bf9890a047c3a Mon Sep 17 00:00:00 2001 From: Zalathar Date: Sat, 1 Feb 2025 14:00:20 +1100 Subject: Use `LLVMDIBuilderCreateDebugLocation` The LLVM-C binding takes an explicit context, whereas our binding obtained the context from the scope argument. --- compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'compiler/rustc_codegen_llvm/src/llvm/ffi.rs') diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs index f7713e9a726..95896916adc 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs @@ -1740,6 +1740,14 @@ unsafe extern "C" { File: &'ll Metadata, Discriminator: c_uint, // (optional "DWARF path discriminator"; default is 0) ) -> &'ll Metadata; + + pub(crate) fn LLVMDIBuilderCreateDebugLocation<'ll>( + Ctx: &'ll Context, + Line: c_uint, + Column: c_uint, + Scope: &'ll Metadata, + InlinedAt: Option<&'ll Metadata>, + ) -> &'ll Metadata; } #[link(name = "llvm-wrapper", kind = "static")] @@ -2302,12 +2310,6 @@ unsafe extern "C" { Params: Option<&'a DIArray>, ); - pub fn LLVMRustDIBuilderCreateDebugLocation<'a>( - Line: c_uint, - Column: c_uint, - Scope: &'a DIScope, - InlinedAt: Option<&'a DILocation>, - ) -> &'a DILocation; pub fn LLVMRustDILocationCloneWithBaseDiscriminator<'a>( Location: &'a DILocation, BD: c_uint, -- cgit 1.4.1-3-g733a5