diff options
| author | Kyle Huey <khuey@kylehuey.com> | 2024-11-18 18:16:22 -0800 |
|---|---|---|
| committer | Kyle Huey <khuey@kylehuey.com> | 2024-11-19 05:18:56 -0800 |
| commit | 1e4ebb0ccdffe4a8ddb15cb8e95bef3b905f045b (patch) | |
| tree | 28ee64a14598310a5134b67e47185e37e144692a /compiler | |
| parent | b71fb5edc0217eaf8fc824a44cd7b0945e29ff4d (diff) | |
| download | rust-1e4ebb0ccdffe4a8ddb15cb8e95bef3b905f045b.tar.gz rust-1e4ebb0ccdffe4a8ddb15cb8e95bef3b905f045b.zip | |
Honor collapse_debuginfo when dealing with MIR-inlined functions inside macros.
The test relies on the fact that inlining more than 2^12 calls at the same callsite will trigger a panic (and after the following commit, a warning) due to LLVM limitations but with collapse_debuginfo the callsites should not be the same.
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs b/compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs index 4a68bdea85e..2c7ef626d1e 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs @@ -9,7 +9,7 @@ use rustc_middle::mir::{Body, SourceScope}; use rustc_middle::ty::layout::{FnAbiOf, HasTypingEnv}; use rustc_middle::ty::{self, Instance}; use rustc_session::config::DebugInfo; -use rustc_span::BytePos; +use rustc_span::{BytePos, hygiene}; use super::metadata::file_metadata; use super::utils::DIB; @@ -138,8 +138,7 @@ fn make_mir_scope<'ll, 'tcx>( }; let inlined_at = scope_data.inlined.map(|(_, callsite_span)| { - // FIXME(eddyb) this doesn't account for the macro-related - // `Span` fixups that `rustc_codegen_ssa::mir::debuginfo` does. + let callsite_span = hygiene::walk_chain_collapsed(callsite_span, mir.span); let callsite_scope = parent_scope.adjust_dbg_scope_for_span(cx, callsite_span); let loc = cx.dbg_loc(callsite_scope, parent_scope.inlined_at, callsite_span); |
