diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-03-13 20:55:22 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-03-13 20:55:22 +0000 |
commit | a9f49e394c8e25c1f6e0693e52a770125f01d7e1 (patch) | |
tree | b0f7235edce127c97920a3c67e678a67cae36834 /clang/lib/Sema/SemaDeclObjC.cpp | |
parent | e937888e1c4eeafba7eab0359e00f5d28da93ecd (diff) | |
download | bcm5719-llvm-a9f49e394c8e25c1f6e0693e52a770125f01d7e1.tar.gz bcm5719-llvm-a9f49e394c8e25c1f6e0693e52a770125f01d7e1.zip |
[C++11] Replacing ObjCInterfaceDecl iterators all_referenced_protocol_begin() and all_referenced_protocol_end() with iterator_range all_referenced_protocols(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203848
Diffstat (limited to 'clang/lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index 1b8a466644f..eabd98d7b7b 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -1666,11 +1666,8 @@ static void findProtocolsWithExplicitImpls(const ObjCInterfaceDecl *Super, if (!Super) return; - for (ObjCInterfaceDecl::all_protocol_iterator - I = Super->all_referenced_protocol_begin(), - E = Super->all_referenced_protocol_end(); I != E; ++I) { - findProtocolsWithExplicitImpls(*I, PNS); - } + for (const auto *I : Super->all_referenced_protocols()) + findProtocolsWithExplicitImpls(I, PNS); findProtocolsWithExplicitImpls(Super->getSuperClass(), PNS); } @@ -1907,14 +1904,11 @@ void Sema::MatchAllMethodDeclarations(const SelectorSet &InsMap, } // Check for any implementation of a methods declared in protocol. - for (ObjCInterfaceDecl::all_protocol_iterator - PI = I->all_referenced_protocol_begin(), - E = I->all_referenced_protocol_end(); PI != E; ++PI) + for (auto *PI : I->all_referenced_protocols()) MatchAllMethodDeclarations(InsMap, ClsMap, InsMapSeen, ClsMapSeen, - IMPDecl, - (*PI), IncompleteImpl, false, + IMPDecl, PI, IncompleteImpl, false, WarnCategoryMethodImpl); - + // FIXME. For now, we are not checking for extact match of methods // in category implementation and its primary class's super class. if (!WarnCategoryMethodImpl && I->getSuperClass()) @@ -2010,12 +2004,9 @@ void Sema::ImplMethodsVsClassMethods(Scope *S, ObjCImplDecl* IMPDecl, LazyProtocolNameSet ExplicitImplProtocols; if (ObjCInterfaceDecl *I = dyn_cast<ObjCInterfaceDecl> (CDecl)) { - for (ObjCInterfaceDecl::all_protocol_iterator - PI = I->all_referenced_protocol_begin(), - E = I->all_referenced_protocol_end(); PI != E; ++PI) - CheckProtocolMethodDefs(*this, IMPDecl->getLocation(), *PI, - IncompleteImpl, InsMap, ClsMap, I, - ExplicitImplProtocols); + for (auto *PI : I->all_referenced_protocols()) + CheckProtocolMethodDefs(*this, IMPDecl->getLocation(), PI, IncompleteImpl, + InsMap, ClsMap, I, ExplicitImplProtocols); // Check class extensions (unnamed categories) for (ObjCInterfaceDecl::visible_extensions_iterator Ext = I->visible_extensions_begin(), |