[clang] cd2f65b - Correct some confused diagnostic terminology

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 4 12:54:25 PST 2021


Author: Aaron Ballman
Date: 2021-02-04T15:52:07-05:00
New Revision: cd2f65b71a4239dcb5a4bcfe25da32a9ac9620cb

URL: https://github.com/llvm/llvm-project/commit/cd2f65b71a4239dcb5a4bcfe25da32a9ac9620cb
DIFF: https://github.com/llvm/llvm-project/commit/cd2f65b71a4239dcb5a4bcfe25da32a9ac9620cb.diff

LOG: Correct some confused diagnostic terminology

Attributes accept arguments, not parameters, so we should report that
the duplicate attribute arguments don't match.

Added: 
    

Modified: 
    clang/include/clang/Basic/DiagnosticSemaKinds.td
    clang/test/Sema/attr-min-vector-width.c
    clang/test/SemaOpenCL/invalid-kernel-attrs.cl

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 61e8f7f28f1c..3ec38a2858ea 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -9621,7 +9621,7 @@ def warn_duplicate_attribute_exact : Warning<
   "attribute %0 is already applied">, InGroup<IgnoredAttributes>;
 
 def warn_duplicate_attribute : Warning<
-  "attribute %0 is already applied with 
diff erent parameters">,
+  "attribute %0 is already applied with 
diff erent arguments">,
   InGroup<IgnoredAttributes>;
 
 def warn_sync_fetch_and_nand_semantics_change : Warning<

diff  --git a/clang/test/Sema/attr-min-vector-width.c b/clang/test/Sema/attr-min-vector-width.c
index 0e6f84a672f2..0ba2975d6a9f 100644
--- a/clang/test/Sema/attr-min-vector-width.c
+++ b/clang/test/Sema/attr-min-vector-width.c
@@ -5,7 +5,7 @@ void f(void) __attribute__((__min_vector_width__(i))); /* expected-error {{'__mi
 
 void f2(void) __attribute__((__min_vector_width__(128)));
 
-void f3(void) __attribute__((__min_vector_width__(128), __min_vector_width__(256))); /* expected-warning {{attribute '__min_vector_width__' is already applied with 
diff erent parameters}} */
+void f3(void) __attribute__((__min_vector_width__(128), __min_vector_width__(256))); /* expected-warning {{attribute '__min_vector_width__' is already applied with 
diff erent arguments}} */
 
 void f4(void) __attribute__((__min_vector_width__())); /* expected-error {{'__min_vector_width__' attribute takes one argument}} */
 

diff  --git a/clang/test/SemaOpenCL/invalid-kernel-attrs.cl b/clang/test/SemaOpenCL/invalid-kernel-attrs.cl
index daa8fa07f68d..0883379601ef 100644
--- a/clang/test/SemaOpenCL/invalid-kernel-attrs.cl
+++ b/clang/test/SemaOpenCL/invalid-kernel-attrs.cl
@@ -8,11 +8,11 @@ kernel __attribute__((vec_type_hint(void))) void kernel3() {} //expected-error{{
 
 kernel __attribute__((vec_type_hint(bool))) void kernel4() {} //expected-error{{a non-vector or non-vectorizable scalar type is an invalid argument to attribute 'vec_type_hint'}}
 
-kernel __attribute__((vec_type_hint(int))) __attribute__((vec_type_hint(float))) void kernel5() {} //expected-warning{{attribute 'vec_type_hint' is already applied with 
diff erent parameters}}
+kernel __attribute__((vec_type_hint(int))) __attribute__((vec_type_hint(float))) void kernel5() {} //expected-warning{{attribute 'vec_type_hint' is already applied with 
diff erent arguments}}
 
 kernel __attribute__((work_group_size_hint(8,16,32,4))) void kernel6() {} //expected-error{{'work_group_size_hint' attribute requires exactly 3 arguments}}
 
-kernel __attribute__((work_group_size_hint(1,2,3))) __attribute__((work_group_size_hint(3,2,1))) void kernel7() {}  //expected-warning{{attribute 'work_group_size_hint' is already applied with 
diff erent parameters}}
+kernel __attribute__((work_group_size_hint(1,2,3))) __attribute__((work_group_size_hint(3,2,1))) void kernel7() {}  //expected-warning{{attribute 'work_group_size_hint' is already applied with 
diff erent arguments}}
 
 __attribute__((reqd_work_group_size(8,16,32))) void kernel8(){} // expected-error {{attribute 'reqd_work_group_size' can only be applied to an OpenCL kernel}}
 
@@ -36,7 +36,7 @@ kernel __attribute__((reqd_work_group_size(0,1,2))) void kernel13(){} // expecte
 
 __attribute__((intel_reqd_sub_group_size(8))) void kernel14(){} // expected-error {{attribute 'intel_reqd_sub_group_size' can only be applied to an OpenCL kernel}}
 kernel __attribute__((intel_reqd_sub_group_size(0))) void kernel15(){} // expected-error {{'intel_reqd_sub_group_size' attribute must be greater than 0}}
-kernel __attribute__((intel_reqd_sub_group_size(8))) __attribute__((intel_reqd_sub_group_size(16))) void kernel16() {}  //expected-warning{{attribute 'intel_reqd_sub_group_size' is already applied with 
diff erent parameters}}
+kernel __attribute__((intel_reqd_sub_group_size(8))) __attribute__((intel_reqd_sub_group_size(16))) void kernel16() {}  //expected-warning{{attribute 'intel_reqd_sub_group_size' is already applied with 
diff erent arguments}}
 
 __kernel __attribute__((work_group_size_hint(8,-16,32))) void neg1() {} //expected-error{{'work_group_size_hint' attribute requires a non-negative integral compile time constant expression}}
 __kernel __attribute__((reqd_work_group_size(8,16,-32))) void neg2(){} // expected-error{{'reqd_work_group_size' attribute requires a non-negative integral compile time constant expression}}


        


More information about the cfe-commits mailing list