summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-04-08 18:25:29 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-04-08 18:25:29 +0000
commitb7bc34a83aff8af09f2a78aa6d1dcafe18ad8619 (patch)
tree8de806a3d2fc84723c0f79e7f669b5ddb3004c2a /include
parentf44a1a04a36453527de2285c402fbe9453184121 (diff)
downloadclang-b7bc34a83aff8af09f2a78aa6d1dcafe18ad8619.tar.gz
clang-b7bc34a83aff8af09f2a78aa6d1dcafe18ad8619.tar.bz2
clang-b7bc34a83aff8af09f2a78aa6d1dcafe18ad8619.tar.xz
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
Diffstat (limited to 'include')
-rw-r--r--include/clang/AST/DeclObjC.h21
1 files changed, 21 insertions, 0 deletions
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 <SubFooable>
+ /// @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) {