about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2023-02-25 16:20:55 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2023-04-22 23:41:48 +0200
commit4ad04ad8419577f5dec37a80f3b46506edb84c96 (patch)
tree97c0c99e17859229dd6a51fdb42b94d69dee8f2a
parentbb758cfc6d773b15af5bf65330ea7c36d7c3673d (diff)
downloadrust-4ad04ad8419577f5dec37a80f3b46506edb84c96.tar.gz
rust-4ad04ad8419577f5dec37a80f3b46506edb84c96.zip
Set debug location to debug operand spill.
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/debuginfo.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs b/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs
index d049bafb821..b67230cf498 100644
--- a/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs
@@ -494,6 +494,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
                         let Some(dbg_loc) = self.dbg_loc(var.source_info) else { continue };
 
                         if let Ok(operand) = self.eval_mir_constant_to_operand(bx, &c) {
+                            self.set_debug_loc(bx, var.source_info);
                             let base = Self::spill_operand_to_stack(
                                 &operand,
                                 Some(var.name.to_string()),