From: Argyrios Kyrtzidis Date: Tue, 28 Jul 2009 05:10:52 +0000 (+0000) Subject: Use ObjCImplDecl in place of ObjCCategoryImplDecl/ObjCImplementationDecl. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a8530375168f578e9039837c58054d55655c981b;p=clang Use ObjCImplDecl in place of ObjCCategoryImplDecl/ObjCImplementationDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77296 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index e082a41551..503bc7052d 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -286,12 +286,10 @@ ObjCInterfaceDecl *ObjCMethodDecl::getClassInterface() { return ID; if (ObjCCategoryDecl *CD = dyn_cast(getDeclContext())) return CD->getClassInterface(); - if (ObjCImplementationDecl *IMD = - dyn_cast(getDeclContext())) + if (ObjCImplDecl *IMD = dyn_cast(getDeclContext())) return IMD->getClassInterface(); - if (ObjCCategoryImplDecl *CID = - dyn_cast(getDeclContext())) - return CID->getClassInterface(); + + assert(!isa(getDeclContext()) && "It's a protocol method"); assert(false && "unknown method context"); return 0; }