From: Ted Kremenek Date: Sat, 23 Nov 2013 22:51:36 +0000 (+0000) Subject: Use specific_attr_iterator to tighten loop over ObjCSuppressProtocolAttrs. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a232c2c7f22cda654c16b6d69681a14963f6189;p=clang Use specific_attr_iterator to tighten loop over ObjCSuppressProtocolAttrs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195561 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index 69de6a3c85..cc3459476a 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -259,16 +259,12 @@ 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(*I)){ - if (A->getProtocol() == PI) { + for (specific_attr_iterator + I = specific_attr_begin(), + E = specific_attr_end(); I != E; ++I) + if ((*I)->getProtocol() == PI) return true; - } - } - } return false; }