summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-12-10 23:36:33 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-12-10 23:36:33 +0000
commitc21f543bc4bab06d0d471ba7ba1ac53ed6609c14 (patch)
tree12f366bac6de7456c83b51316352b2f49be46023 /clang/lib/Sema/SemaDeclObjC.cpp
parentbb8610635f384f51969376238c53595761d814bf (diff)
downloadbcm5719-llvm-c21f543bc4bab06d0d471ba7ba1ac53ed6609c14.tar.gz
bcm5719-llvm-c21f543bc4bab06d0d471ba7ba1ac53ed6609c14.zip
Any property declared in a class extension might have user
declared setter or getter in current class extension or one of the other class extensions. Mark them as synthesized as property will be synthesized when property with same name is seen in the @implementation. This prevents bogus warning about unimplemented methods to be issued for these methods. Fixes // rdar://8747333 llvm-svn: 121597
Diffstat (limited to 'clang/lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index 57c19222924..a7014f6755b 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/lib/Sema/SemaDeclObjC.cpp
@@ -1522,8 +1522,29 @@ void Sema::ActOnAtEnd(Scope *S, SourceRange AtEnd,
// Compare protocol properties with those in category
CompareProperties(C, C);
- if (C->IsClassExtension())
- DiagnoseClassExtensionDupMethods(C, C->getClassInterface());
+ if (C->IsClassExtension()) {
+ ObjCInterfaceDecl *CCPrimary = C->getClassInterface();
+ DiagnoseClassExtensionDupMethods(C, CCPrimary);
+ for (ObjCContainerDecl::prop_iterator I = C->prop_begin(),
+ E = C->prop_end(); I != E; ++I) {
+ // Any property declared in a class extension might have user
+ // declared setter or getter in current class extension or one
+ // of the other class extensions. Mark them as synthesized as
+ // property will be synthesized when property with same name is
+ // seen in the @implementation.
+ for (const ObjCCategoryDecl *ClsExtDecl =
+ CCPrimary->getFirstClassExtension();
+ ClsExtDecl; ClsExtDecl = ClsExtDecl->getNextClassExtension()) {
+ if (ObjCMethodDecl *GetterMethod =
+ ClsExtDecl->getInstanceMethod((*I)->getGetterName()))
+ GetterMethod->setSynthesized(true);
+ if (!(*I)->isReadOnly())
+ if (ObjCMethodDecl *SetterMethod =
+ ClsExtDecl->getInstanceMethod((*I)->getSetterName()))
+ SetterMethod->setSynthesized(true);
+ }
+ }
+ }
}
if (ObjCContainerDecl *CDecl = dyn_cast<ObjCContainerDecl>(ClassDecl)) {
if (CDecl->getIdentifier())
OpenPOWER on IntegriCloud