diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-03-15 20:30:07 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-03-15 20:30:07 +0000 |
commit | d133a86aa3e9031804c1b3dc630b6c5b72f1008c (patch) | |
tree | a8f11a4aedeca3e2587eaa57aec98f98ab785186 /clang/lib/AST/DeclObjC.cpp | |
parent | ddcd1093a40da313525740ec02451027f13cab41 (diff) | |
download | bcm5719-llvm-d133a86aa3e9031804c1b3dc630b6c5b72f1008c.tar.gz bcm5719-llvm-d133a86aa3e9031804c1b3dc630b6c5b72f1008c.zip |
Move method FindPropertyVisibleInPrimaryClass() from ObjCContainerDecl to ObjCInterfaceDecl.
Also change this method to lookup property declarations using DeclContext::lookup().
llvm-svn: 98574
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r-- | clang/lib/AST/DeclObjC.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index 6a03360d161..7d1033d4f15 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -159,22 +159,21 @@ ObjCContainerDecl::FindPropertyDeclaration(IdentifierInfo *PropertyId) const { /// FindPropertyVisibleInPrimaryClass - Finds declaration of the property /// with name 'PropertyId' in the primary class; including those in protocols -/// (direct or indirect) used by the promary class. -/// FIXME: Convert to DeclContext lookup... +/// (direct or indirect) used by the primary class. /// ObjCPropertyDecl * -ObjCContainerDecl::FindPropertyVisibleInPrimaryClass( +ObjCInterfaceDecl::FindPropertyVisibleInPrimaryClass( IdentifierInfo *PropertyId) const { - assert(isa<ObjCInterfaceDecl>(this) && "FindPropertyVisibleInPrimaryClass"); - for (prop_iterator I = prop_begin(), E = prop_end(); I != E; ++I) - if ((*I)->getIdentifier() == PropertyId) - return *I; - const ObjCInterfaceDecl *OID = dyn_cast<ObjCInterfaceDecl>(this); + if (ObjCPropertyDecl *PD = + ObjCPropertyDecl::findPropertyDecl(cast<DeclContext>(this), PropertyId)) + return PD; + // Look through protocols. - for (ObjCInterfaceDecl::protocol_iterator I = OID->protocol_begin(), - E = OID->protocol_end(); I != E; ++I) + for (ObjCInterfaceDecl::protocol_iterator + I = protocol_begin(), E = protocol_end(); I != E; ++I) if (ObjCPropertyDecl *P = (*I)->FindPropertyDeclaration(PropertyId)) return P; + return 0; } |