Skip to content

Commit f6b969f

Browse files
committed
Revert "IRGenDebugInfo: Replace an obsolete workaround with an assertion."
This reverts commit ad4f065.
1 parent f259695 commit f6b969f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,8 +1032,11 @@ void IRGenDebugInfo::emitVariableDeclaration(
10321032
if (IsPiece) {
10331033
// Try to get the size from the type if possible.
10341034
auto StorageSize = getSizeFromExplosionValue(CI.getTargetInfo(), Piece);
1035-
assert((Dim.SizeInBits != 0 || StorageSize != 0) &&
1036-
"zero-sized variable with nonzero storage size");
1035+
// FIXME: The TypeInfo for bound generic enum types reports a
1036+
// type <{}> (with size 0) but a concrete instance may still
1037+
// have storage allocated for it. rdar://problem/21470869
1038+
if (!Dim.SizeInBits || (StorageSize && Dim.SizeInBits > StorageSize))
1039+
Dim.SizeInBits = StorageSize;
10371040

10381041
// FIXME: Occasionally we miss out that the Storage is actually a
10391042
// refcount wrapper. Silently skip these for now.

0 commit comments

Comments
 (0)