aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-21 18:44:24 +0000
committerChris Lattner <sabre@nondot.org>2008-11-21 18:44:24 +0000
commit2c21a073525cdfa68e4439b7af551385dc2796ab (patch)
treeadeda1683659f3ec9b8229a8d2dc7d7fd29c0248 /lib/Sema/SemaChecking.cpp
parentb1b4d337fafe30823b581cbfaa1641f37541fffe (diff)
merge some simple call diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59831 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r--lib/Sema/SemaChecking.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index eb961d14fa..09474452a2 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -153,9 +153,9 @@ bool Sema::CheckBuiltinCFStringArgument(Expr* Arg) {
bool Sema::SemaBuiltinVAStart(CallExpr *TheCall) {
Expr *Fn = TheCall->getCallee();
if (TheCall->getNumArgs() > 2) {
- Diag(TheCall->getArg(2)->getLocStart(),
+ Diag(TheCall->getArg(2)->getLocStart(),
diag::err_typecheck_call_too_many_args)
- << Fn->getSourceRange()
+ << 0 /*function call*/ << Fn->getSourceRange()
<< SourceRange(TheCall->getArg(2)->getLocStart(),
(*(TheCall->arg_end()-1))->getLocEnd());
return true;
@@ -202,10 +202,12 @@ bool Sema::SemaBuiltinVAStart(CallExpr *TheCall) {
/// friends. This is declared to take (...), so we have to check everything.
bool Sema::SemaBuiltinUnorderedCompare(CallExpr *TheCall) {
if (TheCall->getNumArgs() < 2)
- return Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args);
+ return Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args)
+ << 0 /*function call*/;
if (TheCall->getNumArgs() > 2)
return Diag(TheCall->getArg(2)->getLocStart(),
diag::err_typecheck_call_too_many_args)
+ << 0 /*function call*/
<< SourceRange(TheCall->getArg(2)->getLocStart(),
(*(TheCall->arg_end()-1))->getLocEnd());
@@ -242,7 +244,7 @@ bool Sema::SemaBuiltinStackAddress(CallExpr *TheCall) {
Action::ExprResult Sema::SemaBuiltinShuffleVector(CallExpr *TheCall) {
if (TheCall->getNumArgs() < 3)
return Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args)
- << TheCall->getSourceRange();
+ << 0 /*function call*/ << TheCall->getSourceRange();
QualType FAType = TheCall->getArg(0)->getType();
QualType SAType = TheCall->getArg(1)->getType();
@@ -266,9 +268,9 @@ Action::ExprResult Sema::SemaBuiltinShuffleVector(CallExpr *TheCall) {
if (TheCall->getNumArgs() != numElements+2) {
if (TheCall->getNumArgs() < numElements+2)
return Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args)
- << TheCall->getSourceRange();
+ << 0 /*function call*/ << TheCall->getSourceRange();
return Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_many_args)
- << TheCall->getSourceRange();
+ << 0 /*function call*/ << TheCall->getSourceRange();
}
for (unsigned i = 2; i < TheCall->getNumArgs(); i++) {
@@ -304,7 +306,7 @@ bool Sema::SemaBuiltinPrefetch(CallExpr *TheCall) {
if (NumArgs > 3)
return Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_many_args)
- << TheCall->getSourceRange();
+ << 0 /*function call*/ << TheCall->getSourceRange();
// Argument 0 is checked for us and the remaining arguments must be
// constant integers.