diff options
| author | Aaron Ballman <aaron@aaronballman.com> | 2014-03-07 17:50:17 +0000 |
|---|---|---|
| committer | Aaron Ballman <aaron@aaronballman.com> | 2014-03-07 17:50:17 +0000 |
| commit | 43b68bebe708fee758a3c93534118c853bb1b230 (patch) | |
| tree | 54b2bb4553c87c7010656e684cf4c64a7a0ec841 /clang/tools | |
| parent | 6b3d6a4fe9013c3737fb3226d12cd691da05686b (diff) | |
| download | bcm5719-llvm-43b68bebe708fee758a3c93534118c853bb1b230.tar.gz bcm5719-llvm-43b68bebe708fee758a3c93534118c853bb1b230.zip | |
[C++11] Replacing ObjCMethodDecl iterators param_begin() and param_end() with iterator_range params(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203255
Diffstat (limited to 'clang/tools')
| -rw-r--r-- | clang/tools/libclang/CIndex.cpp | 12 | ||||
| -rw-r--r-- | clang/tools/libclang/IndexDecl.cpp | 6 |
2 files changed, 6 insertions, 12 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index 1c24e6b7b27..52a792927ef 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -916,10 +916,8 @@ bool CursorVisitor::VisitObjCMethodDecl(ObjCMethodDecl *ND) { if (Visit(TSInfo->getTypeLoc())) return true; - for (ObjCMethodDecl::param_iterator P = ND->param_begin(), - PEnd = ND->param_end(); - P != PEnd; ++P) { - if (Visit(MakeCXCursor(*P, TU, RegionOfInterest))) + for (const auto *P : ND->params()) { + if (Visit(MakeCXCursor(P, TU, RegionOfInterest))) return true; } @@ -5361,10 +5359,8 @@ AnnotateTokensWorker::Visit(CXCursor cursor, CXCursor parent) { if (Method->getObjCDeclQualifier()) HasContextSensitiveKeywords = true; else { - for (ObjCMethodDecl::param_const_iterator P = Method->param_begin(), - PEnd = Method->param_end(); - P != PEnd; ++P) { - if ((*P)->getObjCDeclQualifier()) { + for (const auto *P : Method->params()) { + if (P->getObjCDeclQualifier()) { HasContextSensitiveKeywords = true; break; } diff --git a/clang/tools/libclang/IndexDecl.cpp b/clang/tools/libclang/IndexDecl.cpp index 72e38f575cf..d39076b974e 100644 --- a/clang/tools/libclang/IndexDecl.cpp +++ b/clang/tools/libclang/IndexDecl.cpp @@ -54,10 +54,8 @@ public: return; IndexCtx.indexTypeSourceInfo(D->getReturnTypeSourceInfo(), D); - for (ObjCMethodDecl::param_const_iterator I = D->param_begin(), - E = D->param_end(); - I != E; ++I) - handleDeclarator(*I, D); + for (const auto *I : D->params()) + handleDeclarator(I, D); if (D->isThisDeclarationADefinition()) { const Stmt *Body = D->getBody(); |

