summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2008-05-05 18:51:55 +0000
committerFariborz Jahanian <fjahanian@apple.com>2008-05-05 18:51:55 +0000
commit8d91686b0d5eeaae501e69d3d95052cbb12aad66 (patch)
tree4b86cac6cc8547872e4d68b4f8c6df22373421c1 /clang/lib/Sema
parent627c3074dd565be6c209dc5ad89a5366ffdee049 (diff)
downloadbcm5719-llvm-8d91686b0d5eeaae501e69d3d95052cbb12aad66.tar.gz
bcm5719-llvm-8d91686b0d5eeaae501e69d3d95052cbb12aad66.zip
percolate @optional/@required protocols down to ASTs for
properties declared in the protocol. llvm-svn: 50662
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/Sema.h4
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp8
2 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h
index 68a834c6b4c..6375fad0869 100644
--- a/clang/lib/Sema/Sema.h
+++ b/clang/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/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index afac82ca76f..3b488108961 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud