@@ -99,11 +99,6 @@ namespace {
99
99
100
100
// / The source type is any other pointer type.
101
101
OtherPointer,
102
-
103
- // / The source type created a new Swift type, using swift_newtype, of an
104
- // / original underlying CFPointer. This distinction is necessary to
105
- // / trigger audit-checking.
106
- SwiftNewtypeFromCFPointer,
107
102
};
108
103
109
104
ImportHintKind Kind;
@@ -141,7 +136,6 @@ namespace {
141
136
case ImportHint::ObjCPointer:
142
137
case ImportHint::CFunctionPointer:
143
138
case ImportHint::OtherPointer:
144
- case ImportHint::SwiftNewtypeFromCFPointer:
145
139
case ImportHint::VAList:
146
140
return true ;
147
141
}
@@ -652,10 +646,6 @@ namespace {
652
646
Type mappedType = decl->getDeclaredInterfaceType ();
653
647
654
648
if (getSwiftNewtypeAttr (type->getDecl (), Impl.CurrentVersion )) {
655
- if (isCFTypeDecl (type->getDecl ())) {
656
- return {mappedType, ImportHint::SwiftNewtypeFromCFPointer};
657
- }
658
-
659
649
auto underlying = Visit (type->getDecl ()->getUnderlyingType ());
660
650
switch (underlying.Hint ) {
661
651
case ImportHint::None:
@@ -665,7 +655,6 @@ namespace {
665
655
case ImportHint::ObjCPointer:
666
656
case ImportHint::CFunctionPointer:
667
657
case ImportHint::OtherPointer:
668
- case ImportHint::SwiftNewtypeFromCFPointer:
669
658
case ImportHint::VAList:
670
659
return {mappedType, underlying.Hint };
671
660
@@ -1368,17 +1357,11 @@ static ImportedType adjustTypeForConcreteImport(
1368
1357
case ImportHint::CFPointer:
1369
1358
// Wrap CF pointers up as unmanaged types, unless this is an audited
1370
1359
// context.
1371
- if (!isCFAudited (importKind))
1372
- importedType = getUnmanagedType (impl, importedType);
1373
- break ;
1374
-
1375
- case ImportHint::SwiftNewtypeFromCFPointer:
1376
- // For types we import as new types in Swift, if the use is CF un-audited,
1377
- // then we have to force it to be unmanaged
1378
1360
if (!isCFAudited (importKind)) {
1379
- auto underlyingType = importedType->getSwiftNewtypeUnderlyingType ();
1380
- if (underlyingType)
1381
- importedType = getUnmanagedType (impl, underlyingType);
1361
+ Type underlyingType = importedType->getSwiftNewtypeUnderlyingType ();
1362
+ if (!underlyingType)
1363
+ underlyingType = importedType;
1364
+ importedType = getUnmanagedType (impl, underlyingType);
1382
1365
}
1383
1366
break ;
1384
1367
0 commit comments