diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-03-13 18:47:37 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-03-13 18:47:37 +0000 |
commit | dc4bea46763b5a8b7656baa24034edc9941a0aed (patch) | |
tree | c372e891f9847b780b3c52ae7abdf38611d8ad29 /clang/lib/AST/DeclObjC.cpp | |
parent | 8d62008ecb3edd841341789112a0fcab587beff5 (diff) | |
download | bcm5719-llvm-dc4bea46763b5a8b7656baa24034edc9941a0aed.tar.gz bcm5719-llvm-dc4bea46763b5a8b7656baa24034edc9941a0aed.zip |
[C++11] Replacing ObjCContainerDecl iterators prop_begin() and prop_end() with iterator_range props(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203830
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r-- | clang/lib/AST/DeclObjC.cpp | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index 094110fecf8..274e3faf867 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -125,8 +125,7 @@ ObjCContainerDecl::HasUserDeclaredSetterMethod(const ObjCPropertyDecl *Property) // Also search through the categories looking for a 'readwrite' declaration // of this property. If one found, presumably a setter will be provided // (properties declared in categories will not get auto-synthesized). - for (ObjCContainerDecl::prop_iterator P = Cat->prop_begin(), - E = Cat->prop_end(); P != E; ++P) + for (const auto *P : Cat->props()) if (P->getIdentifier() == Property->getIdentifier()) { if (P->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_readwrite) return true; @@ -286,9 +285,7 @@ ObjCInterfaceDecl::FindPropertyVisibleInPrimaryClass( void ObjCInterfaceDecl::collectPropertiesToImplement(PropertyMap &PM, PropertyDeclOrder &PO) const { - for (ObjCContainerDecl::prop_iterator P = prop_begin(), - E = prop_end(); P != E; ++P) { - ObjCPropertyDecl *Prop = *P; + for (auto *Prop : props()) { PM[Prop->getIdentifier()] = Prop; PO.push_back(Prop); } @@ -1114,13 +1111,11 @@ ObjCMethodDecl::findPropertyDecl(bool CheckOverrides) const { bool IsGetter = (NumArgs == 0); - for (ObjCContainerDecl::prop_iterator I = Container->prop_begin(), - E = Container->prop_end(); - I != E; ++I) { - Selector NextSel = IsGetter ? (*I)->getGetterName() - : (*I)->getSetterName(); + for (const auto *I : Container->props()) { + Selector NextSel = IsGetter ? I->getGetterName() + : I->getSetterName(); if (NextSel == Sel) - return *I; + return I; } llvm_unreachable("Marked as a property accessor but no property found!"); @@ -1606,9 +1601,7 @@ void ObjCProtocolDecl::collectPropertiesToImplement(PropertyMap &PM, PropertyDeclOrder &PO) const { if (const ObjCProtocolDecl *PDecl = getDefinition()) { - for (ObjCProtocolDecl::prop_iterator P = PDecl->prop_begin(), - E = PDecl->prop_end(); P != E; ++P) { - ObjCPropertyDecl *Prop = *P; + for (auto *Prop : PDecl->props()) { // Insert into PM if not there already. PM.insert(std::make_pair(Prop->getIdentifier(), Prop)); PO.push_back(Prop); @@ -1626,9 +1619,7 @@ void ObjCProtocolDecl::collectInheritedProtocolProperties( ProtocolPropertyMap &PM) const { if (const ObjCProtocolDecl *PDecl = getDefinition()) { bool MatchFound = false; - for (ObjCProtocolDecl::prop_iterator P = PDecl->prop_begin(), - E = PDecl->prop_end(); P != E; ++P) { - ObjCPropertyDecl *Prop = *P; + for (auto *Prop : PDecl->props()) { if (Prop == Property) continue; if (Prop->getIdentifier() == Property->getIdentifier()) { |