diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-03-13 21:23:55 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-03-13 21:23:55 +0000 |
commit | 3fe486a332bc206f9415f9b54e4694115a69b0ab (patch) | |
tree | 1b321402c5a8c60b8aabf381723572a0b4775d75 /clang/lib/Sema/SemaCodeComplete.cpp | |
parent | 8a5c5a016cf07fa71dde21eb128256be7924f216 (diff) | |
download | bcm5719-llvm-3fe486a332bc206f9415f9b54e4694115a69b0ab.tar.gz bcm5719-llvm-3fe486a332bc206f9415f9b54e4694115a69b0ab.zip |
[C++11] Replacing ObjCInterfaceDecl iterators visible_categories_begin() and visible_categories_end() with iterator_range visible_categories(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203851
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCodeComplete.cpp | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index 87a2b4cf0eb..a1adf1fc925 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -5863,12 +5863,8 @@ void Sema::CodeCompleteObjCInterfaceCategory(Scope *S, NamedDecl *CurClass = LookupSingleName(TUScope, ClassName, ClassNameLoc, LookupOrdinaryName); if (ObjCInterfaceDecl *Class = dyn_cast_or_null<ObjCInterfaceDecl>(CurClass)){ - for (ObjCInterfaceDecl::visible_categories_iterator - Cat = Class->visible_categories_begin(), - CatEnd = Class->visible_categories_end(); - Cat != CatEnd; ++Cat) { + for (const auto *Cat : Class->visible_categories()) CategoryNames.insert(Cat->getIdentifier()); - } } // Add all of the categories we know about. @@ -5911,13 +5907,10 @@ void Sema::CodeCompleteObjCImplementationCategory(Scope *S, Results.EnterNewScope(); bool IgnoreImplemented = true; while (Class) { - for (ObjCInterfaceDecl::visible_categories_iterator - Cat = Class->visible_categories_begin(), - CatEnd = Class->visible_categories_end(); - Cat != CatEnd; ++Cat) { + for (const auto *Cat : Class->visible_categories()) { if ((!IgnoreImplemented || !Cat->getImplementation()) && CategoryNames.insert(Cat->getIdentifier())) - Results.AddResult(Result(*Cat, Results.getBasePriority(*Cat), 0), + Results.AddResult(Result(Cat, Results.getBasePriority(Cat), 0), CurContext, 0, false); } @@ -6094,11 +6087,8 @@ static void FindImplementableMethods(ASTContext &Context, KnownMethods, InOriginalClass); // Add methods from any class extensions and categories. - for (ObjCInterfaceDecl::visible_categories_iterator - Cat = IFace->visible_categories_begin(), - CatEnd = IFace->visible_categories_end(); - Cat != CatEnd; ++Cat) { - FindImplementableMethods(Context, *Cat, WantInstanceMethods, ReturnType, + for (auto *Cat : IFace->visible_categories()) { + FindImplementableMethods(Context, Cat, WantInstanceMethods, ReturnType, KnownMethods, false); } @@ -6958,14 +6948,9 @@ void Sema::CodeCompleteObjCMethodDecl(Scope *S, if (ObjCCategoryDecl *Category = dyn_cast<ObjCCategoryDecl>(SearchDecl)) IFace = Category->getClassInterface(); - if (IFace) { - for (ObjCInterfaceDecl::visible_categories_iterator - Cat = IFace->visible_categories_begin(), - CatEnd = IFace->visible_categories_end(); - Cat != CatEnd; ++Cat) { - Containers.push_back(*Cat); - } - } + if (IFace) + for (auto *Cat : IFace->visible_categories()) + Containers.push_back(Cat); for (unsigned I = 0, N = Containers.size(); I != N; ++I) for (auto *P : Containers[I]->properties()) |