[cfe-commits] r101795 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaChecking.cpp test/Sema/builtin-prefetch.c test/Sema/builtin-stackaddress.c test/Sema/builtins.c test/Sema/x86-builtin-palignr.c

Eric Christopher echristo at apple.com
Mon Apr 19 11:23:02 PDT 2010


Author: echristo
Date: Mon Apr 19 13:23:02 2010
New Revision: 101795

URL: http://llvm.org/viewvc/llvm-project?rev=101795&view=rev
Log:
Remove the argument number from the constant integer diagnostic.
Update all of the testcases accordingly.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/trunk/lib/Sema/SemaChecking.cpp
    cfe/trunk/test/Sema/builtin-prefetch.c
    cfe/trunk/test/Sema/builtin-stackaddress.c
    cfe/trunk/test/Sema/builtins.c
    cfe/trunk/test/Sema/x86-builtin-palignr.c

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=101795&r1=101794&r2=101795&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Mon Apr 19 13:23:02 2010
@@ -2864,7 +2864,7 @@
   "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">;

Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=101795&r1=101794&r2=101795&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Mon Apr 19 13:23:02 2010
@@ -743,7 +743,7 @@
   
   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;
 }

Modified: cfe/trunk/test/Sema/builtin-prefetch.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/builtin-prefetch.c?rev=101795&r1=101794&r2=101795&view=diff
==============================================================================
--- cfe/trunk/test/Sema/builtin-prefetch.c (original)
+++ cfe/trunk/test/Sema/builtin-prefetch.c Mon Apr 19 13:23:02 2010
@@ -6,8 +6,8 @@
   __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}}

Modified: cfe/trunk/test/Sema/builtin-stackaddress.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/builtin-stackaddress.c?rev=101795&r1=101794&r2=101795&view=diff
==============================================================================
--- cfe/trunk/test/Sema/builtin-stackaddress.c (original)
+++ cfe/trunk/test/Sema/builtin-stackaddress.c Mon Apr 19 13:23:02 2010
@@ -4,7 +4,7 @@
 }
 
 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 @@
 }
 
 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}}
 }

Modified: cfe/trunk/test/Sema/builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/builtins.c?rev=101795&r1=101794&r2=101795&view=diff
==============================================================================
--- cfe/trunk/test/Sema/builtins.c (original)
+++ cfe/trunk/test/Sema/builtins.c Mon Apr 19 13:23:02 2010
@@ -60,7 +60,7 @@
     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

Modified: cfe/trunk/test/Sema/x86-builtin-palignr.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/x86-builtin-palignr.c?rev=101795&r1=101794&r2=101795&view=diff
==============================================================================
--- cfe/trunk/test/Sema/x86-builtin-palignr.c (original)
+++ cfe/trunk/test/Sema/x86-builtin-palignr.c Mon Apr 19 13:23:02 2010
@@ -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}}
 }





More information about the cfe-commits mailing list