about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-01-09 00:04:47 +0000
committerbors <bors@rust-lang.org>2024-01-09 00:04:47 +0000
commitd6affcf520091fd0f48df1a2b6bfcb9ef48e0f40 (patch)
treebc0d6b63f03d0e2a2dc0bfc3f4618548ba4a11b8 /compiler/rustc_codegen_ssa/src
parentca663b06c5492ac2dde5e53cd11579fa8e4d68bd (diff)
parent1c9e862a3eae36ee390b915efb737f999cb4b425 (diff)
downloadrust-d6affcf520091fd0f48df1a2b6bfcb9ef48e0f40.tar.gz
rust-d6affcf520091fd0f48df1a2b6bfcb9ef48e0f40.zip
Auto merge of #119754 - matthiaskrgr:rollup-7cht4m5, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #118903 (Improved support of collapse_debuginfo attribute for macros.)
 - #119033 (coverage: `llvm-cov` expects column numbers to be bytes, not code points)
 - #119598 (Fix a typo in core::ops::Deref's doc)
 - #119660 (remove an unnecessary stderr-per-bitwidth)
 - #119663 (tests: Normalize `\r\n` to `\n` in some run-make tests)
 - #119681 (coverage: Anonymize line numbers in branch views)
 - #119704 (Fix two variable binding issues in lint let_underscore)
 - #119725 (Add helper for when we want to know if an item has a host param)
 - #119738 (Add `riscv32imafc-esp-espidf` tier 3 target for the ESP32-P4.)
 - #119740 (Remove crossbeam-channel)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/debuginfo.rs17
1 files changed, 6 insertions, 11 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs b/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs
index 14915e816ee..48f3f4f2522 100644
--- a/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs
@@ -228,21 +228,16 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
     /// In order to have a good line stepping behavior in debugger, we overwrite debug
     /// locations of macro expansions with that of the outermost expansion site (when the macro is
     /// annotated with `#[collapse_debuginfo]` or when `-Zdebug-macros` is provided).
-    fn adjust_span_for_debugging(&self, mut span: Span) -> Span {
+    fn adjust_span_for_debugging(&self, span: Span) -> Span {
         // Bail out if debug info emission is not enabled.
         if self.debug_context.is_none() {
             return span;
         }
-
-        if self.cx.tcx().should_collapse_debuginfo(span) {
-            // Walk up the macro expansion chain until we reach a non-expanded span.
-            // We also stop at the function body level because no line stepping can occur
-            // at the level above that.
-            // Use span of the outermost expansion site, while keeping the original lexical scope.
-            span = rustc_span::hygiene::walk_chain(span, self.mir.span.ctxt());
-        }
-
-        span
+        // Walk up the macro expansion chain until we reach a non-expanded span.
+        // We also stop at the function body level because no line stepping can occur
+        // at the level above that.
+        // Use span of the outermost expansion site, while keeping the original lexical scope.
+        self.cx.tcx().collapsed_debuginfo(span, self.mir.span)
     }
 
     fn spill_operand_to_stack(