From 287f24d3991994b9a263af9e2a873f4feadfb8fa Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Sun, 5 May 2013 19:42:09 +0000 Subject: [PATCH] ArrayRef'ize Sema::CheckObjCMethodCall Patch by Robert Wilhelm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181164 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Sema/Sema.h | 2 +- lib/Sema/SemaChecking.cpp | 5 ++--- lib/Sema/SemaExprObjC.cpp | 3 ++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index f851a7a35f..d7c80f2e4f 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -7384,7 +7384,7 @@ private: bool CheckFunctionCall(FunctionDecl *FDecl, CallExpr *TheCall, const FunctionProtoType *Proto); bool CheckObjCMethodCall(ObjCMethodDecl *Method, SourceLocation loc, - Expr **Args, unsigned NumArgs); + ArrayRef Args); bool CheckBlockCall(NamedDecl *NDecl, CallExpr *TheCall, const FunctionProtoType *Proto); void CheckConstructorCall(FunctionDecl *FDecl, diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index 6b809cfba2..e14635ee25 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -586,12 +586,11 @@ bool Sema::CheckFunctionCall(FunctionDecl *FDecl, CallExpr *TheCall, } bool Sema::CheckObjCMethodCall(ObjCMethodDecl *Method, SourceLocation lbrac, - Expr **Args, unsigned NumArgs) { + ArrayRef Args) { VariadicCallType CallType = Method->isVariadic() ? VariadicMethod : VariadicDoesNotApply; - checkCall(Method, llvm::makeArrayRef(Args, NumArgs), - Method->param_size(), + checkCall(Method, Args, Method->param_size(), /*IsMemberFunction=*/false, lbrac, Method->getSourceRange(), CallType); diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index b36586dacb..cf77896cb8 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -1326,7 +1326,8 @@ bool Sema::CheckMessageArgumentTypes(QualType ReceiverType, DiagnoseSentinelCalls(Method, SelLoc, Args, NumArgs); // Do additional checkings on method. - IsError |= CheckObjCMethodCall(Method, SelLoc, Args, NumArgs); + IsError |= CheckObjCMethodCall(Method, SelLoc, + llvm::makeArrayRef(Args, NumArgs)); return IsError; } -- 2.40.0