diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-05-13 18:09:35 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-05-13 18:09:35 +0000 |
commit | 027b886a99bcf8cd88f2312ffc278e715565b956 (patch) | |
tree | 2cec92141dc34b2ce1d9eef4fe23ef3af4edf34a /clang/lib/Sema | |
parent | 784ae669ab3db1052b4d84bf155cccf9f9054475 (diff) | |
download | bcm5719-llvm-027b886a99bcf8cd88f2312ffc278e715565b956.tar.gz bcm5719-llvm-027b886a99bcf8cd88f2312ffc278e715565b956.zip |
Some early declarations to support sentinel attribute on
message dispatches (and function calls later). No change in
functionality.
llvm-svn: 71683
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r-- | clang/lib/Sema/Sema.h | 2 | ||||
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 9 | ||||
-rw-r--r-- | clang/lib/Sema/SemaExprObjC.cpp | 2 |
3 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h index 2e617f573be..8c38c2bfd2b 100644 --- a/clang/lib/Sema/Sema.h +++ b/clang/lib/Sema/Sema.h @@ -1274,6 +1274,8 @@ public: bool DiagnosePropertyAccessorMismatch(ObjCPropertyDecl *PD, ObjCMethodDecl *Getter, SourceLocation Loc); + void DiagnoseSentinelCalls(NamedDecl *D, SourceLocation Loc, + Expr **Args, unsigned NumArgs); // Primary Expressions. virtual SourceRange getExprRange(ExprTy *E) const; diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index d2e84c10e22..f1da408669c 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -88,6 +88,15 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc) { return false; } +/// DiagnoseSentinelCalls - This routine checks on method dispatch calls +/// (and other functions in future), which have been declared with sentinel +/// attribute. It warns if call does not have the sentinel argument. +/// +void Sema::DiagnoseSentinelCalls(NamedDecl *D, SourceLocation Loc, + Expr **Args, unsigned NumArgs) +{ +} + SourceRange Sema::getExprRange(ExprTy *E) const { Expr *Ex = (Expr *)E; return Ex? Ex->getSourceRange() : SourceRange(); diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index de6b69f90fb..0073fd9f28f 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -626,6 +626,8 @@ Sema::ExprResult Sema::ActOnInstanceMessage(ExprTy *receiver, Selector Sel, return true; } + if (Method) + DiagnoseSentinelCalls(Method, receiverLoc, ArgExprs, NumArgs); if (CheckMessageArgumentTypes(ArgExprs, NumArgs, Sel, Method, false, lbrac, rbrac, returnType)) return true; |