From b4a534559811ce82c3300fed9cafbd9d7dcf89d2 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 13 Mar 2014 21:57:01 +0000 Subject: [C++11] Replacing ObjCInterfaceDecl iterators known_extensions_begin() and known_extensions_end() with iterator_range known_extensions(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203857 --- clang/lib/AST/ASTContext.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'clang/lib/AST/ASTContext.cpp') diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 64cdda1c18b..2f8b8e66185 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -387,10 +387,7 @@ static void addRedeclaredMethods(const ObjCMethodDecl *ObjCMethod, if (!ID) return; // Add redeclared method here. - for (ObjCInterfaceDecl::known_extensions_iterator - Ext = ID->known_extensions_begin(), - ExtEnd = ID->known_extensions_end(); - Ext != ExtEnd; ++Ext) { + for (const auto *Ext : ID->known_extensions()) { if (ObjCMethodDecl *RedeclaredMethod = Ext->getMethod(ObjCMethod->getSelector(), ObjCMethod->isInstanceMethod())) @@ -1854,12 +1851,8 @@ void ASTContext::CollectInheritedProtocols(const Decl *CDecl, unsigned ASTContext::CountNonClassIvars(const ObjCInterfaceDecl *OI) const { unsigned count = 0; // Count ivars declared in class extension. - for (ObjCInterfaceDecl::known_extensions_iterator - Ext = OI->known_extensions_begin(), - ExtEnd = OI->known_extensions_end(); - Ext != ExtEnd; ++Ext) { + for (const auto *Ext : OI->known_extensions()) count += Ext->ivar_size(); - } // Count ivar defined in this class's implementation. This // includes synthesized ivars. -- cgit v1.2.3