From b7bc34a83aff8af09f2a78aa6d1dcafe18ad8619 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Fri, 8 Apr 2011 18:25:29 +0000 Subject: Warn for any kind of initialization if initializer does not implement lhs's protocols. // rdar://9091389. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129142 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/DeclObjC.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'include') diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h index 84e7a63b02..241d76c448 100644 --- a/include/clang/AST/DeclObjC.h +++ b/include/clang/AST/DeclObjC.h @@ -629,6 +629,27 @@ public: return false; } + /// getImmSubClassOf - Returns Immediate sub-class of the specified interface class + /// if 'Super' is a superclass of this class. null if no such super class. + /// So in this example if 'this' is 'BClass' and 'Super' is 'AClass' then 'BClass' + /// is returned. + /// \code + /// @interface BClass : AClass + /// @end + /// \endcode + + ObjCInterfaceDecl *getImmSubClassOf(const ObjCInterfaceDecl *Super) { + ObjCInterfaceDecl *ImmSubClass = this; + ObjCInterfaceDecl *I = this->getSuperClass(); + while (I != NULL) { + if (Super == I) + return ImmSubClass; + ImmSubClass = I; + I = I->getSuperClass(); + } + return NULL; + } + ObjCIvarDecl *lookupInstanceVariable(IdentifierInfo *IVarName, ObjCInterfaceDecl *&ClassDeclared); ObjCIvarDecl *lookupInstanceVariable(IdentifierInfo *IVarName) { -- cgit v1.2.3