Skip to content

Commit 50b81c3

Browse files
authored
[SYCL] Reword some compiler diagnostics to be more consistent. (#2924)
Diagnostics in Clang do not start with a capital letter or contain terminating punctuation. Aside from rewording, this is an NFC change.
1 parent 3ec4594 commit 50b81c3

File tree

5 files changed

+38
-40
lines changed

5 files changed

+38
-40
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -130,23 +130,25 @@ def err_intel_fpga_memory_arg_invalid : Error<
130130
def err_intel_fpga_merge_dir_invalid : Error<
131131
"merge direction must be 'depth' or 'width'">;
132132
def err_intel_fpga_reg_limitations : Error <
133-
"Illegal %select{argument of type %1 |field in argument}0 to __builtin_intel_fpga_reg.">;
133+
"illegal %select{argument of type %1 |field in argument}0 to "
134+
"__builtin_intel_fpga_reg">;
134135
def illegal_type_declared_here : Note<
135-
"Field with illegal type declared here">;
136+
"field with illegal type declared here">;
136137
def err_sycl_loop_attr_duplication : Error<
137138
"duplicate %select{unroll|Intel FPGA}0 loop attribute '%1'">;
138139
def err_loop_unroll_compatibility : Error<
139140
"incompatible loop unroll instructions: '%0' and '%1'">;
140141
def err_pipe_attribute_arg_not_allowed : Error<
141-
"'%0' mode for pipe attribute is not supported. Allowed modes: 'read_only', 'write_only'">;
142+
"'%0' mode for pipe attribute is not supported; allowed modes are "
143+
"'read_only' and 'write_only'">;
142144
def err_bankbits_numbanks_conflicting : Error<
143145
"the number of bank_bits must be equal to ceil(log2(numbanks))">;
144146
def err_bankbits_non_consecutive : Error<
145147
"bank_bits must be consecutive">;
146148
def err_intel_fpga_mem_limitations
147149
: Error<
148150
"illegal %select{pointer argument of type %1 |field in type pointed "
149-
"to by pointer argument}0 to __builtin_intel_fpga_mem. Only pointers "
151+
"to by pointer argument}0 to __builtin_intel_fpga_mem; only pointers "
150152
"to a first class lvalue or to an rvalue are allowed">;
151153
def err_intel_fpga_mem_arg_mismatch
152154
: Error<"builtin parameter must be %select{"
@@ -2848,12 +2850,12 @@ def err_attribute_wrong_number_arguments : Error<
28482850
def err_attribute_too_many_arguments : Error<
28492851
"%0 attribute takes no more than %1 argument%s1">;
28502852
def warn_attribute_too_many_arguments : Warning<
2851-
"%0 attribute takes no more than %1 argument%s1 - attribute ignored">,
2853+
"%0 attribute takes no more than %1 argument%s1; attribute ignored">,
28522854
InGroup<IgnoredAttributes>;
28532855
def err_attribute_too_few_arguments : Error<
28542856
"%0 attribute takes at least %1 argument%s1">;
28552857
def warn_attribute_too_few_arguments : Warning<
2856-
"%0 attribute takes at least %1 argument%s1 - attribute ignored">,
2858+
"%0 attribute takes at least %1 argument%s1; attribute ignored">,
28572859
InGroup<IgnoredAttributes>;
28582860
def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">;
28592861
def err_attribute_invalid_matrix_type : Error<"invalid matrix element type %0">;
@@ -2870,10 +2872,6 @@ def err_attribute_arm_feature_sve_bits_unsupported : Error<
28702872
def err_attribute_requires_positive_integer : Error<
28712873
"%0 attribute requires a %select{positive|non-negative}1 "
28722874
"integral compile time constant expression">;
2873-
def warn_attribute_requires_positive_integer : Warning<
2874-
"%0 attribute requires a %select{positive|non-negative}1 "
2875-
"integral compile time constant expression - attribute ignored">,
2876-
InGroup<IgnoredAttributes>;
28772875
def err_attribute_requires_opencl_version : Error<
28782876
"%0 attribute requires OpenCL version %1%select{| or above}2">;
28792877
def err_invalid_branch_protection_spec : Error<
@@ -11192,12 +11190,12 @@ def warn_sycl_restrict_recursion
1119211190
: Warning<"SYCL kernel cannot call a recursive function">,
1119311191
InGroup<SyclStrict>, DefaultError;
1119411192
def err_ivdep_duplicate_arg : Error<
11195-
"duplicate argument to 'ivdep'. attribute requires one or both of a safelen "
11193+
"duplicate argument to 'ivdep'; attribute requires one or both of a safelen "
1119611194
"and array">;
1119711195
def err_ivdep_unknown_arg : Error<
11198-
"unknown argument to 'ivdep'. Expected integer or array variable">;
11196+
"unknown argument to 'ivdep'; expected integer or array variable">;
1119911197
def err_ivdep_declrefexpr_arg : Error<
11200-
"invalid declaration reference argument to 'ivdep'. Expected integer or array"
11198+
"invalid declaration reference argument to 'ivdep'; expected integer or array"
1120111199
" variable">;
1120211200
def warn_ivdep_redundant : Warning <"ignoring redundant Intel FPGA loop "
1120311201
"attribute 'ivdep': safelen %select{INF|%1}0 >= safelen %select{INF|%3}2">,

clang/test/SemaSYCL/fpga_pipes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ using type1 = __attribute__((pipe("read_only"))) const int;
66
// no error expected
77
using type2 = __attribute__((pipe("write_only"))) const int;
88

9-
// expected-error@+1 {{'42' mode for pipe attribute is not supported. Allowed modes: 'read_only', 'write_only'}}
9+
// expected-error@+1 {{'42' mode for pipe attribute is not supported; allowed modes are 'read_only' and 'write_only'}}
1010
using type3 = __attribute__((pipe("42"))) const int;
1111

1212
// expected-error@+1{{'pipe' attribute requires a string}}

clang/test/SemaSYCL/intel-fpga-loops.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -72,51 +72,51 @@ void foo_deprecated() {
7272
void boo() {
7373
int a[10];
7474
int b[10];
75-
// expected-error@+1 {{duplicate argument to 'ivdep'. attribute requires one or both of a safelen and array}}
75+
// expected-error@+1 {{duplicate argument to 'ivdep'; attribute requires one or both of a safelen and array}}
7676
[[intel::ivdep(2, 2)]] for (int i = 0; i != 10; ++i)
7777
a[i] = 0;
78-
// expected-warning@+1 {{'ii' attribute takes at least 1 argument - attribute ignored}}
78+
// expected-warning@+1 {{'ii' attribute takes at least 1 argument; attribute ignored}}
7979
[[intel::ii]] for (int i = 0; i != 10; ++i)
8080
a[i] = 0;
81-
// expected-warning@+1 {{'ii' attribute takes no more than 1 argument - attribute ignored}}
81+
// expected-warning@+1 {{'ii' attribute takes no more than 1 argument; attribute ignored}}
8282
[[intel::ii(2, 2)]] for (int i = 0; i != 10; ++i)
8383
a[i] = 0;
84-
// expected-warning@+1 {{'max_concurrency' attribute takes at least 1 argument - attribute ignored}}
84+
// expected-warning@+1 {{'max_concurrency' attribute takes at least 1 argument; attribute ignored}}
8585
[[intel::max_concurrency]] for (int i = 0; i != 10; ++i)
8686
a[i] = 0;
87-
// expected-warning@+1 {{'max_concurrency' attribute takes no more than 1 argument - attribute ignored}}
87+
// expected-warning@+1 {{'max_concurrency' attribute takes no more than 1 argument; attribute ignored}}
8888
[[intel::max_concurrency(2, 2)]] for (int i = 0; i != 10; ++i)
8989
a[i] = 0;
9090

91-
// expected-error@+1 {{duplicate argument to 'ivdep'. attribute requires one or both of a safelen and array}}
91+
// expected-error@+1 {{duplicate argument to 'ivdep'; attribute requires one or both of a safelen and array}}
9292
[[intel::ivdep(2, 3)]] for (int i = 0; i != 10; ++i)
9393
a[i] = 0;
94-
// expected-error@+1 {{duplicate argument to 'ivdep'. attribute requires one or both of a safelen and array}}
94+
// expected-error@+1 {{duplicate argument to 'ivdep'; attribute requires one or both of a safelen and array}}
9595
[[intel::ivdep(a, b)]] for (int i = 0; i != 10; ++i)
9696
a[i] = 0;
97-
// expected-error@+1 {{unknown argument to 'ivdep'. Expected integer or array variable}}
97+
// expected-error@+1 {{unknown argument to 'ivdep'; expected integer or array variable}}
9898
[[intel::ivdep(2, 3.0)]] for (int i = 0; i != 10; ++i)
9999
a[i] = 0;
100100

101-
// expected-warning@+1 {{'disable_loop_pipelining' attribute takes no more than 0 arguments - attribute ignored}}
101+
// expected-warning@+1 {{'disable_loop_pipelining' attribute takes no more than 0 arguments; attribute ignored}}
102102
[[intel::disable_loop_pipelining(0)]] for (int i = 0; i != 10; ++i)
103103
a[i] = 0;
104-
// expected-warning@+1 {{'loop_coalesce' attribute takes no more than 1 argument - attribute ignored}}
104+
// expected-warning@+1 {{'loop_coalesce' attribute takes no more than 1 argument; attribute ignored}}
105105
[[intel::loop_coalesce(2, 3)]] for (int i = 0; i != 10; ++i)
106106
a[i] = 0;
107-
// expected-warning@+1 {{'max_interleaving' attribute takes at least 1 argument - attribute ignored}}
107+
// expected-warning@+1 {{'max_interleaving' attribute takes at least 1 argument; attribute ignored}}
108108
[[intel::max_interleaving]] for (int i = 0; i != 10; ++i)
109109
a[i] = 0;
110-
// expected-warning@+1 {{'max_interleaving' attribute takes no more than 1 argument - attribute ignored}}
110+
// expected-warning@+1 {{'max_interleaving' attribute takes no more than 1 argument; attribute ignored}}
111111
[[intel::max_interleaving(2, 4)]] for (int i = 0; i != 10; ++i)
112112
a[i] = 0;
113-
// expected-warning@+1 {{'speculated_iterations' attribute takes at least 1 argument - attribute ignored}}
113+
// expected-warning@+1 {{'speculated_iterations' attribute takes at least 1 argument; attribute ignored}}
114114
[[intel::speculated_iterations]] for (int i = 0; i != 10; ++i)
115115
a[i] = 0;
116-
// expected-warning@+1 {{'speculated_iterations' attribute takes no more than 1 argument - attribute ignored}}
116+
// expected-warning@+1 {{'speculated_iterations' attribute takes no more than 1 argument; attribute ignored}}
117117
[[intel::speculated_iterations(1, 2)]] for (int i = 0; i != 10; ++i)
118118
a[i] = 0;
119-
// expected-warning@+1 {{'nofusion' attribute takes no more than 0 arguments - attribute ignored}}
119+
// expected-warning@+1 {{'nofusion' attribute takes no more than 0 arguments; attribute ignored}}
120120
[[intel::nofusion(0)]] for (int i = 0; i != 10; ++i)
121121
a[i] = 0;
122122
}
@@ -148,7 +148,7 @@ void goo() {
148148
// expected-error@+1 {{'speculated_iterations' attribute requires a non-negative integral compile time constant expression}}
149149
[[intel::speculated_iterations(-1)]] for (int i = 0; i != 10; ++i)
150150
a[i] = 0;
151-
// expected-error@+1 {{unknown argument to 'ivdep'. Expected integer or array variable}}
151+
// expected-error@+1 {{unknown argument to 'ivdep'; expected integer or array variable}}
152152
[[intel::ivdep("test123")]] for (int i = 0; i != 10; ++i)
153153
a[i] = 0;
154154
// expected-error@+1 {{'ii' attribute requires an integer constant}}
@@ -166,7 +166,7 @@ void goo() {
166166
// expected-error@+1 {{'speculated_iterations' attribute requires an integer constant}}
167167
[[intel::speculated_iterations("test123")]] for (int i = 0; i != 10; ++i)
168168
a[i] = 0;
169-
// expected-error@+1 {{unknown argument to 'ivdep'. Expected integer or array variable}}
169+
// expected-error@+1 {{unknown argument to 'ivdep'; expected integer or array variable}}
170170
[[intel::ivdep("test123")]] for (int i = 0; i != 10; ++i)
171171
a[i] = 0;
172172
// no diagnostics are expected

clang/test/SemaSYCL/intel-fpga-mem-builtin.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ struct State {
1212
};
1313

1414
struct inner {
15-
void (*fp)(); // expected-note {{Field with illegal type declared here}}
15+
void (*fp)(); // expected-note {{field with illegal type declared here}}
1616
};
1717

1818
struct outer {
@@ -37,22 +37,22 @@ void foo(float *A, int *B, State *C) {
3737
z = __builtin_intel_fpga_mem(C, i, 0);
3838
// expected-error@-1{{argument to '__builtin_intel_fpga_mem' must be a constant integer}}
3939
z = __builtin_intel_fpga_mem(U, 0, 0);
40-
// expected-error@-1{{illegal pointer argument of type 'void *' to __builtin_intel_fpga_mem. Only pointers to a first class lvalue or to an rvalue are allowed}}
40+
// expected-error@-1{{illegal pointer argument of type 'void *' to __builtin_intel_fpga_mem; only pointers to a first class lvalue or to an rvalue are allowed}}
4141

4242
int intArr[10] = {0};
4343
int *k1 = __builtin_intel_fpga_mem(intArr, 0, 0);
4444
// expected-error@-1{{builtin parameter must be a pointer}}
4545

4646
int **k2 = __builtin_intel_fpga_mem(&intArr, 0, 0);
47-
// expected-error@-1{{illegal pointer argument of type 'int (*)[10]' to __builtin_intel_fpga_mem. Only pointers to a first class lvalue or to an rvalue are allowed}}
47+
// expected-error@-1{{illegal pointer argument of type 'int (*)[10]' to __builtin_intel_fpga_mem; only pointers to a first class lvalue or to an rvalue are allowed}}
4848

4949
void (*fp1)();
5050
void (*fp2)() = __builtin_intel_fpga_mem(fp1, 0, 0);
51-
// expected-error@-1{{illegal pointer argument of type 'void (*)()' to __builtin_intel_fpga_mem. Only pointers to a first class lvalue or to an rvalue are allowed}}
51+
// expected-error@-1{{illegal pointer argument of type 'void (*)()' to __builtin_intel_fpga_mem; only pointers to a first class lvalue or to an rvalue are allowed}}
5252

5353
struct outer *iii;
5454
struct outer *iv = __builtin_intel_fpga_mem(iii, 0, 0);
55-
// expected-error@-1{{illegal field in type pointed to by pointer argument to __builtin_intel_fpga_mem. Only pointers to a first class lvalue or to an rvalue are allowed}}
55+
// expected-error@-1{{illegal field in type pointed to by pointer argument to __builtin_intel_fpga_mem; only pointers to a first class lvalue or to an rvalue are allowed}}
5656
}
5757

5858
template <typename name, typename Func>

clang/test/SemaSYCL/intel-fpga-reg.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct st {
1919
static_assert(__has_builtin(__builtin_intel_fpga_reg), "");
2020

2121
struct inner {
22-
void (*fp)(); // expected-note {{Field with illegal type declared here}}
22+
void (*fp)(); // expected-note {{field with illegal type declared here}}
2323
};
2424

2525
struct outer {
@@ -42,14 +42,14 @@ void foo() {
4242
int *bp = __builtin_intel_fpga_reg(ap);
4343
int intArr[10] = {0};
4444
int *k = __builtin_intel_fpga_reg(intArr);
45-
// expected-error@-1{{Illegal argument of type 'int [10]' to __builtin_intel_fpga_reg}}
45+
// expected-error@-1{{illegal argument of type 'int [10]' to __builtin_intel_fpga_reg}}
4646

4747
void (*fp1)();
4848
void (*fp2)() = __builtin_intel_fpga_reg(fp1);
49-
//expected-error@-1{{Illegal argument of type 'void (*)()' to __builtin_intel_fpga_reg.}}
49+
//expected-error@-1{{illegal argument of type 'void (*)()' to __builtin_intel_fpga_reg}}
5050
struct outer iii;
5151
struct outer iv = __builtin_intel_fpga_reg(iii);
52-
//expected-error@-1{{Illegal field in argument to __builtin_intel_fpga_reg}}
52+
//expected-error@-1{{illegal field in argument to __builtin_intel_fpga_reg}}
5353
void *vp = __builtin_intel_fpga_reg();
5454
// expected-error@-1{{too few arguments to function call, expected 1, have 0}}
5555
int tmp = __builtin_intel_fpga_reg(1, 2);

0 commit comments

Comments
 (0)