@@ -160,15 +160,6 @@ namespace {
160
160
explicit operator bool () const { return (bool ) AbstractType; }
161
161
};
162
162
163
- static OptionalTypeKind getOptionalKind (ImportTypeKind kind,
164
- OptionalTypeKind OptKind) {
165
- // Import pointee types as true Optional.
166
- if (OptKind == OTK_ImplicitlyUnwrappedOptional &&
167
- kind == ImportTypeKind::Pointee)
168
- return OTK_Optional;
169
- return OptKind;
170
- }
171
-
172
163
class SwiftTypeConverter :
173
164
public clang::TypeVisitor<SwiftTypeConverter, ImportResult>
174
165
{
@@ -393,7 +384,7 @@ namespace {
393
384
pointeeType = Impl.getNamedSwiftType (Impl.getStdlibModule (), " Void" );
394
385
else
395
386
pointeeType = Impl.importTypeIgnoreIUO (
396
- pointeeQualType, ImportTypeKind::Pointee , AllowNSUIntegerAsInt,
387
+ pointeeQualType, ImportTypeKind::Value , AllowNSUIntegerAsInt,
397
388
Bridgeability::None);
398
389
399
390
// If the pointed-to type is unrepresentable in Swift, or its C
@@ -479,7 +470,7 @@ namespace {
479
470
// we can cheese static-offset "indexing" using .$n operations.
480
471
481
472
Type elementType = Impl.importTypeIgnoreIUO (
482
- type->getElementType (), ImportTypeKind::Pointee , AllowNSUIntegerAsInt,
473
+ type->getElementType (), ImportTypeKind::Value , AllowNSUIntegerAsInt,
483
474
Bridgeability::None);
484
475
if (!elementType)
485
476
return Type ();
@@ -1096,7 +1087,6 @@ static bool canBridgeTypes(ImportTypeKind importKind) {
1096
1087
case ImportTypeKind::Value:
1097
1088
case ImportTypeKind::Variable:
1098
1089
case ImportTypeKind::AuditedVariable:
1099
- case ImportTypeKind::Pointee:
1100
1090
case ImportTypeKind::Enum:
1101
1091
case ImportTypeKind::RecordField:
1102
1092
return false ;
@@ -1124,7 +1114,6 @@ static bool isCFAudited(ImportTypeKind importKind) {
1124
1114
case ImportTypeKind::ObjCCollectionElement:
1125
1115
case ImportTypeKind::Variable:
1126
1116
case ImportTypeKind::Result:
1127
- case ImportTypeKind::Pointee:
1128
1117
case ImportTypeKind::Enum:
1129
1118
case ImportTypeKind::RecordField:
1130
1119
return false ;
@@ -1398,7 +1387,6 @@ static ImportedType adjustTypeForConcreteImport(
1398
1387
// optional type.
1399
1388
bool isIUO = false ;
1400
1389
if (importKind != ImportTypeKind::Typedef && canImportAsOptional (hint)) {
1401
- optKind = getOptionalKind (importKind, optKind);
1402
1390
isIUO = optKind == OTK_ImplicitlyUnwrappedOptional;
1403
1391
if (optKind != OTK_None)
1404
1392
importedType = OptionalType::get (importedType);
@@ -2044,14 +2032,11 @@ ImportedType ClangImporter::Implementation::importMethodType(
2044
2032
bool paramIsIUO;
2045
2033
if (kind == SpecialMethodKind::NSDictionarySubscriptGetter &&
2046
2034
paramTy->isObjCIdType ()) {
2047
- auto optKind =
2048
- getOptionalKind (ImportTypeKind::Parameter, optionalityOfParam);
2049
-
2050
2035
swiftParamTy = SwiftContext.getNSCopyingDecl ()->getDeclaredType ();
2051
- if (optKind != OTK_None)
2036
+ if (optionalityOfParam != OTK_None)
2052
2037
swiftParamTy = OptionalType::get (swiftParamTy);
2053
2038
2054
- paramIsIUO = optKind == OTK_ImplicitlyUnwrappedOptional;
2039
+ paramIsIUO = optionalityOfParam == OTK_ImplicitlyUnwrappedOptional;
2055
2040
} else {
2056
2041
ImportTypeKind importKind = ImportTypeKind::Parameter;
2057
2042
if (param->hasAttr <clang::CFReturnsRetainedAttr>())
0 commit comments