diff options
| author | Wesley Wiser <wesleywiser@microsoft.com> | 2021-04-28 16:32:54 -0400 |
|---|---|---|
| committer | Wesley Wiser <wesleywiser@microsoft.com> | 2021-06-02 10:23:10 -0400 |
| commit | 2a025c1a765a593030fc6e80a45f4f1053f15aae (patch) | |
| tree | e35063fe8c43ef19c549f269043d64553c9da8a3 /compiler/rustc_codegen_llvm/src/debuginfo | |
| parent | b644f06326577e0926ddf9896fd702befc7bd43e (diff) | |
| download | rust-2a025c1a765a593030fc6e80a45f4f1053f15aae.tar.gz rust-2a025c1a765a593030fc6e80a45f4f1053f15aae.zip | |
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<T>` 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.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/debuginfo')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs | 11 |
1 files changed, 2 insertions, 9 deletions
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<Option<&'ll DIType>>, 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, }), |
