Skip to content

Commit d6619e5

Browse files
authored
Merge pull request #18705 from DougGregor/bridge-object-ref-count
[AST] BridgeObject uses ReferenceCounting::Bridge even without ObjC interop
2 parents 6b8d54d + ae8a506 commit d6619e5

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
@@ -4506,9 +4506,12 @@ ReferenceCounting TypeBase::getReferenceCounting() {
45064506
ASTContext &ctx = type->getASTContext();
45074507

45084508
// In the absence of Objective-C interoperability, everything uses native
4509-
// reference counting.
4510-
if (!ctx.LangOpts.EnableObjCInterop)
4511-
return ReferenceCounting::Native;
4509+
// reference counting or is the builtin BridgeObject.
4510+
if (!ctx.LangOpts.EnableObjCInterop) {
4511+
return type->getKind() == TypeKind::BuiltinBridgeObject
4512+
? ReferenceCounting::Bridge
4513+
: ReferenceCounting::Native;
4514+
}
45124515

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

0 commit comments

Comments
 (0)