about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/debuginfo/metadata
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@posteo>2022-03-14 17:11:58 +0100
committerMichael Woerister <michaelwoerister@posteo>2022-03-14 17:25:17 +0100
commit9580a7115d2d75514f0b329a29fafaa3796bd950 (patch)
treed3939b8140e302c4bd013ef5f40da3f79ea0744a /compiler/rustc_codegen_llvm/src/debuginfo/metadata
parent19707b0ff2c0beb80f77eaa7274f4588a506309d (diff)
debuginfo: Refactor debuginfo generation for types -- Address review comments.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/debuginfo/metadata')
-rw-r--r--compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/mod.rs2
-rw-r--r--compiler/rustc_codegen_llvm/src/debuginfo/metadata/type_map.rs3
2 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/mod.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/mod.rs
index 19f0ce54250..1eafa9501c4 100644
--- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/mod.rs
+++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/mod.rs
@@ -126,6 +126,8 @@ fn tag_base_type<'ll, 'tcx>(
                     // If the niche is the NULL value of a reference, then `discr_enum_ty` will be
                     // a RawPtr. CodeView doesn't know what to do with enums whose base type is a
                     // pointer so we fix this up to just be `usize`.
+                    // DWARF might be able to deal with this but with an integer type we are on
+                    // the safe side there too.
                     cx.data_layout().ptr_sized_integer()
                 }
             }
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata/type_map.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata/type_map.rs
index 26f0647f888..8ce44ada887 100644
--- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata/type_map.rs
+++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata/type_map.rs
@@ -145,7 +145,6 @@ impl<'ll> DINodeCreationResult<'ll> {
     }
 }
 
-#[allow(dead_code)]
 #[derive(Debug, Copy, Clone, Eq, PartialEq)]
 pub enum Stub<'ll> {
     Struct,
@@ -233,7 +232,7 @@ pub(super) fn stub<'ll, 'tcx>(
 /// This function enables creating debuginfo nodes that can recursively refer to themselves.
 /// It will first insert the given stub into the type map and only then execute the `members`
 /// and `generics` closures passed in. These closures have access to the stub so they can
-/// directly attach fields to them. If build the type of a field transitively refers back
+/// directly attach fields to them. If the type of a field transitively refers back
 /// to the type currently being built, the stub will already be found in the type map,
 /// which effectively breaks the recursion cycle.
 pub(super) fn build_type_with_children<'ll, 'tcx>(