diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-03-07 19:56:05 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-03-07 19:56:05 +0000 |
commit | 629afaefe0cd1a583ccee54918b7b13f48bfe273 (patch) | |
tree | 9a236cdf36b4b96c8aad05ccdb63d8f40f9acd9c /clang/tools/libclang/CIndex.cpp | |
parent | d72a5f103da45e5abe10497308fce5aeb992cdc2 (diff) | |
download | bcm5719-llvm-629afaefe0cd1a583ccee54918b7b13f48bfe273.tar.gz bcm5719-llvm-629afaefe0cd1a583ccee54918b7b13f48bfe273.zip |
[C++11] Replacing DeclBase iterators decls_begin() and decls_end() with iterator_range decls(). The same is true for the noload versions of these APIs. Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203278
Diffstat (limited to 'clang/tools/libclang/CIndex.cpp')
-rw-r--r-- | clang/tools/libclang/CIndex.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index ac66a770db2..614bb0cbfc9 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -980,13 +980,11 @@ bool CursorVisitor::VisitObjCContainerDecl(ObjCContainerDecl *D) { // Get all the Decls in the DeclContext, and sort them with the // additional ones we've collected. Then visit them. - for (DeclContext::decl_iterator I = D->decls_begin(), E = D->decls_end(); - I!=E; ++I) { - Decl *subDecl = *I; - if (!subDecl || subDecl->getLexicalDeclContext() != D || - subDecl->getLocStart().isInvalid()) + for (auto *SubDecl : D->decls()) { + if (!SubDecl || SubDecl->getLexicalDeclContext() != D || + SubDecl->getLocStart().isInvalid()) continue; - DeclsInContainer.push_back(subDecl); + DeclsInContainer.push_back(SubDecl); } // Now sort the Decls so that they appear in lexical order. |