From 20f005d25f488fa1dc69d6792700e014c6a5d165 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Sat, 4 Jan 2020 08:32:49 -0800 Subject: [CodeGen][ObjC] Push the properties of a protocol before pushing the properties of the protocol it inherits This fixes a bug where the type string for a @dynamic property of an @implementation didn't have 'D' in it when the protocol it conforms to redeclares the property declared in the base protocol. rdar://problem/45503561 --- clang/lib/CodeGen/CGObjCMac.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'clang/lib/CodeGen') diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp index e18105fe019..f36c28a85a6 100644 --- a/clang/lib/CodeGen/CGObjCMac.cpp +++ b/clang/lib/CodeGen/CGObjCMac.cpp @@ -3245,9 +3245,6 @@ PushProtocolProperties(llvm::SmallPtrSet &PropertySet, SmallVectorImpl &Properties, const ObjCProtocolDecl *Proto, bool IsClassProperty) { - for (const auto *P : Proto->protocols()) - PushProtocolProperties(PropertySet, Properties, P, IsClassProperty); - for (const auto *PD : Proto->properties()) { if (IsClassProperty != PD->isClassProperty()) continue; @@ -3255,6 +3252,9 @@ PushProtocolProperties(llvm::SmallPtrSet &PropertySet, continue; Properties.push_back(PD); } + + for (const auto *P : Proto->protocols()) + PushProtocolProperties(PropertySet, Properties, P, IsClassProperty); } /* -- cgit v1.2.3