diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2025-09-19 16:56:28 +1000 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2025-09-19 17:15:32 +1000 |
| commit | 9daa026cadca6de0d932ddb6f6ddbfa5411a25e3 (patch) | |
| tree | 831d78dee06636f5dbb89e001cd18f80caaf38a9 /compiler/rustc_codegen_llvm/src/debuginfo | |
| parent | a6d261712ee546fc1fc1b7b7c0ee0782aa827b8b (diff) | |
| download | rust-9daa026cadca6de0d932ddb6f6ddbfa5411a25e3.tar.gz rust-9daa026cadca6de0d932ddb6f6ddbfa5411a25e3.zip | |
Use `LLVMDIBuilder(CreateExpression|InsertDeclareRecordAtEnd)`
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/debuginfo')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/debuginfo/mod.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs b/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs index 126082aa3aa..dc36ed17875 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs @@ -191,18 +191,21 @@ impl<'ll> DebugInfoBuilderMethods for Builder<'_, 'll, '_> { addr_ops.push((fragment.end - fragment.start).bits() as u64); } + let di_builder = DIB(self.cx()); + let addr_expr = unsafe { + llvm::LLVMDIBuilderCreateExpression(di_builder, addr_ops.as_ptr(), addr_ops.len()) + }; unsafe { // FIXME(eddyb) replace `llvm.dbg.declare` with `llvm.dbg.addr`. - llvm::LLVMRustDIBuilderInsertDeclareAtEnd( - DIB(self.cx()), + llvm::LLVMDIBuilderInsertDeclareRecordAtEnd( + di_builder, variable_alloca, dbg_var, - addr_ops.as_ptr(), - addr_ops.len() as c_uint, + addr_expr, dbg_loc, self.llbb(), - ); - } + ) + }; } fn set_dbg_loc(&mut self, dbg_loc: &'ll DILocation) { |
