diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-01-03 19:46:00 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-01-03 19:46:00 +0000 |
commit | eb4f2c56c298071d58b441ccf801b039be93788a (patch) | |
tree | e63957f215b5e1c4b3b0953a3af29e0cd75f1dd7 /lib/Sema | |
parent | c13a34b690d2dc2a03c2fea75a0a1438636c19ce (diff) |
objc: use objc_suppress_autosynthesis attribute on classes
which should not be default synthesized.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147468 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 7 | ||||
-rw-r--r-- | lib/Sema/SemaObjCProperty.cpp | 6 |
2 files changed, 8 insertions, 5 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index bc35055722..ad230b4713 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -1665,9 +1665,10 @@ void Sema::ImplMethodsVsClassMethods(Scope *S, ObjCImplDecl* IMPDecl, // Check and see if properties declared in the interface have either 1) // an implementation or 2) there is a @synthesize/@dynamic implementation // of the property in the @implementation. - if (isa<ObjCInterfaceDecl>(CDecl) && - !(LangOpts.ObjCDefaultSynthProperties && LangOpts.ObjCNonFragileABI2)) - DiagnoseUnimplementedProperties(S, IMPDecl, CDecl, InsMap); + if (const ObjCInterfaceDecl *IDecl = dyn_cast<ObjCInterfaceDecl>(CDecl)) + if (!(LangOpts.ObjCDefaultSynthProperties && LangOpts.ObjCNonFragileABI2) || + IDecl->isObjCSuppressAutosynthesis()) + DiagnoseUnimplementedProperties(S, IMPDecl, CDecl, InsMap); llvm::DenseSet<Selector> ClsMap; for (ObjCImplementationDecl::classmeth_iterator diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp index c60d1b8f5e..a15fc7dd8d 100644 --- a/lib/Sema/SemaObjCProperty.cpp +++ b/lib/Sema/SemaObjCProperty.cpp @@ -856,7 +856,8 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, } IC->addPropertyImplementation(PIDecl); if (getLangOptions().ObjCDefaultSynthProperties && - getLangOptions().ObjCNonFragileABI2) { + getLangOptions().ObjCNonFragileABI2 && + !IDecl->isObjCSuppressAutosynthesis()) { // Diagnose if an ivar was lazily synthesdized due to a previous // use and if 1) property is @dynamic or 2) property is synthesized // but it requires an ivar of different name. @@ -1355,7 +1356,8 @@ void Sema::DefaultSynthesizeProperties(Scope *S, Decl *D) { if (!IC) return; if (ObjCInterfaceDecl* IDecl = IC->getClassInterface()) - DefaultSynthesizeProperties(S, IC, IDecl); + if (!IDecl->isObjCSuppressAutosynthesis()) + DefaultSynthesizeProperties(S, IC, IDecl); } void Sema::DiagnoseUnimplementedProperties(Scope *S, ObjCImplDecl* IMPDecl, |