[cfe-commits] r171792 - /cfe/trunk/lib/AST/DeclObjC.cpp

Fariborz Jahanian fjahanian at apple.com
Mon Jan 7 13:31:08 PST 2013


Author: fjahanian
Date: Mon Jan  7 15:31:08 2013
New Revision: 171792

URL: http://llvm.org/viewvc/llvm-project?rev=171792&view=rev
Log:
Minor refactoring of my last patch
related to // rdar://12958878

Modified:
    cfe/trunk/lib/AST/DeclObjC.cpp

Modified: cfe/trunk/lib/AST/DeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclObjC.cpp?rev=171792&r1=171791&r2=171792&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclObjC.cpp (original)
+++ cfe/trunk/lib/AST/DeclObjC.cpp Mon Jan  7 15:31:08 2013
@@ -1352,20 +1352,19 @@
 }
 
 void ObjCProtocolDecl::collectPropertiesToImplement(PropertyMap &PM) const {
-  const ObjCProtocolDecl *PDecl = this;
-  if (!isThisDeclarationADefinition() && getDefinition())
-    PDecl = getDefinition();
-
-  for (ObjCProtocolDecl::prop_iterator P = PDecl->prop_begin(),
-       E = PDecl->prop_end(); P != E; ++P) {
-    ObjCPropertyDecl *Prop = *P;
-    // Insert into PM if not there already.
-    PM.insert(std::make_pair(Prop->getIdentifier(), Prop));
+  
+  if (const ObjCProtocolDecl *PDecl = getDefinition()) {
+    for (ObjCProtocolDecl::prop_iterator P = PDecl->prop_begin(),
+         E = PDecl->prop_end(); P != E; ++P) {
+      ObjCPropertyDecl *Prop = *P;
+      // Insert into PM if not there already.
+      PM.insert(std::make_pair(Prop->getIdentifier(), Prop));
+    }
+    // Scan through protocol's protocols.
+    for (ObjCProtocolDecl::protocol_iterator PI = PDecl->protocol_begin(),
+         E = PDecl->protocol_end(); PI != E; ++PI)
+      (*PI)->collectPropertiesToImplement(PM);
   }
-  // Scan through protocol's protocols.
-  for (ObjCProtocolDecl::protocol_iterator PI = PDecl->protocol_begin(),
-      E = PDecl->protocol_end(); PI != E; ++PI)
-    (*PI)->collectPropertiesToImplement(PM);
 }
 
 





More information about the cfe-commits mailing list