Skip to content

Commit 171d8a3

Browse files
[debuginfo] Don't mark fields and types as artificial in CPP-like enum debuginfo encoding.
LLDB historically has had problems with "artificial" entries and there is no real benefit to emitting that flag.
1 parent 8433e2a commit 171d8a3

File tree

1 file changed

+5
-5
lines changed
  • compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums

1 file changed

+5
-5
lines changed

compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/cpp_like.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ const SINGLE_VARIANT_VIRTUAL_DISR: u64 = 0;
119119
///
120120
/// The following pseudocode shows how to decode an enum value in a debugger:
121121
///
122-
/// ```ignore
122+
/// ```text
123123
///
124124
/// fn find_active_variant(enum_value) -> (VariantName, VariantValue) {
125125
/// let is_128_bit = enum_value.has_field("tag128_lo");
@@ -365,7 +365,7 @@ fn build_single_variant_union_fields<'ll, 'tcx>(
365365
unknown_file_metadata(cx),
366366
UNKNOWN_LINE_NUMBER,
367367
variant_names_type_di_node,
368-
DIFlags::FlagArtificial,
368+
DIFlags::FlagZero,
369369
Some(cx.const_u64(SINGLE_VARIANT_VIRTUAL_DISR)),
370370
tag_base_type_align.bits() as u32,
371371
)
@@ -482,7 +482,7 @@ fn build_variant_struct_wrapper_type_di_node<'ll, 'tcx>(
482482
// NOTE: We use size and align of enum_type, not from variant_layout:
483483
size_and_align_of(enum_or_generator_type_and_layout),
484484
Some(enum_or_generator_type_di_node),
485-
DIFlags::FlagArtificial,
485+
DIFlags::FlagZero,
486486
),
487487
|cx, wrapper_struct_type_di_node| {
488488
enum DiscrKind {
@@ -526,7 +526,7 @@ fn build_variant_struct_wrapper_type_di_node<'ll, 'tcx>(
526526
"value",
527527
size_and_align_of(enum_or_generator_type_and_layout),
528528
Size::ZERO,
529-
DIFlags::FlagArtificial,
529+
DIFlags::FlagZero,
530530
variant_struct_type_di_node,
531531
));
532532

@@ -540,7 +540,7 @@ fn build_variant_struct_wrapper_type_di_node<'ll, 'tcx>(
540540
unknown_file_metadata(cx),
541541
UNKNOWN_LINE_NUMBER,
542542
type_di_node,
543-
DIFlags::FlagArtificial,
543+
DIFlags::FlagZero,
544544
Some(cx.const_u64(value)),
545545
align.bits() as u32,
546546
)

0 commit comments

Comments
 (0)