diff options
| author | Ted Kremenek <kremenek@apple.com> | 2014-02-21 19:41:34 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2014-02-21 19:41:34 +0000 |
| commit | 348e88c36ae2408075a6f4861d82463c86904ab8 (patch) | |
| tree | 24962524b0588f9de49499b7058145040a289c57 /clang/lib/Sema/SemaObjCProperty.cpp | |
| parent | 7e812951533629797fc40517c2b9cc7165ce2186 (diff) | |
| download | bcm5719-llvm-348e88c36ae2408075a6f4861d82463c86904ab8.tar.gz bcm5719-llvm-348e88c36ae2408075a6f4861d82463c86904ab8.zip | |
[ObjC] Change default property synthesis logic to not completely skip DiagnoseUnimplementedProperties.
We're going to extend DiagnoseUnimplementedProperties shortly to look for more cases
that aren't handled by default property synthesis.
llvm-svn: 201878
Diffstat (limited to 'clang/lib/Sema/SemaObjCProperty.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaObjCProperty.cpp | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index 730907e5b90..67be198f8de 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/lib/Sema/SemaObjCProperty.cpp @@ -1650,26 +1650,30 @@ static void DiagnoseUnimplementedAccessor(Sema &S, } void Sema::DiagnoseUnimplementedProperties(Scope *S, ObjCImplDecl* IMPDecl, - ObjCContainerDecl *CDecl) { - ObjCContainerDecl::PropertyMap NoNeedToImplPropMap; - ObjCInterfaceDecl *IDecl; - // Gather properties which need not be implemented in this class - // or category. - if (!(IDecl = dyn_cast<ObjCInterfaceDecl>(CDecl))) - if (ObjCCategoryDecl *C = dyn_cast<ObjCCategoryDecl>(CDecl)) { - // For categories, no need to implement properties declared in - // its primary class (and its super classes) if property is - // declared in one of those containers. - if ((IDecl = C->getClassInterface())) { - ObjCInterfaceDecl::PropertyDeclOrder PO; - IDecl->collectPropertiesToImplement(NoNeedToImplPropMap, PO); - } - } - if (IDecl) - CollectSuperClassPropertyImplementations(IDecl, NoNeedToImplPropMap); - + ObjCContainerDecl *CDecl, + bool SynthesizeProperties) { ObjCContainerDecl::PropertyMap PropMap; - CollectImmediateProperties(CDecl, PropMap, NoNeedToImplPropMap); + if (!SynthesizeProperties) { + ObjCContainerDecl::PropertyMap NoNeedToImplPropMap; + ObjCInterfaceDecl *IDecl; + // Gather properties which need not be implemented in this class + // or category. + if (!(IDecl = dyn_cast<ObjCInterfaceDecl>(CDecl))) + if (ObjCCategoryDecl *C = dyn_cast<ObjCCategoryDecl>(CDecl)) { + // For categories, no need to implement properties declared in + // its primary class (and its super classes) if property is + // declared in one of those containers. + if ((IDecl = C->getClassInterface())) { + ObjCInterfaceDecl::PropertyDeclOrder PO; + IDecl->collectPropertiesToImplement(NoNeedToImplPropMap, PO); + } + } + if (IDecl) + CollectSuperClassPropertyImplementations(IDecl, NoNeedToImplPropMap); + + CollectImmediateProperties(CDecl, PropMap, NoNeedToImplPropMap); + } + if (PropMap.empty()) return; |

