Skip to content

Commit 5ecea4b

Browse files
committed
Revert "[cxx-interop] Remove NDEBUG check when importing OptionSetTypes"
This reverts commit fa5c4f2.
1 parent 7a34b52 commit 5ecea4b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/ClangImporter/ImportEnumInfo.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,9 @@ ImportedType importer::findOptionSetEnum(clang::QualType type,
259259
if (!clangEnum)
260260
return ImportedType();
261261

262+
// Only ASSERT() on assertions-enabled builds. This preserves existing
263+
// behavior and de-risks existing builds, but should be removed after 6.2.
264+
#ifndef NDEBUG
262265
// Assert that the typedef has the same underlying integer representation as
263266
// the enum we think it assigns a type name to.
264267
//
@@ -272,6 +275,7 @@ ImportedType importer::findOptionSetEnum(clang::QualType type,
272275
ASSERT(clangEnum.value()->getIntegerType()->getCanonicalTypeInternal() ==
273276
typedefType->getCanonicalTypeInternal());
274277
}
278+
#endif // !NDEBUG
275279

276280
if (auto *swiftEnum = Impl.importDecl(*clangEnum, Impl.CurrentVersion))
277281
return {cast<TypeDecl>(swiftEnum)->getDeclaredInterfaceType(), false};

0 commit comments

Comments
 (0)