summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-03-17 15:23:01 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-03-17 15:23:01 +0000
commit40bd0aaf686432aea96cff32d5393ec064a9dd0e (patch)
treec4af76848aebd110d674efb1a1afc3477105e01e /clang/lib/Sema/SemaDecl.cpp
parente7846206e82d8798cb98e1f533bc9da0214adb0a (diff)
downloadbcm5719-llvm-40bd0aaf686432aea96cff32d5393ec064a9dd0e.tar.gz
bcm5719-llvm-40bd0aaf686432aea96cff32d5393ec064a9dd0e.zip
[C++11] Replacing FunctionProtoType iterators param_type_begin() and param_type_end() with iterator_range param_types(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 204045
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp23
1 files changed, 7 insertions, 16 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index f4e0df6d0ab..58fe7227d20 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -2649,8 +2649,7 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, NamedDecl *&OldD,
// The old declaration provided a function prototype, but the
// new declaration does not. Merge in the prototype.
assert(!OldProto->hasExceptionSpec() && "Exception spec in C");
- SmallVector<QualType, 16> ParamTypes(OldProto->param_type_begin(),
- OldProto->param_type_end());
+ SmallVector<QualType, 16> ParamTypes(OldProto->param_types());
NewQType =
Context.getFunctionType(NewFuncType->getReturnType(), ParamTypes,
OldProto->getExtProtoInfo());
@@ -2659,16 +2658,10 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, NamedDecl *&OldD,
// Synthesize a parameter for each argument type.
SmallVector<ParmVarDecl*, 16> Params;
- for (FunctionProtoType::param_type_iterator
- ParamType = OldProto->param_type_begin(),
- ParamEnd = OldProto->param_type_end();
- ParamType != ParamEnd; ++ParamType) {
- ParmVarDecl *Param = ParmVarDecl::Create(Context, New,
- SourceLocation(),
- SourceLocation(), 0,
- *ParamType, /*TInfo=*/0,
- SC_None,
- 0);
+ for (const auto &ParamType : OldProto->param_types()) {
+ ParmVarDecl *Param = ParmVarDecl::Create(Context, New, SourceLocation(),
+ SourceLocation(), 0, ParamType,
+ /*TInfo=*/0, SC_None, 0);
Param->setScopeInfo(0, Params.size());
Param->setImplicit();
Params.push_back(Param);
@@ -6909,11 +6902,9 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
// @endcode
// Synthesize a parameter for each argument type.
- for (FunctionProtoType::param_type_iterator AI = FT->param_type_begin(),
- AE = FT->param_type_end();
- AI != AE; ++AI) {
+ for (const auto &AI : FT->param_types()) {
ParmVarDecl *Param =
- BuildParmVarDeclForTypedef(NewFD, D.getIdentifierLoc(), *AI);
+ BuildParmVarDeclForTypedef(NewFD, D.getIdentifierLoc(), AI);
Param->setScopeInfo(0, Params.size());
Params.push_back(Param);
}
OpenPOWER on IntegriCloud