This simplifies my last patch a bit. No change in
functionality.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202906
91177308-0d34-0410-b5e6-
96231b3b80d8
return CD->getClassInterface();
if (ObjCImplDecl *IMD = dyn_cast<ObjCImplDecl>(getDeclContext()))
return IMD->getClassInterface();
-
- assert(!isa<ObjCProtocolDecl>(getDeclContext()) && "It's a protocol method");
+ if (isa<ObjCProtocolDecl>(getDeclContext()))
+ return 0;
llvm_unreachable("unknown method context");
}
// interface, we cannot perform this check.
if (const ObjCMethodDecl *MD =
dyn_cast_or_null<ObjCMethodDecl>(CGF.CurFuncDecl))
- if (MD->isInstanceMethod() &&
- !isa<ObjCProtocolDecl>(MD->getDeclContext()))
+ if (MD->isInstanceMethod())
if (const ObjCInterfaceDecl *ID = MD->getClassInterface())
return IV->getContainingInterface()->isSuperClassOf(ID);
return false;