[cfe-commits] r143885 - in /cfe/trunk: include/clang/Sema/Sema.h lib/Sema/SemaObjCProperty.cpp

Argyrios Kyrtzidis akyrtzi at gmail.com
Sun Nov 6 10:58:12 PST 2011


Author: akirtzidis
Date: Sun Nov  6 12:58:12 2011
New Revision: 143885

URL: http://llvm.org/viewvc/llvm-project?rev=143885&view=rev
Log:
Make sure when setting AttributesAsWritten of a property that they do not
include ownership qualifiers from the type.

Modified:
    cfe/trunk/include/clang/Sema/Sema.h
    cfe/trunk/lib/Sema/SemaObjCProperty.cpp

Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=143885&r1=143884&r2=143885&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Sun Nov  6 12:58:12 2011
@@ -1934,6 +1934,7 @@
                                        const bool isAssign,
                                        const bool isReadWrite,
                                        const unsigned Attributes,
+                                       const unsigned AttributesAsWritten,
                                        bool *isOverridingProperty,
                                        TypeSourceInfo *T,
                                        tok::ObjCKeywordKind MethodImplKind);
@@ -1949,6 +1950,7 @@
                                        const bool isAssign,
                                        const bool isReadWrite,
                                        const unsigned Attributes,
+                                       const unsigned AttributesAsWritten,
                                        TypeSourceInfo *T,
                                        tok::ObjCKeywordKind MethodImplKind,
                                        DeclContext *lexicalDC = 0);

Modified: cfe/trunk/lib/Sema/SemaObjCProperty.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=143885&r1=143884&r2=143885&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaObjCProperty.cpp (original)
+++ cfe/trunk/lib/Sema/SemaObjCProperty.cpp Sun Nov  6 12:58:12 2011
@@ -137,6 +137,7 @@
                                            FD, GetterSel, SetterSel,
                                            isAssign, isReadWrite,
                                            Attributes,
+                                           ODS.getPropertyAttributes(),
                                            isOverridingProperty, TSI,
                                            MethodImplKind);
       if (Res) {
@@ -150,7 +151,9 @@
   ObjCPropertyDecl *Res = CreatePropertyDecl(S, ClassDecl, AtLoc, FD,
                                              GetterSel, SetterSel,
                                              isAssign, isReadWrite,
-                                             Attributes, TSI, MethodImplKind);
+                                             Attributes,
+                                             ODS.getPropertyAttributes(),
+                                             TSI, MethodImplKind);
   if (lexicalDC)
     Res->setLexicalDeclContext(lexicalDC);
 
@@ -201,6 +204,7 @@
                                      const bool isAssign,
                                      const bool isReadWrite,
                                      const unsigned Attributes,
+                                     const unsigned AttributesAsWritten,
                                      bool *isOverridingProperty,
                                      TypeSourceInfo *T,
                                      tok::ObjCKeywordKind MethodImplKind) {
@@ -231,7 +235,7 @@
     ObjCPropertyDecl::Create(Context, DC, FD.D.getIdentifierLoc(),
                              PropertyId, AtLoc, T);
   PDecl->setPropertyAttributesAsWritten(
-                                   makePropertyAttributesAsWritten(Attributes));
+                          makePropertyAttributesAsWritten(AttributesAsWritten));
   if (Attributes & ObjCDeclSpec::DQ_PR_readonly)
     PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readonly);
   if (Attributes & ObjCDeclSpec::DQ_PR_readwrite)
@@ -260,7 +264,7 @@
     ObjCPropertyDecl *PDecl =
       CreatePropertyDecl(S, CCPrimary, AtLoc,
                          FD, GetterSel, SetterSel, isAssign, isReadWrite,
-                         Attributes, T, MethodImplKind, DC);
+                         Attributes,AttributesAsWritten, T, MethodImplKind, DC);
 
     // A case of continuation class adding a new property in the class. This
     // is not what it was meant for. However, gcc supports it and so should we.
@@ -351,6 +355,7 @@
                                            const bool isAssign,
                                            const bool isReadWrite,
                                            const unsigned Attributes,
+                                           const unsigned AttributesAsWritten,
                                            TypeSourceInfo *TInfo,
                                            tok::ObjCKeywordKind MethodImplKind,
                                            DeclContext *lexicalDC){
@@ -402,7 +407,7 @@
   PDecl->setGetterName(GetterSel);
   PDecl->setSetterName(SetterSel);
   PDecl->setPropertyAttributesAsWritten(
-                                   makePropertyAttributesAsWritten(Attributes));
+                          makePropertyAttributesAsWritten(AttributesAsWritten));
 
   if (Attributes & ObjCDeclSpec::DQ_PR_readonly)
     PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readonly);





More information about the cfe-commits mailing list