]> granicus.if.org Git - clang/commitdiff
Make sure when setting AttributesAsWritten of a property that they do not
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sun, 6 Nov 2011 18:58:12 +0000 (18:58 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sun, 6 Nov 2011 18:58:12 +0000 (18:58 +0000)
include ownership qualifiers from the type.

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

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

index b5ef30a6f48a18c20a19431a594e8be8e65be7ea..9113f7ab2e3520df6dbfc6f319e62c7e49a98932 100644 (file)
@@ -1934,6 +1934,7 @@ public:
                                        const bool isAssign,
                                        const bool isReadWrite,
                                        const unsigned Attributes,
+                                       const unsigned AttributesAsWritten,
                                        bool *isOverridingProperty,
                                        TypeSourceInfo *T,
                                        tok::ObjCKeywordKind MethodImplKind);
@@ -1949,6 +1950,7 @@ public:
                                        const bool isAssign,
                                        const bool isReadWrite,
                                        const unsigned Attributes,
+                                       const unsigned AttributesAsWritten,
                                        TypeSourceInfo *T,
                                        tok::ObjCKeywordKind MethodImplKind,
                                        DeclContext *lexicalDC = 0);
index ae054bc629d2c7eea168f4688c36a9ae07ca4f78..46b2a086dd57af24a726cf4f58d38aca2a949985 100644 (file)
@@ -137,6 +137,7 @@ Decl *Sema::ActOnProperty(Scope *S, SourceLocation AtLoc,
                                            FD, GetterSel, SetterSel,
                                            isAssign, isReadWrite,
                                            Attributes,
+                                           ODS.getPropertyAttributes(),
                                            isOverridingProperty, TSI,
                                            MethodImplKind);
       if (Res) {
@@ -150,7 +151,9 @@ Decl *Sema::ActOnProperty(Scope *S, SourceLocation AtLoc,
   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 @@ Sema::HandlePropertyInClassExtension(Scope *S,
                                      const bool isAssign,
                                      const bool isReadWrite,
                                      const unsigned Attributes,
+                                     const unsigned AttributesAsWritten,
                                      bool *isOverridingProperty,
                                      TypeSourceInfo *T,
                                      tok::ObjCKeywordKind MethodImplKind) {
@@ -231,7 +235,7 @@ Sema::HandlePropertyInClassExtension(Scope *S,
     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 @@ Sema::HandlePropertyInClassExtension(Scope *S,
     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 @@ ObjCPropertyDecl *Sema::CreatePropertyDecl(Scope *S,
                                            const bool isAssign,
                                            const bool isReadWrite,
                                            const unsigned Attributes,
+                                           const unsigned AttributesAsWritten,
                                            TypeSourceInfo *TInfo,
                                            tok::ObjCKeywordKind MethodImplKind,
                                            DeclContext *lexicalDC){
@@ -402,7 +407,7 @@ ObjCPropertyDecl *Sema::CreatePropertyDecl(Scope *S,
   PDecl->setGetterName(GetterSel);
   PDecl->setSetterName(SetterSel);
   PDecl->setPropertyAttributesAsWritten(
-                                   makePropertyAttributesAsWritten(Attributes));
+                          makePropertyAttributesAsWritten(AttributesAsWritten));
 
   if (Attributes & ObjCDeclSpec::DQ_PR_readonly)
     PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readonly);