diff options
| author | Daniel Paoliello <danpao@microsoft.com> | 2023-09-01 14:27:21 -0700 |
|---|---|---|
| committer | Daniel Paoliello <danpao@microsoft.com> | 2023-09-01 14:27:21 -0700 |
| commit | 06890774ab4f4f494be55fd6fe1097636fbea7c1 (patch) | |
| tree | f6e110f84418442615f37f9bf28965f0a1c191ef /compiler/rustc_codegen_llvm/src/debuginfo/mod.rs | |
| parent | 83995f320c13c05a70b460ac1cf5d9d87b497f1e (diff) | |
| download | rust-06890774ab4f4f494be55fd6fe1097636fbea7c1.tar.gz rust-06890774ab4f4f494be55fd6fe1097636fbea7c1.zip | |
Deduplicate inlined function debug info, but create a new lexical scope to child subsequent scopes and variables from colliding
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/debuginfo/mod.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/debuginfo/mod.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs b/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs index 40714a0afe9..82235521f80 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs @@ -292,7 +292,7 @@ impl<'ll, 'tcx> DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> { fn_abi: &FnAbi<'tcx, Ty<'tcx>>, llfn: &'ll Value, mir: &mir::Body<'tcx>, - ) -> Option<FunctionDebugContext<&'ll DIScope, &'ll DILocation>> { + ) -> Option<FunctionDebugContext<'tcx, &'ll DIScope, &'ll DILocation>> { if self.sess().opts.debuginfo == DebugInfo::None { return None; } @@ -304,8 +304,10 @@ impl<'ll, 'tcx> DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> { file_start_pos: BytePos(0), file_end_pos: BytePos(0), }; - let mut fn_debug_context = - FunctionDebugContext { scopes: IndexVec::from_elem(empty_scope, &mir.source_scopes) }; + let mut fn_debug_context = FunctionDebugContext { + scopes: IndexVec::from_elem(empty_scope, &mir.source_scopes), + inlined_function_scopes: Default::default(), + }; // Fill in all the scopes, with the information from the MIR body. compute_mir_scopes(self, instance, mir, &mut fn_debug_context); |
