Skip to content

Commit 3f8ffaa

Browse files
authored
Merge pull request #77176 from augusto2112/spare-bits-debug-2
[DebugInfo] Stop emitting spare bits mask in debug info
2 parents 023590a + 459c7fd commit 3f8ffaa

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
@@ -1385,21 +1385,9 @@ createSpecializedStructOrClassType(NominalOrBoundGenericNominalType *Type,
13851385
}
13861386
}
13871387

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

14041392
auto DITy = DBuilder.createStructType(
14051393
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)