about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorKyle Huey <khuey@kylehuey.com>2024-08-19 17:13:30 -0700
committerKyle Huey <khuey@kylehuey.com>2024-08-19 17:13:30 -0700
commit4e9725cd2f5327f65f881c59d6bcbae46308318e (patch)
tree6639bc753ae411d6ce6179baf508de4742e9ccbb /compiler/rustc_codegen_llvm/src
parent3c735a00f70c8c3df737eb18494e9eb9c6196971 (diff)
downloadrust-4e9725cd2f5327f65f881c59d6bcbae46308318e.tar.gz
rust-4e9725cd2f5327f65f881c59d6bcbae46308318e.zip
Add a comment.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/debuginfo/mod.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs b/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs
index 66dd653bb21..3fbaebe28aa 100644
--- a/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs
+++ b/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs
@@ -570,6 +570,11 @@ impl<'ll, 'tcx> DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
         inlined_at: Option<&'ll DILocation>,
         span: Span,
     ) -> &'ll DILocation {
+        // When emitting debugging information, DWARF (i.e. everything but MSVC)
+        // treats line 0 as a magic value meaning that the code could not be
+        // attributed to any line in the source. That's also exactly what dummy
+        // spans are. Make that equivalence here, rather than passing dummy spans
+        // to lookup_debug_loc, which will return line 1 for them.
         let (line, col) = if span.is_dummy() && !self.sess().target.is_like_msvc {
             (0, 0)
         } else {