diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2008-05-05 18:51:55 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2008-05-05 18:51:55 +0000 |
commit | 46b55e56d029aec699fc2701e43d70264da9ecd8 (patch) | |
tree | 261a5b8ad604a12c4e8c5fdabd4b0df71a0e3c02 /lib | |
parent | e28565b994431adba60a86b32ae8663c386879e2 (diff) |
percolate @optional/@required protocols down to ASTs for
properties declared in the protocol.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50662 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/DeclObjC.cpp | 3 | ||||
-rw-r--r-- | lib/Parse/ParseObjc.cpp | 3 | ||||
-rw-r--r-- | lib/Sema/Sema.h | 4 | ||||
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 8 |
4 files changed, 14 insertions, 4 deletions
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index 89f6d2c501..0cb777d8de 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -112,7 +112,8 @@ ObjCCompatibleAliasDecl::Create(ASTContext &C, ObjCPropertyDecl *ObjCPropertyDecl::Create(ASTContext &C, SourceLocation L, IdentifierInfo *Id, - QualType T) { + QualType T, + PropertyControl propControl) { void *Mem = C.getAllocator().Allocate<ObjCPropertyDecl>(); return new (Mem) ObjCPropertyDecl(L, Id, T); } diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp index d1b1c25c5a..8d404a9aaf 100644 --- a/lib/Parse/ParseObjc.cpp +++ b/lib/Parse/ParseObjc.cpp @@ -271,7 +271,8 @@ void Parser::ParseObjCInterfaceDeclList(DeclTy *interfaceDecl, FieldDeclarator &FD = FieldDeclarators[i]; // Install the property declarator into interfaceDecl. DeclTy *Property = Actions.ActOnProperty(CurScope, - DS.getSourceRange().getBegin(), FD, OCDS); + DS.getSourceRange().getBegin(), FD, OCDS, + MethodImplKind); allProperties.push_back(Property); } continue; diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h index 68a834c6b4..6375fad086 100644 --- a/lib/Sema/Sema.h +++ b/lib/Sema/Sema.h @@ -676,7 +676,9 @@ public: DeclTy **allProperties = 0, unsigned pNum = 0); virtual DeclTy *ActOnProperty(Scope *S, SourceLocation AtLoc, - FieldDeclarator &FD, ObjCDeclSpec &ODS); + FieldDeclarator &FD, ObjCDeclSpec &ODS, + tok::ObjCKeywordKind MethodImplKind); + virtual DeclTy *ActOnPropertyImplDecl(SourceLocation AtLoc, SourceLocation PropertyLoc, bool ImplKind, DeclTy *ClassImplDecl, diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index afac82ca76..3b48810896 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -1022,7 +1022,8 @@ Sema::DeclTy *Sema::ActOnMethodDeclaration( Sema::DeclTy *Sema::ActOnProperty(Scope *S, SourceLocation AtLoc, FieldDeclarator &FD, - ObjCDeclSpec &ODS) { + ObjCDeclSpec &ODS, + tok::ObjCKeywordKind MethodImplKind) { QualType T = GetTypeForDeclarator(FD.D, S); ObjCPropertyDecl *PDecl = ObjCPropertyDecl::Create(Context, AtLoc, FD.D.getIdentifier(), T); @@ -1055,6 +1056,11 @@ Sema::DeclTy *Sema::ActOnProperty(Scope *S, SourceLocation AtLoc, if (ODS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_nonatomic) PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_nonatomic); + if (MethodImplKind == tok::objc_required) + PDecl->setPropertyImplementation(ObjCPropertyDecl::Required); + else if (MethodImplKind == tok::objc_optional) + PDecl->setPropertyImplementation(ObjCPropertyDecl::Optional); + return PDecl; } |