diff options
author | Jordan Rose <jordan_rose@apple.com> | 2013-03-08 21:51:21 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2013-03-08 21:51:21 +0000 |
commit | bea522ff43a3f11c7a2bc7949119dbb9fce19e39 (patch) | |
tree | 7e720ef716401a1b50dda348b13a9b8a108e1200 /lib/Sema/SemaLambda.cpp | |
parent | 303b96f255d61ae3dff913d777d3f40332786257 (diff) |
ArrayRef-ize ASTContext::getFunctionType and Sema::BuildFunctionType.
No (intended) functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176726 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLambda.cpp')
-rw-r--r-- | lib/Sema/SemaLambda.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/lib/Sema/SemaLambda.cpp b/lib/Sema/SemaLambda.cpp index 43e0c05c93..21202c176f 100644 --- a/lib/Sema/SemaLambda.cpp +++ b/lib/Sema/SemaLambda.cpp @@ -385,7 +385,8 @@ void Sema::ActOnStartOfLambdaDefinition(LambdaIntroducer &Intro, EPI.HasTrailingReturn = true; EPI.TypeQuals |= DeclSpec::TQ_const; QualType MethodTy = Context.getFunctionType(Context.DependentTy, - /*Args=*/0, /*NumArgs=*/0, EPI); + ArrayRef<QualType>(), + EPI); MethodTyInfo = Context.getTrivialTypeSourceInfo(MethodTy); ExplicitParams = false; ExplicitResultType = false; @@ -628,16 +629,18 @@ static void addFunctionPointerConversion(Sema &S, { FunctionProtoType::ExtProtoInfo ExtInfo = Proto->getExtProtoInfo(); ExtInfo.TypeQuals = 0; - FunctionTy = S.Context.getFunctionType(Proto->getResultType(), - Proto->arg_type_begin(), - Proto->getNumArgs(), - ExtInfo); + FunctionTy = + S.Context.getFunctionType(Proto->getResultType(), + ArrayRef<QualType>(Proto->arg_type_begin(), + Proto->getNumArgs()), + ExtInfo); FunctionPtrTy = S.Context.getPointerType(FunctionTy); } FunctionProtoType::ExtProtoInfo ExtInfo; ExtInfo.TypeQuals = Qualifiers::Const; - QualType ConvTy = S.Context.getFunctionType(FunctionPtrTy, 0, 0, ExtInfo); + QualType ConvTy = + S.Context.getFunctionType(FunctionPtrTy, ArrayRef<QualType>(), ExtInfo); SourceLocation Loc = IntroducerRange.getBegin(); DeclarationName Name @@ -701,15 +704,16 @@ static void addBlockPointerConversion(Sema &S, ExtInfo.TypeQuals = 0; QualType FunctionTy = S.Context.getFunctionType(Proto->getResultType(), - Proto->arg_type_begin(), - Proto->getNumArgs(), + ArrayRef<QualType>(Proto->arg_type_begin(), + Proto->getNumArgs()), ExtInfo); BlockPtrTy = S.Context.getBlockPointerType(FunctionTy); } FunctionProtoType::ExtProtoInfo ExtInfo; ExtInfo.TypeQuals = Qualifiers::Const; - QualType ConvTy = S.Context.getFunctionType(BlockPtrTy, 0, 0, ExtInfo); + QualType ConvTy = S.Context.getFunctionType(BlockPtrTy, ArrayRef<QualType>(), + ExtInfo); SourceLocation Loc = IntroducerRange.getBegin(); DeclarationName Name @@ -821,8 +825,8 @@ ExprResult Sema::ActOnLambdaExpr(SourceLocation StartLoc, Stmt *Body, = CallOperator->getType()->getAs<FunctionProtoType>(); QualType FunctionTy = Context.getFunctionType(LSI->ReturnType, - Proto->arg_type_begin(), - Proto->getNumArgs(), + ArrayRef<QualType>(Proto->arg_type_begin(), + Proto->getNumArgs()), Proto->getExtProtoInfo()); CallOperator->setType(FunctionTy); } |