From: Eric Christopher Date: Mon, 19 Apr 2010 18:23:02 +0000 (+0000) Subject: Remove the argument number from the constant integer diagnostic. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e8965525282a48fd34af05183b8c3705a5b00d5;p=clang Remove the argument number from the constant integer diagnostic. Update all of the testcases accordingly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101795 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index ba8008d0b6..71e67270b5 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -2864,7 +2864,7 @@ def err_builtin_longjmp_invalid_val : Error< "argument to __builtin_longjmp must be a constant 1">; def err_constant_integer_arg_type : Error< - "argument %0 to %1 must be a constant integer">; + "argument to %0 must be a constant integer">; def ext_mixed_decls_code : Extension< "ISO C90 forbids mixing declarations and code">; diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index b1eb756d46..5056e3172b 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -743,7 +743,7 @@ bool Sema::SemaBuiltinConstantArg(CallExpr *TheCall, int ArgNum, if (!Arg->isIntegerConstantExpr(Result, Context)) return Diag(TheCall->getLocStart(), diag::err_constant_integer_arg_type) - << ArgNum << FDecl->getDeclName() << Arg->getSourceRange(); + << FDecl->getDeclName() << Arg->getSourceRange(); return false; } diff --git a/test/Sema/builtin-prefetch.c b/test/Sema/builtin-prefetch.c index 424d47e903..c5fa792a56 100644 --- a/test/Sema/builtin-prefetch.c +++ b/test/Sema/builtin-prefetch.c @@ -6,8 +6,8 @@ void foo() { __builtin_prefetch(&a, 1); __builtin_prefetch(&a, 1, 2); __builtin_prefetch(&a, 1, 9, 3); // expected-error{{too many arguments to function}} - __builtin_prefetch(&a, "hello", 2); // expected-error{{argument 1 to '__builtin_prefetch' must be a constant integer}} - __builtin_prefetch(&a, a, 2); // expected-error{{argument 1 to '__builtin_prefetch' must be a constant integer}} + __builtin_prefetch(&a, "hello", 2); // expected-error{{argument to '__builtin_prefetch' must be a constant integer}} + __builtin_prefetch(&a, a, 2); // expected-error{{argument to '__builtin_prefetch' must be a constant integer}} __builtin_prefetch(&a, 2); // expected-error{{argument should be a value from 0 to 1}} __builtin_prefetch(&a, 0, 4); // expected-error{{argument should be a value from 0 to 3}} __builtin_prefetch(&a, -1, 4); // expected-error{{argument should be a value from 0 to 1}} diff --git a/test/Sema/builtin-stackaddress.c b/test/Sema/builtin-stackaddress.c index 29e4e4fa6c..5f63bb1146 100644 --- a/test/Sema/builtin-stackaddress.c +++ b/test/Sema/builtin-stackaddress.c @@ -4,7 +4,7 @@ return __builtin_return_address(0); } void b(unsigned x) { -return __builtin_return_address(x); // expected-error{{argument 0 to '__builtin_return_address' must be a constant integer}} +return __builtin_return_address(x); // expected-error{{argument to '__builtin_return_address' must be a constant integer}} } void* c(unsigned x) { @@ -12,5 +12,5 @@ return __builtin_frame_address(0); } void d(unsigned x) { -return __builtin_frame_address(x); // expected-error{{argument 0 to '__builtin_frame_address' must be a constant integer}} +return __builtin_frame_address(x); // expected-error{{argument to '__builtin_frame_address' must be a constant integer}} } diff --git a/test/Sema/builtins.c b/test/Sema/builtins.c index dbb308e4de..6fa563b311 100644 --- a/test/Sema/builtins.c +++ b/test/Sema/builtins.c @@ -60,7 +60,7 @@ void test11(int X) { break; } - __builtin_eh_return_data_regno(X); // expected-error {{argument 0 to '__builtin_eh_return_data_regno' must be a constant integer}} + __builtin_eh_return_data_regno(X); // expected-error {{argument to '__builtin_eh_return_data_regno' must be a constant integer}} } // PR5062 diff --git a/test/Sema/x86-builtin-palignr.c b/test/Sema/x86-builtin-palignr.c index 832b54b93f..bbd3a913e9 100644 --- a/test/Sema/x86-builtin-palignr.c +++ b/test/Sema/x86-builtin-palignr.c @@ -4,5 +4,5 @@ __m64 foo(__m64 a, __m64 b, int c) { - return _mm_alignr_pi8(a, b, c); // expected-error {{argument 2 to '__builtin_ia32_palignr' must be a constant integer}} + return _mm_alignr_pi8(a, b, c); // expected-error {{argument to '__builtin_ia32_palignr' must be a constant integer}} }