diff options
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r-- | clang/lib/AST/DeclObjC.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index 28a651429c9..ca87bb8197f 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -457,9 +457,11 @@ ObjCInterfaceDecl::lookupNestedProtocol(IdentifierInfo *Name) { /// When argument category "C" is specified, any implicit method found /// in this category is ignored. ObjCMethodDecl *ObjCInterfaceDecl::lookupMethod(Selector Sel, - bool isInstance, - bool shallowCategoryLookup, - const ObjCCategoryDecl *C) const { + bool isInstance, + bool shallowCategoryLookup, + bool followSuper, + const ObjCCategoryDecl *C) const +{ // FIXME: Should make sure no callers ever do this. if (!hasDefinition()) return 0; @@ -470,7 +472,7 @@ ObjCMethodDecl *ObjCInterfaceDecl::lookupMethod(Selector Sel, if (data().ExternallyCompleted) LoadExternalDefinition(); - while (ClassDecl != NULL) { + while (ClassDecl) { if ((MethodDecl = ClassDecl->getMethod(Sel, isInstance))) return MethodDecl; @@ -501,7 +503,11 @@ ObjCMethodDecl *ObjCInterfaceDecl::lookupMethod(Selector Sel, return MethodDecl; } } - + + if (!followSuper) + return NULL; + + // Get the super class (if any). ClassDecl = ClassDecl->getSuperClass(); } return NULL; |