]> granicus.if.org Git - clang/commitdiff
Class Property: handle class properties.
authorManman Ren <manman.ren@gmail.com>
Wed, 27 Jan 2016 20:00:32 +0000 (20:00 +0000)
committerManman Ren <manman.ren@gmail.com>
Wed, 27 Jan 2016 20:00:32 +0000 (20:00 +0000)
At places where we handle instance properties, if necessary.

rdar://23891898

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258979 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/DeclObjC.cpp
lib/CodeGen/CGDebugInfo.cpp
lib/Sema/SemaDeclObjC.cpp
lib/Sema/SemaObjCProperty.cpp

index aa012edf65cef7fd05c2cd40afba2545bfed6be9..e804fef2432ace32e903bbbb023f02bf102c6bf6 100644 (file)
@@ -122,7 +122,7 @@ bool ObjCContainerDecl::HasUserDeclaredSetterMethod(
       // declaration of this property. If one found, presumably a setter will
       // be provided (properties declared in categories will not get
       // auto-synthesized).
-      for (const auto *P : Cat->instance_properties())
+      for (const auto *P : Cat->properties())
         if (P->getIdentifier() == Property->getIdentifier()) {
           if (P->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_readwrite)
             return true;
@@ -1837,7 +1837,7 @@ void ObjCProtocolDecl::collectInheritedProtocolProperties(
                                                 ProtocolPropertyMap &PM) const {
   if (const ObjCProtocolDecl *PDecl = getDefinition()) {
     bool MatchFound = false;
-    for (auto *Prop : PDecl->instance_properties()) {
+    for (auto *Prop : PDecl->properties()) {
       if (Prop == Property)
         continue;
       if (Prop->getIdentifier() == Property->getIdentifier()) {
index 6d19e50e9f74070bed36188e4e9e28fa4310e353..675b5eb07c575c2fa2273104e64c1db3d08d9766 100644 (file)
@@ -1822,11 +1822,11 @@ llvm::DIType *CGDebugInfo::CreateTypeDefinition(const ObjCInterfaceType *Ty,
   {
     llvm::SmallPtrSet<const IdentifierInfo*, 16> PropertySet;
     for (const ObjCCategoryDecl *ClassExt : ID->known_extensions())
-      for (auto *PD : ClassExt->instance_properties()) {
+      for (auto *PD : ClassExt->properties()) {
         PropertySet.insert(PD->getIdentifier());
         AddProperty(PD);
       }
-    for (const auto *PD : ID->instance_properties()) {
+    for (const auto *PD : ID->properties()) {
       // Don't emit duplicate metadata for properties that were already in a
       // class extension.
       if (!PropertySet.insert(PD->getIdentifier()).second)
index e4e3aef2e6cd0e3586dd3fb7fc376c331a57f2e7..28b70b3c7c637abb5edd0c6bb5361412a9f7003d 100644 (file)
@@ -3637,7 +3637,7 @@ Decl *Sema::ActOnAtEnd(Scope *S, SourceRange AtEnd, ArrayRef<Decl *> allMethods,
       // ProcessPropertyDecl is responsible for diagnosing conflicts with any
       // user-defined setter/getter. It also synthesizes setter/getter methods
       // and adds them to the DeclContext and global method pools.
-      for (auto *I : CDecl->instance_properties())
+      for (auto *I : CDecl->properties())
         ProcessPropertyDecl(I);
     CDecl->setAtEndRange(AtEnd);
   }
index 9a976e6e590dfdb040cb30218523c3d8799670df..e388962138336323c41b63418a8c1bc9bb4d0b3d 100644 (file)
@@ -1904,8 +1904,8 @@ Sema::AtomicPropertySetterGetterRules (ObjCImplDecl* IMPDecl,
     for (auto *Prop : Ext->instance_properties())
       PM[Prop->getIdentifier()] = Prop;
     
-    for (ObjCContainerDecl::PropertyMap::iterator I = PM.begin(), E = PM.end();
-         I != E; ++I) {
+  for (ObjCContainerDecl::PropertyMap::iterator I = PM.begin(), E = PM.end();
+       I != E; ++I) {
     const ObjCPropertyDecl *Property = I->second;
     ObjCMethodDecl *GetterMethod = nullptr;
     ObjCMethodDecl *SetterMethod = nullptr;