@@ -1507,7 +1507,7 @@ impl EnumMemberDescriptionFactory<'ll, 'tcx> {
1507
1507
cx,
1508
1508
self . layout ,
1509
1509
variant_info,
1510
- NoTag ,
1510
+ None ,
1511
1511
self_metadata,
1512
1512
self . span ,
1513
1513
) ;
@@ -1539,13 +1539,13 @@ impl EnumMemberDescriptionFactory<'ll, 'tcx> {
1539
1539
..
1540
1540
} => {
1541
1541
let tag_info = if fallback {
1542
- RegularTag {
1542
+ Some ( DirectTag {
1543
1543
tag_field : Field :: from ( tag_field) ,
1544
1544
tag_type_metadata : self . tag_type_metadata . unwrap ( ) ,
1545
- }
1545
+ } )
1546
1546
} else {
1547
1547
// This doesn't matter in this case.
1548
- NoTag
1548
+ None
1549
1549
} ;
1550
1550
variants
1551
1551
. iter_enumerated ( )
@@ -1606,7 +1606,7 @@ impl EnumMemberDescriptionFactory<'ll, 'tcx> {
1606
1606
cx,
1607
1607
variant,
1608
1608
variant_info_for ( dataful_variant) ,
1609
- OptimizedTag ,
1609
+ Some ( NicheTag ) ,
1610
1610
self . containing_scope ,
1611
1611
self . span ,
1612
1612
) ;
@@ -1681,7 +1681,7 @@ impl EnumMemberDescriptionFactory<'ll, 'tcx> {
1681
1681
cx,
1682
1682
variant,
1683
1683
variant_info,
1684
- OptimizedTag ,
1684
+ Some ( NicheTag ) ,
1685
1685
self_metadata,
1686
1686
self . span ,
1687
1687
) ;
@@ -1771,14 +1771,10 @@ impl VariantMemberDescriptionFactory<'ll, 'tcx> {
1771
1771
}
1772
1772
}
1773
1773
1774
- // FIXME: terminology here should be aligned with `abi::TagEncoding`.
1775
- // `OptimizedTag` is `TagEncoding::Niche`, `RegularTag` is `TagEncoding::Direct`.
1776
- // `NoTag` should be removed; users should use `Option<EnumTagInfo>` instead.
1777
1774
#[ derive( Copy , Clone ) ]
1778
1775
enum EnumTagInfo < ' ll > {
1779
- RegularTag { tag_field : Field , tag_type_metadata : & ' ll DIType } ,
1780
- OptimizedTag ,
1781
- NoTag ,
1776
+ DirectTag { tag_field : Field , tag_type_metadata : & ' ll DIType } ,
1777
+ NicheTag ,
1782
1778
}
1783
1779
1784
1780
#[ derive( Copy , Clone ) ]
@@ -1859,7 +1855,7 @@ fn describe_enum_variant(
1859
1855
cx : & CodegenCx < ' ll , ' tcx > ,
1860
1856
layout : layout:: TyAndLayout < ' tcx > ,
1861
1857
variant : VariantInfo < ' _ , ' tcx > ,
1862
- discriminant_info : EnumTagInfo < ' ll > ,
1858
+ discriminant_info : Option < EnumTagInfo < ' ll > > ,
1863
1859
containing_scope : & ' ll DIScope ,
1864
1860
span : Span ,
1865
1861
) -> ( & ' ll DICompositeType , MemberDescriptionFactory < ' ll , ' tcx > ) {
@@ -1882,7 +1878,7 @@ fn describe_enum_variant(
1882
1878
let ( offsets, args) = if use_enum_fallback ( cx) {
1883
1879
// If this is not a univariant enum, there is also the discriminant field.
1884
1880
let ( discr_offset, discr_arg) = match discriminant_info {
1885
- RegularTag { tag_field, .. } => {
1881
+ Some ( DirectTag { tag_field, .. } ) => {
1886
1882
// We have the layout of an enum variant, we need the layout of the outer enum
1887
1883
let enum_layout = cx. layout_of ( layout. ty ) ;
1888
1884
let offset = enum_layout. fields . offset ( tag_field. as_usize ( ) ) ;
@@ -1919,7 +1915,7 @@ fn describe_enum_variant(
1919
1915
offsets,
1920
1916
args,
1921
1917
tag_type_metadata : match discriminant_info {
1922
- RegularTag { tag_type_metadata, .. } => Some ( tag_type_metadata) ,
1918
+ Some ( DirectTag { tag_type_metadata, .. } ) => Some ( tag_type_metadata) ,
1923
1919
_ => None ,
1924
1920
} ,
1925
1921
span,
0 commit comments