diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-03-07 16:09:59 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-03-07 16:09:59 +0000 |
commit | b2b8b1dc669c2a486e0841f6ac6aab6dc5cc6ec0 (patch) | |
tree | 52c666be558e1a81bba2452267c28c7b5f6562f2 /clang/lib/AST | |
parent | bcc77b04bb75722f6acaa29a408d7f8dc1d0e170 (diff) | |
download | bcm5719-llvm-b2b8b1dc669c2a486e0841f6ac6aab6dc5cc6ec0.tar.gz bcm5719-llvm-b2b8b1dc669c2a486e0841f6ac6aab6dc5cc6ec0.zip |
[C++11] Replacing BlockDecl 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: 203250
Diffstat (limited to 'clang/lib/AST')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 9 | ||||
-rw-r--r-- | clang/lib/AST/ASTDumper.cpp | 5 |
2 files changed, 5 insertions, 9 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 8df2eaec966..d3a82c4dc5e 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -4804,9 +4804,8 @@ std::string ASTContext::getObjCEncodingForBlock(const BlockExpr *Expr) const { SourceLocation Loc; CharUnits PtrSize = getTypeSizeInChars(VoidPtrTy); CharUnits ParmOffset = PtrSize; - for (BlockDecl::param_const_iterator PI = Decl->param_begin(), - E = Decl->param_end(); PI != E; ++PI) { - QualType PType = (*PI)->getType(); + for (auto PI : Decl->params()) { + QualType PType = PI->getType(); CharUnits sz = getObjCEncodingTypeSize(PType); if (sz.isZero()) continue; @@ -4820,9 +4819,7 @@ std::string ASTContext::getObjCEncodingForBlock(const BlockExpr *Expr) const { // Argument types. ParmOffset = PtrSize; - for (BlockDecl::param_const_iterator PI = Decl->param_begin(), E = - Decl->param_end(); PI != E; ++PI) { - ParmVarDecl *PVDecl = *PI; + for (auto PVDecl : Decl->params()) { QualType PType = PVDecl->getOriginalType(); if (const ArrayType *AT = dyn_cast<ArrayType>(PType->getCanonicalTypeInternal())) { diff --git a/clang/lib/AST/ASTDumper.cpp b/clang/lib/AST/ASTDumper.cpp index 42edf5bb94d..c1a8eaf01f0 100644 --- a/clang/lib/AST/ASTDumper.cpp +++ b/clang/lib/AST/ASTDumper.cpp @@ -1439,9 +1439,8 @@ void ASTDumper::VisitObjCPropertyImplDecl(const ObjCPropertyImplDecl *D) { } void ASTDumper::VisitBlockDecl(const BlockDecl *D) { - for (BlockDecl::param_const_iterator I = D->param_begin(), E = D->param_end(); - I != E; ++I) - dumpDecl(*I); + for (auto I : D->params()) + dumpDecl(I); if (D->isVariadic()) { IndentScope Indent(*this); |