diff options
| author | Aaron Ballman <aaron@aaronballman.com> | 2014-03-07 15:12:56 +0000 |
|---|---|---|
| committer | Aaron Ballman <aaron@aaronballman.com> | 2014-03-07 15:12:56 +0000 |
| commit | f6bf62e2d0a08d05a6029d629e2164c8c1e8f655 (patch) | |
| tree | 42f5a5e505e19c5c0c1b1edc75e46f0ca4391d99 /clang/lib/AST | |
| parent | 65fe9377f08448d12c04a9fcdbd0d49fd6807ecd (diff) | |
| download | bcm5719-llvm-f6bf62e2d0a08d05a6029d629e2164c8c1e8f655.tar.gz bcm5719-llvm-f6bf62e2d0a08d05a6029d629e2164c8c1e8f655.zip | |
[C++11] Replacing FunctionDecl 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: 203248
Diffstat (limited to 'clang/lib/AST')
| -rw-r--r-- | clang/lib/AST/ASTContext.cpp | 9 | ||||
| -rw-r--r-- | clang/lib/AST/ASTImporter.cpp | 5 |
2 files changed, 5 insertions, 9 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index d94fa4ba36f..8df2eaec966 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -4850,9 +4850,8 @@ bool ASTContext::getObjCEncodingForFunctionDecl(const FunctionDecl *Decl, getObjCEncodingForType(Decl->getReturnType(), S); CharUnits ParmOffset; // Compute size of all parameters. - for (FunctionDecl::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; @@ -4865,9 +4864,7 @@ bool ASTContext::getObjCEncodingForFunctionDecl(const FunctionDecl *Decl, ParmOffset = CharUnits::Zero(); // Argument types. - for (FunctionDecl::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/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index cb5939cd3d4..17ab4187921 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/lib/AST/ASTImporter.cpp @@ -2743,9 +2743,8 @@ Decl *ASTNodeImporter::VisitFunctionDecl(FunctionDecl *D) { // Import the function parameters. SmallVector<ParmVarDecl *, 8> Parameters; - for (FunctionDecl::param_iterator P = D->param_begin(), PEnd = D->param_end(); - P != PEnd; ++P) { - ParmVarDecl *ToP = cast_or_null<ParmVarDecl>(Importer.Import(*P)); + for (auto P : D->params()) { + ParmVarDecl *ToP = cast_or_null<ParmVarDecl>(Importer.Import(P)); if (!ToP) return 0; |

