propagate attributes onto property decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64643 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 9a4023f..191ac4b 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -1264,9 +1264,9 @@
     // 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 (ObjCContainerDecl::prop_iterator i = CDecl->prop_begin(),
-                                          e = CDecl->prop_end(); i != e; ++i)
-      ProcessPropertyDecl((*i), CDecl);
+    for (ObjCContainerDecl::prop_iterator I = CDecl->prop_begin(),
+                                          E = CDecl->prop_end(); I != E; ++I)
+      ProcessPropertyDecl(*I, CDecl);
     CDecl->setAtEndLoc(AtEndLoc);
   }
   if (ObjCImplementationDecl *IC=dyn_cast<ObjCImplementationDecl>(ClassDecl)) {
@@ -1276,10 +1276,10 @@
   } else if (ObjCCategoryImplDecl* CatImplClass = 
                                    dyn_cast<ObjCCategoryImplDecl>(ClassDecl)) {
     CatImplClass->setLocEnd(AtEndLoc);
-    ObjCInterfaceDecl* IDecl = CatImplClass->getClassInterface();
+    
     // Find category interface decl and then check that all methods declared
     // in this interface are implemented in the category @implementation.
-    if (IDecl) {
+    if (ObjCInterfaceDecl* IDecl = CatImplClass->getClassInterface()) {
       for (ObjCCategoryDecl *Categories = IDecl->getCategoryList();
            Categories; Categories = Categories->getNextClassCategory()) {
         if (Categories->getIdentifier() == CatImplClass->getIdentifier()) {
@@ -1586,6 +1586,8 @@
   ObjCPropertyDecl *PDecl = ObjCPropertyDecl::Create(Context, DC, AtLoc, 
                                                      FD.D.getIdentifier(), T);
   DC->addDecl(PDecl);
+  
+  ProcessDeclAttributes(PDecl, FD.D);
 
   // Regardless of setter/getter attribute, we save the default getter/setter
   // selector names in anticipation of declaration of setter/getter methods.