From b2b8b1dc669c2a486e0841f6ac6aab6dc5cc6ec0 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Fri, 7 Mar 2014 16:09:59 +0000 Subject: [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 --- clang/lib/AST/ASTContext.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'clang/lib/AST/ASTContext.cpp') 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(PType->getCanonicalTypeInternal())) { -- cgit v1.2.3