diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2008-05-07 17:43:59 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2008-05-07 17:43:59 +0000 |
| commit | ec6e4c809680d37c75702563a26f9b866a4c16f4 (patch) | |
| tree | 6ec5838f53a0101443cfb8e8e26e59b7e062a5d6 /clang/lib/Sema | |
| parent | 89bd0fc27dd5cac99c71e186f51f4bcf9b1eab9b (diff) | |
| download | bcm5719-llvm-ec6e4c809680d37c75702563a26f9b866a4c16f4.tar.gz bcm5719-llvm-ec6e4c809680d37c75702563a26f9b866a4c16f4.zip | |
This patch introduces declaration of getter methods for ObjC2's
properties. Couple of property tests will fail with this patch.
Will fix them next.
llvm-svn: 50818
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index f9e4f5b14db..96710cc20c1 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -872,12 +872,17 @@ void Sema::ActOnAtEnd(SourceLocation AtEndLoc, DeclTy *classDecl, } if (ObjCInterfaceDecl *I = dyn_cast<ObjCInterfaceDecl>(ClassDecl)) { - I->addMethods(&insMethods[0], insMethods.size(), - &clsMethods[0], clsMethods.size(), AtEndLoc); // Compares properties declaraed in this class to those of its // super class. ComparePropertiesInBaseAndSuper(I); MergeProtocolPropertiesIntoClass(I, I); + for (ObjCInterfaceDecl::classprop_iterator P = I->classprop_begin(), + E = I->classprop_end(); P != E; ++P) { + I->addPropertyMethods(Context, *P, insMethods); + } + I->addMethods(&insMethods[0], insMethods.size(), + &clsMethods[0], clsMethods.size(), AtEndLoc); + } else if (ObjCProtocolDecl *P = dyn_cast<ObjCProtocolDecl>(ClassDecl)) { P->addMethods(&insMethods[0], insMethods.size(), &clsMethods[0], clsMethods.size(), AtEndLoc); @@ -1029,19 +1034,19 @@ Sema::DeclTy *Sema::ActOnProperty(Scope *S, SourceLocation AtLoc, QualType T = GetTypeForDeclarator(FD.D, S); ObjCPropertyDecl *PDecl = ObjCPropertyDecl::Create(Context, AtLoc, FD.D.getIdentifier(), T); + // Regardless of setter/getter attribute, we save the default getter/setter + // selector names in anticipation of declaration of setter/getter methods. + PDecl->setGetterName(GetterSel); + PDecl->setSetterName(SetterSel); if (ODS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_readonly) PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readonly); - if (ODS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_getter) { + if (ODS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_getter) PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_getter); - PDecl->setGetterName(GetterSel); - } - if (ODS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_setter) { + if (ODS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_setter) PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_setter); - PDecl->setSetterName(SetterSel); - } if (ODS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_assign) PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_assign); |

