summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-01-19 18:16:19 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-01-19 18:16:19 +0000
commitdab04840f0f8bfbf6eaa073962080bb7f6998772 (patch)
tree0f73f85384d19e98ac1aff03d97f224a0706541d /clang/lib/AST/DeclObjC.cpp
parentee22611e33b4e5e031fbbe897fdc9598d6658f02 (diff)
downloadbcm5719-llvm-dab04840f0f8bfbf6eaa073962080bb7f6998772.tar.gz
bcm5719-llvm-dab04840f0f8bfbf6eaa073962080bb7f6998772.zip
Patch to allow @dynamic synthesis of property in a category,
with @synthesize being illegal. llvm-svn: 62515
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r--clang/lib/AST/DeclObjC.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index ea7a047780c..90962e69bd1 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/lib/AST/DeclObjC.cpp
@@ -364,8 +364,7 @@ ObjCContainerDecl::FindPropertyDeclaration(IdentifierInfo *PropertyId) const {
return property;
}
- const ObjCInterfaceDecl *OID = dyn_cast<ObjCInterfaceDecl>(this);
- if (OID) {
+ if (const ObjCInterfaceDecl *OID = dyn_cast<ObjCInterfaceDecl>(this)) {
// Look through categories.
for (ObjCCategoryDecl *Category = OID->getCategoryList();
Category; Category = Category->getNextClassCategory()) {
@@ -384,6 +383,16 @@ ObjCContainerDecl::FindPropertyDeclaration(IdentifierInfo *PropertyId) const {
if (OID->getSuperClass())
return OID->getSuperClass()->FindPropertyDeclaration(PropertyId);
}
+ else if (const ObjCCategoryDecl *OCD = dyn_cast<ObjCCategoryDecl>(this)) {
+ // Look through protocols.
+ for (ObjCInterfaceDecl::protocol_iterator I = OCD->protocol_begin(),
+ E = OCD->protocol_end(); I != E; ++I) {
+ ObjCProtocolDecl *Protocol = *I;
+ ObjCPropertyDecl *property = Protocol->FindPropertyDeclaration(PropertyId);
+ if (property)
+ return property;
+ }
+ }
return 0;
}
OpenPOWER on IntegriCloud