Address Jordan's review: comments, spaces.
authorAnna Zaks <ganna@apple.com>
Wed, 31 Oct 2012 01:18:22 +0000 (01:18 +0000)
committerAnna Zaks <ganna@apple.com>
Wed, 31 Oct 2012 01:18:22 +0000 (01:18 +0000)
llvm-svn: 167091

clang/include/clang/AST/DeclObjC.h
clang/lib/AST/DeclObjC.cpp
clang/lib/Sema/SemaObjCProperty.cpp

index 4d48efd..8b27dd8 100644 (file)
@@ -541,11 +541,12 @@ public:
 
   ObjCPropertyDecl *FindPropertyDeclaration(IdentifierInfo *PropertyId) const;
 
-  typedef llvm::DenseMap<IdentifierInfo *, ObjCPropertyDecl*> PropertyMap;
+  typedef llvm::DenseMap<IdentifierInfo*, ObjCPropertyDecl*> PropertyMap;
 
   /// This routine collects list of properties to be implemented in the class.
   /// This includes, class's and its conforming protocols' properties.
-  virtual void collectPropertiesToImplement(PropertyMap& PM) const {}
+  /// Note, the superclass's properties are not included in the list.
+  virtual void collectPropertiesToImplement(PropertyMap &PM) const {}
 
   SourceLocation getAtStartLoc() const { return AtStart; }
   void setAtStartLoc(SourceLocation Loc) { AtStart = Loc; }
@@ -906,7 +907,7 @@ public:
   ObjCPropertyDecl
     *FindPropertyVisibleInPrimaryClass(IdentifierInfo *PropertyId) const;
 
-  virtual void collectPropertiesToImplement(PropertyMapPM) const;
+  virtual void collectPropertiesToImplement(PropertyMap &PM) const;
 
   /// isSuperClassOf - Return true if this class is the specified class or is a
   /// super class of the specified interface class.
@@ -1302,7 +1303,7 @@ public:
     return getFirstDeclaration();
   }
 
-  virtual void collectPropertiesToImplement(PropertyMapPM) const;
+  virtual void collectPropertiesToImplement(PropertyMap &PM) const;
 
   static bool classof(const Decl *D) { return classofKind(D->getKind()); }
   static bool classofKind(Kind K) { return K == ObjCProtocol; }
index 5eb9cdc..65a9878 100644 (file)
@@ -190,7 +190,7 @@ ObjCInterfaceDecl::FindPropertyVisibleInPrimaryClass(
   return 0;
 }
 
-void ObjCInterfaceDecl::collectPropertiesToImplement(PropertyMapPM) const {
+void ObjCInterfaceDecl::collectPropertiesToImplement(PropertyMap &PM) const {
   for (ObjCContainerDecl::prop_iterator P = prop_begin(),
       E = prop_end(); P != E; ++P) {
     ObjCPropertyDecl *Prop = *P;
@@ -200,6 +200,9 @@ void ObjCInterfaceDecl::collectPropertiesToImplement(PropertyMap& PM) const {
       PI = all_referenced_protocol_begin(),
       E = all_referenced_protocol_end(); PI != E; ++PI)
     (*PI)->collectPropertiesToImplement(PM);
+  // Note, the properties declared only in class extensions are still copied
+  // into the main @interface's property list, and therefore we don't
+  // explicitly, have to search class extension properties.
 }
 
 void ObjCInterfaceDecl::mergeClassExtensionProtocolList(
@@ -1325,7 +1328,7 @@ void ObjCProtocolDecl::startDefinition() {
     RD->Data = this->Data;
 }
 
-void ObjCProtocolDecl::collectPropertiesToImplement(PropertyMapPM) const {
+void ObjCProtocolDecl::collectPropertiesToImplement(PropertyMap &PM) const {
   for (ObjCProtocolDecl::prop_iterator P = prop_begin(),
       E = prop_end(); P != E; ++P) {
     ObjCPropertyDecl *Prop = *P;
index de608a1..8d70860 100644 (file)
@@ -1440,8 +1440,8 @@ bool Sema::isPropertyReadonly(ObjCPropertyDecl *PDecl,
 /// CollectImmediateProperties - This routine collects all properties in
 /// the class and its conforming protocols; but not those it its super class.
 void Sema::CollectImmediateProperties(ObjCContainerDecl *CDecl,
-            ObjCContainerDecl::PropertyMapPropMap,
-            ObjCContainerDecl::PropertyMapSuperPropMap) {
+            ObjCContainerDecl::PropertyMap &PropMap,
+            ObjCContainerDecl::PropertyMap &SuperPropMap) {
   if (ObjCInterfaceDecl *IDecl = dyn_cast<ObjCInterfaceDecl>(CDecl)) {
     for (ObjCContainerDecl::prop_iterator P = IDecl->prop_begin(),
          E = IDecl->prop_end(); P != E; ++P) {
@@ -1491,7 +1491,7 @@ void Sema::CollectImmediateProperties(ObjCContainerDecl *CDecl,
 /// properties to be implemented in super class(s) and also coming from their
 /// conforming protocols.
 static void CollectSuperClassPropertyImplementations(ObjCInterfaceDecl *CDecl,
-                                    ObjCInterfaceDecl::PropertyMapPropMap) {
+                                    ObjCInterfaceDecl::PropertyMap &PropMap) {
   if (ObjCInterfaceDecl *SDecl = CDecl->getSuperClass()) {
     while (SDecl) {
       SDecl->collectPropertiesToImplement(PropMap);