: superCls;
}
+ /// \brief Returns true if this class is marked to suppress being
+ /// used to determine if a subclass conforms to a protocol.
+ bool shouldSuppressProtocol(const ObjCProtocolDecl *P) const;
+
/// \brief Iterator that walks over the list of categories, filtering out
/// those that do not meet specific criteria.
///
void ObjCInterfaceDecl::anchor() { }
+bool ObjCInterfaceDecl::shouldSuppressProtocol(const ObjCProtocolDecl *P) const{
+ if (!hasAttrs())
+ return false;
+ const AttrVec &V = getAttrs();
+ const IdentifierInfo *PI = P->getIdentifier();
+ for (AttrVec::const_iterator I = V.begin(), E = V.end(); I != E; ++I) {
+ if (const ObjCSuppressProtocolAttr *A =
+ dyn_cast<ObjCSuppressProtocolAttr>(*I)){
+ if (A->getProtocol() == PI) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
/// FindPropertyVisibleInPrimaryClass - Finds declaration of the property
/// with name 'PropertyId' in the primary class; including those in protocols
/// (direct or indirect) used by the primary class.
// If we are looking for a method that is part of protocol conformance,
// check if the superclass has been marked to suppress conformance
// of that protocol.
- if (P && ClassDecl->hasAttrs()) {
- const AttrVec &V = ClassDecl->getAttrs();
- const IdentifierInfo *PI = P->getIdentifier();
- for (AttrVec::const_iterator I = V.begin(), E = V.end(); I != E; ++I) {
- if (const ObjCSuppressProtocolAttr *A =
- dyn_cast<ObjCSuppressProtocolAttr>(*I)){
- if (A->getProtocol() == PI) {
- return 0;
- }
- }
- }
- }
+ if (P && ClassDecl->shouldSuppressProtocol(P))
+ return 0;
if ((MethodDecl = ClassDecl->getMethod(Sel, isInstance)))
return MethodDecl;