Skip to content

Commit 3555e32

Browse files
committed
[ClangImporter] Drop logic to look through block typedefs
John does this in a more sound way in f4f8349, which works in non-top-level positions too.
1 parent 85ccbb4 commit 3555e32

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

lib/ClangImporter/ImportType.cpp

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,28 +1291,8 @@ static Type adjustTypeForConcreteImport(ClangImporter::Implementation &impl,
12911291

12921292
// SwiftTypeConverter turns block pointers into @convention(block) types.
12931293
// In a bridgeable context, or in the direct structure of a typedef,
1294-
// we would prefer to instead use the default Swift convention. But this
1295-
// does means that, when we're using a typedef of a block pointer type in
1296-
// an unbridgable context, we need to go back and do a fully-unbridged
1297-
// import of the underlying type.
1294+
// we would prefer to instead use the default Swift convention.
12981295
if (hint == ImportHint::Block) {
1299-
if (bridging == Bridgeability::None) {
1300-
if (auto typedefType = clangType->getAs<clang::TypedefType>()) {
1301-
// In non-bridged contexts, drop the typealias sugar for blocks.
1302-
// FIXME: This will do the wrong thing if there's any adjustment to do
1303-
// besides optionality.
1304-
Type underlyingTy = impl.importType(typedefType->desugar(),
1305-
importKind,
1306-
allowNSUIntegerAsInt,
1307-
bridging,
1308-
OTK_None);
1309-
if (Type unwrappedTy = underlyingTy->getAnyOptionalObjectType())
1310-
underlyingTy = unwrappedTy;
1311-
if (!underlyingTy->isEqual(importedType))
1312-
importedType = underlyingTy;
1313-
}
1314-
}
1315-
13161296
if (canBridgeTypes(importKind) || importKind == ImportTypeKind::Typedef) {
13171297
auto fTy = importedType->castTo<FunctionType>();
13181298
FunctionType::ExtInfo einfo = fTy->getExtInfo();

0 commit comments

Comments
 (0)