Author: kremenek
Date: Sat Nov 23 16:51:36 2013
New Revision: 195561
URL: http://llvm.org/viewvc/llvm-project?rev=195561&view=rev
Log:
Use specific_attr_iterator to tighten loop over ObjCSuppressProtocolAttrs.
Modified:
cfe/trunk/lib/AST/DeclObjC.cpp
Modified: cfe/trunk/lib/AST/DeclObjC.cpp
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclObjC.cpp?rev=195561&r1=195560&r2=195561&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclObjC.cpp (original)
+++ cfe/trunk/lib/AST/DeclObjC.cpp Sat Nov 23 16:51:36 2013
@@ -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<ObjCSuppressProtocolAttr>(*I)){
- if (A->getProtocol() == PI) {
+ for (specific_attr_iterator<ObjCSuppressProtocolAttr>
+ I = specific_attr_begin<ObjCSuppressProtocolAttr>(),
+ E = specific_attr_end<ObjCSuppressProtocolAttr>(); I != E; ++I)
+ if ((*I)->getProtocol() == PI)
return true;
- }
- }
- }
return false;
}
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits