diff options
author | Anders Carlsson <andersca@mac.com> | 2009-02-14 18:21:46 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-02-14 18:21:46 +0000 |
commit | ff975cfab9ada27df86038286d1678084aeb3428 (patch) | |
tree | 5207d134330172f1005e041d68e9e4c4e1658905 /lib/Sema/SemaExprObjC.cpp | |
parent | e308c413fa30dd137648f3fd772a75f6fa5e4d5a (diff) |
Pass the location of the start of the selector to ActOnClassMessage/ActOnInstanceMessage.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64560 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r-- | lib/Sema/SemaExprObjC.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index 7629987f04..6e110506eb 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -177,7 +177,8 @@ bool Sema::CheckMessageArgumentTypes(Expr **Args, unsigned NumArgs, Sema::ExprResult Sema::ActOnClassMessage( Scope *S, IdentifierInfo *receiverName, Selector Sel, - SourceLocation lbrac, SourceLocation receiverLoc, SourceLocation rbrac, + SourceLocation lbrac, SourceLocation receiverLoc, + SourceLocation selectorLoc, SourceLocation rbrac, ExprTy **Args, unsigned NumArgs) { assert(receiverName && "missing receiver class name"); @@ -202,8 +203,8 @@ Sema::ExprResult Sema::ActOnClassMessage( ExprResult ReceiverExpr = new (Context) ObjCSuperExpr(SourceLocation(), superTy); // We are really in an instance method, redirect. - return ActOnInstanceMessage(ReceiverExpr.get(), Sel, lbrac, rbrac, - Args, NumArgs); + return ActOnInstanceMessage(ReceiverExpr.get(), Sel, lbrac, + selectorLoc, rbrac, Args, NumArgs); } // We are sending a message to 'super' within a class method. Do nothing, // the receiver will pass through as 'super' (how convenient:-). @@ -216,8 +217,8 @@ Sema::ExprResult Sema::ActOnClassMessage( ExprResult ReceiverExpr = new (Context) DeclRefExpr(VD, VD->getType(), receiverLoc); // We are really in an instance method, redirect. - return ActOnInstanceMessage(ReceiverExpr.get(), Sel, lbrac, rbrac, - Args, NumArgs); + return ActOnInstanceMessage(ReceiverExpr.get(), Sel, lbrac, + selectorLoc, rbrac, Args, NumArgs); } return Diag(receiverLoc, diag::err_undeclared_var_use) << receiverName; } @@ -290,6 +291,7 @@ Sema::ExprResult Sema::ActOnClassMessage( // is obtained from Sel.getNumArgs(). Sema::ExprResult Sema::ActOnInstanceMessage(ExprTy *receiver, Selector Sel, SourceLocation lbrac, + SourceLocation receiverLoc, SourceLocation rbrac, ExprTy **Args, unsigned NumArgs) { assert(receiver && "missing receiver expression"); @@ -310,6 +312,7 @@ Sema::ExprResult Sema::ActOnInstanceMessage(ExprTy *receiver, Selector Sel, if (ObjCInterfaceDecl *SuperDecl = ClassDecl->getSuperClass()) Method = SuperDecl->lookupInstanceMethod(Sel); } + if (CheckMessageArgumentTypes(ArgExprs, NumArgs, Sel, Method, false, lbrac, rbrac, returnType)) return true; |