[cfe-commits] r132753 - in /cfe/trunk: include/clang/AST/DeclObjC.h include/clang/Sema/DeclSpec.h lib/Parse/ParseObjc.cpp lib/Sema/SemaObjCProperty.cpp test/SemaObjC/warn-implicit-atomic-property.m

Fariborz Jahanian fjahanian at apple.com
Wed Jun 8 09:40:09 PDT 2011


Author: fjahanian
Date: Wed Jun  8 11:40:09 2011
New Revision: 132753

URL: http://llvm.org/viewvc/llvm-project?rev=132753&view=rev
Log:
Remove 'atomic' as a property attribute keyword.
It is not a sanctioned keyword and is assumed as default.
// rdar://8790791

Modified:
    cfe/trunk/include/clang/AST/DeclObjC.h
    cfe/trunk/include/clang/Sema/DeclSpec.h
    cfe/trunk/lib/Parse/ParseObjc.cpp
    cfe/trunk/lib/Sema/SemaObjCProperty.cpp
    cfe/trunk/test/SemaObjC/warn-implicit-atomic-property.m

Modified: cfe/trunk/include/clang/AST/DeclObjC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=132753&r1=132752&r2=132753&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclObjC.h (original)
+++ cfe/trunk/include/clang/AST/DeclObjC.h Wed Jun  8 11:40:09 2011
@@ -1380,8 +1380,7 @@
     OBJC_PR_retain    = 0x10,
     OBJC_PR_copy      = 0x20,
     OBJC_PR_nonatomic = 0x40,
-    OBJC_PR_setter    = 0x80,
-    OBJC_PR_atomic    = 0x100
+    OBJC_PR_setter    = 0x80
   };
 
   enum SetterKind { Assign, Retain, Copy };

Modified: cfe/trunk/include/clang/Sema/DeclSpec.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/DeclSpec.h?rev=132753&r1=132752&r2=132753&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/DeclSpec.h (original)
+++ cfe/trunk/include/clang/Sema/DeclSpec.h Wed Jun  8 11:40:09 2011
@@ -688,8 +688,7 @@
     DQ_PR_retain = 0x10,
     DQ_PR_copy = 0x20,
     DQ_PR_nonatomic = 0x40,
-    DQ_PR_setter = 0x80,
-    DQ_PR_atomic = 0x100
+    DQ_PR_setter = 0x80
   };
 
 

Modified: cfe/trunk/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=132753&r1=132752&r2=132753&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Wed Jun  8 11:40:09 2011
@@ -512,8 +512,6 @@
       DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_copy);
     else if (II->isStr("nonatomic"))
       DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_nonatomic);
-    else if (II->isStr("atomic"))
-      DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_atomic);
     else if (II->isStr("getter") || II->isStr("setter")) {
       bool IsSetter = II->getNameStart()[0] == 's';
 

Modified: cfe/trunk/lib/Sema/SemaObjCProperty.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=132753&r1=132752&r2=132753&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaObjCProperty.cpp (original)
+++ cfe/trunk/lib/Sema/SemaObjCProperty.cpp Wed Jun  8 11:40:09 2011
@@ -295,8 +295,6 @@
 
   if (Attributes & ObjCDeclSpec::DQ_PR_nonatomic)
     PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_nonatomic);
-  else if (Attributes & ObjCDeclSpec::DQ_PR_atomic)
-    PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_atomic);
 
   PDecl->setPropertyAttributesAsWritten(PDecl->getPropertyAttributes());
   
@@ -348,8 +346,7 @@
       return 0;
     }
     unsigned PIkind = property->getPropertyAttributesAsWritten();
-    if ((PIkind & (ObjCPropertyDecl::OBJC_PR_atomic |
-                   ObjCPropertyDecl::OBJC_PR_nonatomic) ) == 0) {
+    if ((PIkind & ObjCPropertyDecl::OBJC_PR_nonatomic) == 0) {
       if (AtLoc.isValid())
         Diag(AtLoc, diag::warn_implicit_atomic_property);
       else
@@ -1091,8 +1088,7 @@
     unsigned Attributes = Property->getPropertyAttributes();
     unsigned AttributesAsWrittern = Property->getPropertyAttributesAsWritten();
 
-    if (!(AttributesAsWrittern & ObjCPropertyDecl::OBJC_PR_atomic) &&
-        !(AttributesAsWrittern & ObjCPropertyDecl::OBJC_PR_nonatomic)) {
+    if (!(AttributesAsWrittern & ObjCPropertyDecl::OBJC_PR_nonatomic)) {
       GetterMethod = IMPDecl->getInstanceMethod(Property->getGetterName());
       SetterMethod = IMPDecl->getInstanceMethod(Property->getSetterName());
       LookedUpGetterSetter = true;

Modified: cfe/trunk/test/SemaObjC/warn-implicit-atomic-property.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/warn-implicit-atomic-property.m?rev=132753&r1=132752&r2=132753&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/warn-implicit-atomic-property.m (original)
+++ cfe/trunk/test/SemaObjC/warn-implicit-atomic-property.m Wed Jun  8 11:40:09 2011
@@ -3,11 +3,11 @@
 
 @interface Super
 @property (nonatomic, readwrite) int P; // OK
- at property (atomic, readwrite) int P1; // OK
+ at property (readwrite) int P1; // expected-note {{property declared here}}
 @property (readwrite) int P2; // expected-note {{property declared here}}
 @property int P3; // expected-note {{property declared here}}
 @end
 
 @implementation Super // expected-warning {{property is assumed atomic when auto-synthesizing the property [-Wimplicit-atomic-properties]}}
- at synthesize P,P1,P2; // expected-warning {{property is assumed atomic by default [-Wimplicit-atomic-properties]}}
+ at synthesize P,P1,P2; // expected-warning 2 {{property is assumed atomic by default [-Wimplicit-atomic-properties]}}
 @end





More information about the cfe-commits mailing list