Skip to content

Commit ae8a506

Browse files
committed
[AST] BridgeObject uses ReferenceCounting::Bridge even without ObjC interop.
1 parent b08a6f5 commit ae8a506

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/AST/Type.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4012,9 +4012,12 @@ ReferenceCounting TypeBase::getReferenceCounting() {
40124012
ASTContext &ctx = type->getASTContext();
40134013

40144014
// In the absence of Objective-C interoperability, everything uses native
4015-
// reference counting.
4016-
if (!ctx.LangOpts.EnableObjCInterop)
4017-
return ReferenceCounting::Native;
4015+
// reference counting or is the builtin BridgeObject.
4016+
if (!ctx.LangOpts.EnableObjCInterop) {
4017+
return type->getKind() == TypeKind::BuiltinBridgeObject
4018+
? ReferenceCounting::Bridge
4019+
: ReferenceCounting::Native;
4020+
}
40184021

40194022
switch (type->getKind()) {
40204023
#define SUGARED_TYPE(id, parent) case TypeKind::id:

0 commit comments

Comments
 (0)