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/SemaObjCProperty.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/SemaObjCProperty.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaObjCProperty.cpp | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index d918aeca15b..a10e3d83709 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/lib/Sema/SemaObjCProperty.cpp @@ -227,11 +227,8 @@ Decl *Sema::ActOnProperty(Scope *S, SourceLocation AtLoc, } } else { // Slower path: look in all protocols we referenced. - for (ObjCInterfaceDecl::all_protocol_iterator - P = IFace->all_referenced_protocol_begin(), - PEnd = IFace->all_referenced_protocol_end(); - P != PEnd; ++P) { - CheckPropertyAgainstProtocol(*this, Res, *P, KnownProtos); + for (auto *P : IFace->all_referenced_protocols()) { + CheckPropertyAgainstProtocol(*this, Res, P, KnownProtos); } } } else if (ObjCCategoryDecl *Cat = dyn_cast<ObjCCategoryDecl>(ClassDecl)) { @@ -763,18 +760,14 @@ DiagnosePropertyMismatchDeclInProtocols(Sema &S, SourceLocation AtLoc, ObjCInterfaceDecl *ClassDecl, ObjCPropertyDecl *Property) { ObjCInterfaceDecl::ProtocolPropertyMap PropMap; - for (ObjCInterfaceDecl::all_protocol_iterator - PI = ClassDecl->all_referenced_protocol_begin(), - E = ClassDecl->all_referenced_protocol_end(); PI != E; ++PI) { - if (const ObjCProtocolDecl *PDecl = (*PI)->getDefinition()) + for (const auto *PI : ClassDecl->all_referenced_protocols()) { + if (const ObjCProtocolDecl *PDecl = PI->getDefinition()) PDecl->collectInheritedProtocolProperties(Property, PropMap); } if (ObjCInterfaceDecl *SDecl = ClassDecl->getSuperClass()) while (SDecl) { - for (ObjCInterfaceDecl::all_protocol_iterator - PI = SDecl->all_referenced_protocol_begin(), - E = SDecl->all_referenced_protocol_end(); PI != E; ++PI) { - if (const ObjCProtocolDecl *PDecl = (*PI)->getDefinition()) + for (const auto *PI : SDecl->all_referenced_protocols()) { + if (const ObjCProtocolDecl *PDecl = PI->getDefinition()) PDecl->collectInheritedProtocolProperties(Property, PropMap); } SDecl = SDecl->getSuperClass(); @@ -1447,10 +1440,8 @@ static void CollectImmediateProperties(ObjCContainerDecl *CDecl, PropMap[Prop->getIdentifier()] = Prop; if (IncludeProtocols) { // Scan through class's protocols. - for (ObjCInterfaceDecl::all_protocol_iterator - PI = IDecl->all_referenced_protocol_begin(), - E = IDecl->all_referenced_protocol_end(); PI != E; ++PI) - CollectImmediateProperties((*PI), PropMap, SuperPropMap); + for (auto *PI : IDecl->all_referenced_protocols()) + CollectImmediateProperties(PI, PropMap, SuperPropMap); } } if (ObjCCategoryDecl *CATDecl = dyn_cast<ObjCCategoryDecl>(CDecl)) { @@ -1698,11 +1689,7 @@ void Sema::DiagnoseUnimplementedProperties(Scope *S, ObjCImplDecl* IMPDecl, if (IDecl) { std::unique_ptr<ObjCContainerDecl::PropertyMap> LazyMap; - for (ObjCInterfaceDecl::all_protocol_iterator - PI = IDecl->all_referenced_protocol_begin(), - PE = IDecl->all_referenced_protocol_end(); - PI != PE; ++PI) { - ObjCProtocolDecl *PDecl = *PI; + for (auto *PDecl : IDecl->all_referenced_protocols()) { if (!PDecl->hasAttr<ObjCExplicitProtocolImplAttr>()) continue; // Lazily construct a set of all the properties in the @interface |

