Skip to content

Commit 631250b

Browse files
committed
Re-apply "Make all CF types Equatable and Hashable."
Like NSObject, CFType has primitive operations CFEqual and CFHash, so Swift should allow those types to show up in Hashable positions (like dictionaries). The most general way to do this was to introduce a new protocol, _CFObject, and then have the importer automatically make all CF types conform to it. This did require one additional change: the == implementation that calls through to CFEqual is in a new CoreFoundation overlay, but the conformance is in the underlying Clang module. Therefore, operator lookup for conformances has been changed to look in the overlay for an imported declaration (if there is one). This re-applies 361ab62, reverted in f50b1e7, after a /very/ long interval where we decided if it was worth breaking people who've added these conformances on their own. Since the workaround isn't too difficult--- use `#if swift(>=3.2)` to guard the extension introducing the conformance---it was deemed acceptable. https://bugs.swift.org/browse/SR-2388
1 parent 994dcd9 commit 631250b

27 files changed

+376
-97
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ CHANGELOG
2121
Swift 4.0
2222
---------
2323

24+
* Core Foundation types implicitly conform to Hashable (and Equatable), using
25+
CFHash and CFEqual as the implementation. This change applies even to "Swift
26+
3 mode", so if you were previously adding this conformance yourself, use
27+
`#if swift(>=3.2)` to restrict the extension to Swift 3.1 and below.
28+
([SR-2388](https://bugs.swift.org/browse/SR-2388))
29+
2430
* [SE-0156][]
2531

2632
Protocol composition types can now contain one or more class type terms,

include/swift/AST/KnownIdentifiers.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ IDENTIFIER(container)
3434
IDENTIFIER(CoreGraphics)
3535
IDENTIFIER(CoreMedia)
3636
IDENTIFIER(CGFloat)
37+
IDENTIFIER(CoreFoundation)
3738
IDENTIFIER(CVarArg)
3839
IDENTIFIER(Darwin)
3940
IDENTIFIER(dealloc)

include/swift/AST/KnownProtocols.def

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,17 @@ PROTOCOL(Comparable)
5757
PROTOCOL(Error)
5858
PROTOCOL_(ErrorCodeProtocol)
5959
PROTOCOL(OptionSet)
60+
6061
PROTOCOL_(BridgedNSError)
6162
PROTOCOL_(BridgedStoredNSError)
63+
PROTOCOL_(CFObject)
64+
PROTOCOL_(SwiftNewtypeWrapper)
6265
PROTOCOL(CodingKey)
6366
PROTOCOL(Encodable)
6467
PROTOCOL(Decodable)
6568

6669
PROTOCOL_(ObjectiveCBridgeable)
6770
PROTOCOL_(DestructorSafeContainer)
68-
PROTOCOL_(SwiftNewtypeWrapper)
6971

7072
EXPRESSIBLE_BY_LITERAL_PROTOCOL(ExpressibleByArrayLiteral)
7173
EXPRESSIBLE_BY_LITERAL_PROTOCOL(ExpressibleByBooleanLiteral)

lib/AST/ASTContext.cpp

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -761,23 +761,26 @@ ProtocolDecl *ASTContext::getProtocol(KnownProtocolKind kind) const {
761761
// Find all of the declarations with this name in the appropriate module.
762762
SmallVector<ValueDecl *, 1> results;
763763

764-
// _BridgedNSError, _BridgedStoredNSError, and _ErrorCodeProtocol
765-
// are in the Foundation module.
766-
if (kind == KnownProtocolKind::BridgedNSError ||
767-
kind == KnownProtocolKind::BridgedStoredNSError ||
768-
kind == KnownProtocolKind::ErrorCodeProtocol) {
769-
ModuleDecl *foundation =
770-
const_cast<ASTContext *>(this)->getLoadedModule(Id_Foundation);
771-
if (!foundation)
772-
return nullptr;
773-
774-
auto identifier = getIdentifier(getProtocolName(kind));
775-
foundation->lookupValue({ }, identifier, NLKind::UnqualifiedLookup,
776-
results);
777-
} else {
778-
lookupInSwiftModule(getProtocolName(kind), results);
764+
const ModuleDecl *M;
765+
switch (kind) {
766+
case KnownProtocolKind::BridgedNSError:
767+
case KnownProtocolKind::BridgedStoredNSError:
768+
case KnownProtocolKind::ErrorCodeProtocol:
769+
M = getLoadedModule(Id_Foundation);
770+
break;
771+
case KnownProtocolKind::CFObject:
772+
M = getLoadedModule(Id_CoreFoundation);
773+
break;
774+
default:
775+
M = getStdlibModule();
776+
break;
779777
}
780778

779+
if (!M)
780+
return nullptr;
781+
M->lookupValue({ }, getIdentifier(getProtocolName(kind)),
782+
NLKind::UnqualifiedLookup, results);
783+
781784
for (auto result : results) {
782785
if (auto protocol = dyn_cast<ProtocolDecl>(result)) {
783786
Impl.KnownProtocols[index] = protocol;

lib/ClangImporter/ImportDecl.cpp

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,17 +1186,19 @@ createValueConstructor(ClangImporter::Implementation &Impl,
11861186
return constructor;
11871187
}
11881188

1189-
static void populateInheritedTypes(ClangImporter::Implementation &Impl,
1190-
NominalTypeDecl *nominal,
1191-
ArrayRef<ProtocolDecl *> protocols) {
1189+
static void populateInheritedTypes(NominalTypeDecl *nominal,
1190+
ArrayRef<ProtocolDecl *> protocols,
1191+
Type superclass = Type()) {
11921192
SmallVector<TypeLoc, 4> inheritedTypes;
1193-
inheritedTypes.resize(protocols.size());
1194-
for_each(MutableArrayRef<TypeLoc>(inheritedTypes),
1195-
ArrayRef<ProtocolDecl *>(protocols),
1193+
if (superclass)
1194+
inheritedTypes.push_back(TypeLoc::withoutLoc(superclass));
1195+
inheritedTypes.resize(protocols.size() + (superclass ? 1 : 0));
1196+
for_each(MutableArrayRef<TypeLoc>(inheritedTypes).drop_front(superclass?1:0),
1197+
protocols,
11961198
[](TypeLoc &tl, ProtocolDecl *proto) {
11971199
tl = TypeLoc::withoutLoc(proto->getDeclaredType());
11981200
});
1199-
nominal->setInherited(Impl.SwiftContext.AllocateCopy(inheritedTypes));
1201+
nominal->setInherited(nominal->getASTContext().AllocateCopy(inheritedTypes));
12001202
nominal->setCheckedInheritanceClause();
12011203
}
12021204

@@ -1206,7 +1208,7 @@ addProtocolsToStruct(ClangImporter::Implementation &Impl,
12061208
StructDecl *structDecl,
12071209
ArrayRef<KnownProtocolKind> synthesizedProtocolAttrs,
12081210
ArrayRef<ProtocolDecl *> protocols) {
1209-
populateInheritedTypes(Impl, structDecl, protocols);
1211+
populateInheritedTypes(structDecl, protocols);
12101212

12111213
// Note synthesized protocols
12121214
for (auto kind : synthesizedProtocolAttrs)
@@ -4693,9 +4695,14 @@ SwiftDeclConverter::importCFClassType(const clang::TypedefNameDecl *decl,
46934695
addObjCAttribute(theClass, None);
46944696
Impl.registerExternalDecl(theClass);
46954697

4696-
SmallVector<ProtocolDecl *, 4> protocols;
4697-
theClass->getImplicitProtocols(protocols);
4698-
addObjCProtocolConformances(theClass, protocols);
4698+
auto *cfObjectProto =
4699+
Impl.SwiftContext.getProtocol(KnownProtocolKind::CFObject);
4700+
if (cfObjectProto) {
4701+
populateInheritedTypes(theClass, cfObjectProto, superclass);
4702+
auto *attr = new (Impl.SwiftContext) SynthesizedProtocolAttr(
4703+
KnownProtocolKind::CFObject);
4704+
theClass->getAttrs().add(attr);
4705+
}
46994706

47004707
// Look for bridging attributes on the clang record. We can
47014708
// just check the most recent redeclaration, which will inherit

lib/IRGen/GenMeta.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5533,6 +5533,7 @@ SpecialProtocol irgen::getSpecialProtocolID(ProtocolDecl *P) {
55335533
case KnownProtocolKind::OptionSet:
55345534
case KnownProtocolKind::BridgedNSError:
55355535
case KnownProtocolKind::BridgedStoredNSError:
5536+
case KnownProtocolKind::CFObject:
55365537
case KnownProtocolKind::ErrorCodeProtocol:
55375538
case KnownProtocolKind::ExpressibleByBuiltinConstStringLiteral:
55385539
case KnownProtocolKind::ExpressibleByBuiltinConstUTF16StringLiteral:

lib/Sema/TypeCheckProtocol.cpp

Lines changed: 69 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,39 +1360,82 @@ bool WitnessChecker::findBestWitness(
13601360
unsigned &numViable,
13611361
unsigned &bestIdx,
13621362
bool &doNotDiagnoseMatches) {
1363-
auto witnesses = lookupValueWitnesses(requirement, ignoringNames);
1363+
enum Attempt {
1364+
Regular,
1365+
OperatorsFromOverlay,
1366+
Done
1367+
};
13641368

1365-
// Match each of the witnesses to the requirement.
1366-
bool anyFromUnconstrainedExtension = false;
1369+
bool anyFromUnconstrainedExtension;
13671370
numViable = 0;
1368-
bestIdx = 0;
1369-
1370-
for (auto witness : witnesses) {
1371-
// Don't match anything in a protocol.
1372-
// FIXME: When default implementations come along, we can try to match
1373-
// these when they're default implementations coming from another
1374-
// (unrelated) protocol.
1375-
if (isa<ProtocolDecl>(witness->getDeclContext())) {
1376-
continue;
1377-
}
13781371

1379-
if (!witness->hasInterfaceType())
1380-
TC.validateDecl(witness);
1372+
for (Attempt attempt = Regular; numViable == 0 && attempt != Done;
1373+
attempt = static_cast<Attempt>(attempt + 1)) {
1374+
SmallVector<ValueDecl *, 4> witnesses;
1375+
switch (attempt) {
1376+
case Regular:
1377+
witnesses = lookupValueWitnesses(requirement, ignoringNames);
1378+
break;
1379+
case OperatorsFromOverlay: {
1380+
// If we have a Clang declaration, the matching operator might be in the
1381+
// overlay for that module.
1382+
if (!requirement->isOperator())
1383+
continue;
13811384

1382-
auto match = matchWitness(TC, Proto, conformance, DC,
1383-
requirement, witness, reqEnvironment);
1384-
if (match.isViable()) {
1385-
++numViable;
1386-
bestIdx = matches.size();
1387-
} else if (match.Kind == MatchKind::WitnessInvalid) {
1388-
doNotDiagnoseMatches = true;
1385+
auto *clangModule =
1386+
dyn_cast<ClangModuleUnit>(DC->getModuleScopeContext());
1387+
if (!clangModule)
1388+
continue;
1389+
1390+
DeclContext *overlay = clangModule->getAdapterModule();
1391+
if (!overlay)
1392+
continue;
1393+
1394+
auto lookupOptions = defaultUnqualifiedLookupOptions;
1395+
lookupOptions |= NameLookupFlags::KnownPrivate;
1396+
auto lookup = TC.lookupUnqualified(overlay, requirement->getName(),
1397+
SourceLoc(), lookupOptions);
1398+
for (auto candidate : lookup)
1399+
witnesses.push_back(candidate.Decl);
1400+
break;
13891401
}
1402+
case Done:
1403+
llvm_unreachable("should have exited loop");
1404+
}
1405+
1406+
// Match each of the witnesses to the requirement.
1407+
anyFromUnconstrainedExtension = false;
1408+
bestIdx = 0;
1409+
1410+
for (auto witness : witnesses) {
1411+
// Don't match anything in a protocol.
1412+
// FIXME: When default implementations come along, we can try to match
1413+
// these when they're default implementations coming from another
1414+
// (unrelated) protocol.
1415+
if (isa<ProtocolDecl>(witness->getDeclContext())) {
1416+
continue;
1417+
}
13901418

1391-
if (auto *ext = dyn_cast<ExtensionDecl>(match.Witness->getDeclContext()))
1392-
if (!ext->isConstrainedExtension() && ext->getAsProtocolExtensionContext())
1393-
anyFromUnconstrainedExtension = true;
1419+
if (!witness->hasInterfaceType())
1420+
TC.validateDecl(witness);
13941421

1395-
matches.push_back(std::move(match));
1422+
auto match = matchWitness(TC, Proto, conformance, DC,
1423+
requirement, witness, reqEnvironment);
1424+
if (match.isViable()) {
1425+
++numViable;
1426+
bestIdx = matches.size();
1427+
} else if (match.Kind == MatchKind::WitnessInvalid) {
1428+
doNotDiagnoseMatches = true;
1429+
}
1430+
1431+
if (auto *ext = dyn_cast<ExtensionDecl>(match.Witness->getDeclContext())){
1432+
if (!ext->isConstrainedExtension() &&
1433+
ext->getAsProtocolExtensionContext())
1434+
anyFromUnconstrainedExtension = true;
1435+
}
1436+
1437+
matches.push_back(std::move(match));
1438+
}
13961439
}
13971440

13981441
if (numViable == 0) {

stdlib/public/SDK/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if(SWIFT_BUILD_STATIC_SDK_OVERLAY)
88
list(APPEND SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES STATIC)
99
endif()
1010

11-
set(all_overlays "AppKit;AssetsLibrary;AVFoundation;CallKit;CloudKit;Contacts;CoreAudio;CoreData;CoreGraphics;CoreImage;CoreLocation;CoreMedia;CryptoTokenKit;Dispatch;Foundation;GameplayKit;GLKit;HomeKit;IOKit;Intents;MapKit;ObjectiveC;OpenCL;os;Photos;QuartzCore;SafariServices;SceneKit;simd;SpriteKit;UIKit;WatchKit;XCTest;XPC")
11+
set(all_overlays "AppKit;AssetsLibrary;AVFoundation;CallKit;CloudKit;Contacts;CoreAudio;CoreData;CoreFoundation;CoreGraphics;CoreImage;CoreLocation;CoreMedia;CryptoTokenKit;Dispatch;Foundation;GameplayKit;GLKit;HomeKit;IOKit;Intents;MapKit;ObjectiveC;OpenCL;os;Photos;QuartzCore;SafariServices;SceneKit;simd;SpriteKit;UIKit;WatchKit;XCTest;XPC")
1212

1313
if(DEFINED SWIFT_OVERLAY_TARGETS)
1414
set(overlays_to_build ${SWIFT_OVERLAY_TARGETS})

stdlib/public/SDK/CoreAudio/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ add_swift_library(swiftCoreAudio ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK
88
SWIFT_COMPILE_FLAGS "${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}"
99
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
1010
TARGET_SDKS OSX IOS IOS_SIMULATOR TVOS TVOS_SIMULATOR WATCHOS WATCHOS_SIMULATOR
11-
SWIFT_MODULE_DEPENDS_OSX Darwin Dispatch ObjectiveC # auto-updated
12-
SWIFT_MODULE_DEPENDS_IOS Darwin Dispatch ObjectiveC # auto-updated
13-
SWIFT_MODULE_DEPENDS_TVOS Darwin Dispatch ObjectiveC # auto-updated
14-
SWIFT_MODULE_DEPENDS_WATCHOS Darwin Dispatch ObjectiveC # auto-updated
11+
SWIFT_MODULE_DEPENDS_OSX Darwin CoreFoundation Dispatch ObjectiveC # auto-updated
12+
SWIFT_MODULE_DEPENDS_IOS Darwin CoreFoundation Dispatch ObjectiveC # auto-updated
13+
SWIFT_MODULE_DEPENDS_TVOS Darwin CoreFoundation Dispatch ObjectiveC # auto-updated
14+
SWIFT_MODULE_DEPENDS_WATCHOS Darwin CoreFoundation Dispatch ObjectiveC # auto-updated
1515
FRAMEWORK_DEPENDS CoreAudio
1616

1717
DEPLOYMENT_VERSION_OSX ${SWIFTLIB_DEPLOYMENT_VERSION_COREAUDIO_OSX}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
add_swift_library(swiftCoreFoundation ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY
2+
CoreFoundation.swift
3+
4+
SWIFT_COMPILE_FLAGS "${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}"
5+
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
6+
SWIFT_MODULE_DEPENDS_OSX Darwin Dispatch ObjectiveC
7+
SWIFT_MODULE_DEPENDS_IOS Darwin Dispatch ObjectiveC
8+
SWIFT_MODULE_DEPENDS_TVOS Darwin Dispatch ObjectiveC
9+
SWIFT_MODULE_DEPENDS_WATCHOS Darwin Dispatch ObjectiveC
10+
FRAMEWORK_DEPENDS CoreFoundation)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See http://swift.org/LICENSE.txt for license information
9+
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
@_exported import CoreFoundation
14+
15+
public protocol _CFObject: class, Hashable {}
16+
extension _CFObject {
17+
public var hashValue: Int {
18+
return Int(bitPattern: CFHash(self))
19+
}
20+
public static func ==(left: Self, right: Self) -> Bool {
21+
return CFEqual(left, right)
22+
}
23+
}

stdlib/public/SDK/CoreGraphics/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ add_swift_library(swiftCoreGraphics ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_
1010
# SWIFT_COMPILE_FLAGS ${STDLIB_SIL_SERIALIZE_ALL}
1111
SWIFT_COMPILE_FLAGS "${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}"
1212
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
13-
SWIFT_MODULE_DEPENDS_OSX Darwin Dispatch IOKit ObjectiveC # auto-updated
14-
SWIFT_MODULE_DEPENDS_IOS Darwin Dispatch ObjectiveC # auto-updated
15-
SWIFT_MODULE_DEPENDS_TVOS Darwin Dispatch ObjectiveC # auto-updated
16-
SWIFT_MODULE_DEPENDS_WATCHOS Darwin Dispatch ObjectiveC # auto-updated
13+
SWIFT_MODULE_DEPENDS_OSX Darwin CoreFoundation Dispatch IOKit ObjectiveC # auto-updated
14+
SWIFT_MODULE_DEPENDS_IOS Darwin CoreFoundation Dispatch ObjectiveC # auto-updated
15+
SWIFT_MODULE_DEPENDS_TVOS Darwin CoreFoundation Dispatch ObjectiveC # auto-updated
16+
SWIFT_MODULE_DEPENDS_WATCHOS Darwin CoreFoundation Dispatch ObjectiveC # auto-updated
1717
FRAMEWORK_DEPENDS CoreGraphics
1818

1919
DEPLOYMENT_VERSION_OSX ${SWIFTLIB_DEPLOYMENT_VERSION_COREGRAPHICS_OSX}

stdlib/public/SDK/CoreGraphics/CoreGraphics.swift

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ extension CGColor {
4646
#endif
4747
}
4848

49-
extension CGColor: Equatable {}
50-
public func ==(lhs: CGColor, rhs: CGColor) -> Bool {
51-
return lhs.__equalTo(rhs)
52-
}
53-
5449

5550
//===----------------------------------------------------------------------===//
5651
// CGColorSpace
@@ -476,11 +471,6 @@ extension CGPath {
476471
}
477472
}
478473

479-
extension CGPath: Equatable {}
480-
public func ==(lhs: CGPath, rhs: CGPath) -> Bool {
481-
return lhs.__equalTo(rhs)
482-
}
483-
484474
extension CGMutablePath {
485475

486476
public func addRoundedRect(in rect: CGRect, cornerWidth: CGFloat,

stdlib/public/SDK/Foundation/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ add_swift_library(swiftFoundation ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SD
5555
SWIFT_COMPILE_FLAGS "${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}"
5656
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
5757

58-
SWIFT_MODULE_DEPENDS_OSX Darwin CoreGraphics Dispatch IOKit ObjectiveC # auto-updated
59-
SWIFT_MODULE_DEPENDS_IOS Darwin CoreGraphics Dispatch ObjectiveC # auto-updated
60-
SWIFT_MODULE_DEPENDS_TVOS Darwin CoreGraphics Dispatch ObjectiveC # auto-updated
61-
SWIFT_MODULE_DEPENDS_WATCHOS Darwin CoreGraphics Dispatch ObjectiveC # auto-updated
58+
SWIFT_MODULE_DEPENDS_OSX Darwin CoreFoundation CoreGraphics Dispatch IOKit ObjectiveC # auto-updated
59+
SWIFT_MODULE_DEPENDS_IOS Darwin CoreFoundation CoreGraphics Dispatch ObjectiveC # auto-updated
60+
SWIFT_MODULE_DEPENDS_TVOS Darwin CoreFoundation CoreGraphics Dispatch ObjectiveC # auto-updated
61+
SWIFT_MODULE_DEPENDS_WATCHOS Darwin CoreFoundation CoreGraphics Dispatch ObjectiveC # auto-updated
6262
FRAMEWORK_DEPENDS Foundation
6363

6464
DEPLOYMENT_VERSION_OSX ${SWIFTLIB_DEPLOYMENT_VERSION_FOUNDATION_OSX}

stdlib/public/SDK/IOKit/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ add_swift_library(swiftIOKit ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVE
77
SWIFT_COMPILE_FLAGS "${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}"
88
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
99
TARGET_SDKS OSX
10-
SWIFT_MODULE_DEPENDS_OSX Darwin Dispatch ObjectiveC # auto-updated
10+
SWIFT_MODULE_DEPENDS_OSX Darwin CoreFoundation Dispatch ObjectiveC # auto-updated
1111
FRAMEWORK_DEPENDS IOKit
1212

1313
DEPLOYMENT_VERSION_OSX ${SWIFTLIB_DEPLOYMENT_VERSION_IOKIT_OSX}

test/ClangImporter/Inputs/SwiftPrivateAttr.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ struct NSOptions : OptionSet {
109109
}
110110
@available(swift, obsoleted: 3, renamed: "__PrivCFType")
111111
typealias __PrivCFTypeRef = __PrivCFType
112-
class __PrivCFType {
112+
class __PrivCFType : _CFObject {
113113
}
114114
@available(swift, obsoleted: 3, renamed: "__PrivCFSub")
115115
typealias __PrivCFSubRef = __PrivCFSub
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
framework module Foo {
22
header "header-to-print.h"
33
header "other-header.h"
4+
export *
45
}

0 commit comments

Comments
 (0)