diff options
author | Ted Kremenek <kremenek@apple.com> | 2013-11-23 22:51:36 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2013-11-23 22:51:36 +0000 |
commit | 5ec76a0084d42081c5a2b6473335d241585d9cb5 (patch) | |
tree | 4e0a825a5bdb2c93d08e85cc6b72a724f38a64db /clang/lib/AST/DeclObjC.cpp | |
parent | 7559b47fa2da9bac0baa4fa6662d93868abc92d9 (diff) | |
download | bcm5719-llvm-5ec76a0084d42081c5a2b6473335d241585d9cb5.tar.gz bcm5719-llvm-5ec76a0084d42081c5a2b6473335d241585d9cb5.zip |
Use specific_attr_iterator to tighten loop over ObjCSuppressProtocolAttrs.
llvm-svn: 195561
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r-- | clang/lib/AST/DeclObjC.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index 69de6a3c859..cc3459476ad 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/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<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; } |