From 2a025c1a765a593030fc6e80a45f4f1053f15aae Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Wed, 28 Apr 2021 16:32:54 -0400 Subject: Remove fallback for containing scopes This wasn't necessary for msvc and caused issues where different types with the same name such as different instantiations of `Option` would have colliding debuginfo. This confused the debugger which would pick one of the type definitions and use for all types with that name even though they had different layout. --- compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'compiler/rustc_codegen_llvm') diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs index 0ab16473a54..af0d95a354b 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs @@ -1457,7 +1457,6 @@ struct EnumMemberDescriptionFactory<'ll, 'tcx> { enum_type: Ty<'tcx>, layout: TyAndLayout<'tcx>, tag_type_metadata: Option<&'ll DIType>, - containing_scope: &'ll DIScope, common_members: Vec>, span: Span, } @@ -1488,11 +1487,7 @@ impl EnumMemberDescriptionFactory<'ll, 'tcx> { // This will always find the metadata in the type map. let fallback = use_enum_fallback(cx); - let self_metadata = if fallback { - self.containing_scope - } else { - type_metadata(cx, self.enum_type, self.span) - }; + let self_metadata = type_metadata(cx, self.enum_type, self.span); match self.layout.variants { Variants::Single { index } => { @@ -1607,7 +1602,7 @@ impl EnumMemberDescriptionFactory<'ll, 'tcx> { variant, variant_info_for(dataful_variant), Some(NicheTag), - self.containing_scope, + self_metadata, self.span, ); @@ -2085,7 +2080,6 @@ fn prepare_enum_metadata( enum_type, layout, tag_type_metadata: discriminant_type_metadata, - containing_scope, common_members: vec![], span, }), @@ -2238,7 +2232,6 @@ fn prepare_enum_metadata( enum_type, layout, tag_type_metadata: None, - containing_scope, common_members: outer_fields, span, }), -- cgit 1.4.1-3-g733a5