summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-02-09 21:30:24 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-02-09 21:30:24 +0000
commit29082a5f1d02157098f0b321c4ca57f274e63c17 (patch)
tree76b553e0a46ef3203c0156cb09e9dad1e0ad9e3c /clang/lib/AST/DeclObjC.cpp
parentf4a75d880d4b3be92fd17694726fd6b1c93d9bf3 (diff)
downloadbcm5719-llvm-29082a5f1d02157098f0b321c4ca57f274e63c17.tar.gz
bcm5719-llvm-29082a5f1d02157098f0b321c4ca57f274e63c17.zip
objc: If a method is not implemented in the category implementation but
has been declared in its primary class, superclass, or in one of their protocols, no need to issue unimplemented method. // rdar://10823023 llvm-svn: 150206
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r--clang/lib/AST/DeclObjC.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index d0083855bb4..6617dc7ac8e 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/lib/AST/DeclObjC.cpp
@@ -317,7 +317,8 @@ ObjCInterfaceDecl *ObjCInterfaceDecl::lookupInheritedClass(
/// lookupMethod - This method returns an instance/class method by looking in
/// the class, its categories, and its super classes (using a linear search).
ObjCMethodDecl *ObjCInterfaceDecl::lookupMethod(Selector Sel,
- bool isInstance) const {
+ bool isInstance,
+ bool noCategoryLookup) const {
// FIXME: Should make sure no callers ever do this.
if (!hasDefinition())
return 0;
@@ -339,21 +340,22 @@ ObjCMethodDecl *ObjCInterfaceDecl::lookupMethod(Selector Sel,
E = Protocols.end(); I != E; ++I)
if ((MethodDecl = (*I)->lookupMethod(Sel, isInstance)))
return MethodDecl;
-
- // Didn't find one yet - now look through categories.
- ObjCCategoryDecl *CatDecl = ClassDecl->getCategoryList();
- while (CatDecl) {
- if ((MethodDecl = CatDecl->getMethod(Sel, isInstance)))
- return MethodDecl;
-
- // Didn't find one yet - look through protocols.
- const ObjCList<ObjCProtocolDecl> &Protocols =
- CatDecl->getReferencedProtocols();
- for (ObjCList<ObjCProtocolDecl>::iterator I = Protocols.begin(),
- E = Protocols.end(); I != E; ++I)
- if ((MethodDecl = (*I)->lookupMethod(Sel, isInstance)))
+ if (!noCategoryLookup) {
+ // Didn't find one yet - now look through categories.
+ ObjCCategoryDecl *CatDecl = ClassDecl->getCategoryList();
+ while (CatDecl) {
+ if ((MethodDecl = CatDecl->getMethod(Sel, isInstance)))
return MethodDecl;
- CatDecl = CatDecl->getNextClassCategory();
+
+ // Didn't find one yet - look through protocols.
+ const ObjCList<ObjCProtocolDecl> &Protocols =
+ CatDecl->getReferencedProtocols();
+ for (ObjCList<ObjCProtocolDecl>::iterator I = Protocols.begin(),
+ E = Protocols.end(); I != E; ++I)
+ if ((MethodDecl = (*I)->lookupMethod(Sel, isInstance)))
+ return MethodDecl;
+ CatDecl = CatDecl->getNextClassCategory();
+ }
}
ClassDecl = ClassDecl->getSuperClass();
}
OpenPOWER on IntegriCloud