Skip to content

Commit 459c7fd

Browse files
committed
[DebugInfo] Stop emitting spare bits mask in debug info
We're now able to calculate the spare bits mask from other information. Stop emitting it in debug info.
1 parent 8960144 commit 459c7fd

File tree

2 files changed

+1
-29
lines changed

2 files changed

+1
-29
lines changed

lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,21 +1384,9 @@ createSpecializedStructOrClassType(NominalOrBoundGenericNominalType *Type,
13841384
}
13851385
}
13861386

1387-
APInt SpareBitsMask;
1388-
auto &EnumStrategy =
1389-
getEnumImplStrategy(IGM, DbgTy.getType()->getCanonicalType());
1390-
1391-
auto VariantOffsetInBits = 0;
1392-
if (auto SpareBitsMaskInfo = EnumStrategy.calculateSpareBitsMask()) {
1393-
SpareBitsMask = SpareBitsMaskInfo->bits;
1394-
// The offset of the variant mask in the overall enum.
1395-
VariantOffsetInBits = SpareBitsMaskInfo->byteOffset * 8;
1396-
}
1397-
13981387
auto VPTy = DBuilder.createVariantPart(
13991388
Scope, {}, File, Line, SizeInBits, AlignInBits, Flags, nullptr,
1400-
DBuilder.getOrCreateArray(Elements), /*UniqueIdentifier=*/"",
1401-
VariantOffsetInBits, SpareBitsMask);
1389+
DBuilder.getOrCreateArray(Elements), /*UniqueIdentifier=*/"");
14021390

14031391
auto DITy = DBuilder.createStructType(
14041392
Scope, Name, File, Line, SizeInBits, AlignInBits, Flags, nullptr,

test/DebugInfo/enum.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,6 @@ enum Either {
2828
// CHECK: ![[EMPTY:.*]] = !{}
2929
let E : Either = .Neither;
3030

31-
class C {}
32-
enum EitherWithSpareBits {
33-
case Left(C), Right(Int32)
34-
// DWARF: !DICompositeType(tag: DW_TAG_structure_type, name: "EitherWithSpareBits",
35-
// DWARF-SAME: size: 64,
36-
// DWARF-SAME: runtimeLang: DW_LANG_Swift, identifier: "$s4enum19EitherWithSpareBitsOD")
37-
38-
// DWARF: !DICompositeType(tag: DW_TAG_variant_part,
39-
// DWARF-SAME: size: 64, offset: 56, spare_bits_mask: {{240|255}}
40-
41-
// DWARF: !DIDerivedType(tag: DW_TAG_member, name: "Left"
42-
43-
// DWARF: !DIDerivedType(tag: DW_TAG_member, name: "Right"
44-
}
45-
let Right: EitherWithSpareBits = .Right(32)
46-
4731
// CHECK: !DICompositeType({{.*}}name: "Color",
4832
// CHECK-SAME: size: 8,
4933
// CHECK-SAME: identifier: "$s4enum5ColorOD"

0 commit comments

Comments
 (0)