Skip to content

Commit c93ecf3

Browse files
committed
Added comments to address @spall's feedback and clang-format
1 parent 7620f9f commit c93ecf3

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12707,9 +12707,10 @@ def err_hlsl_param_qualifier_mismatch :
1270712707
def err_hlsl_vector_compound_assignment_truncation : Error<
1270812708
"left hand operand of type %0 to compound assignment cannot be truncated "
1270912709
"when used with right hand operand of type %1">;
12710-
def err_hlsl_builtin_scalar_vector_mismatch : Error<
12711-
"%select{all|second and third}0 arguments to %1 must be of scalar or "
12712-
"vector type with matching scalar element type%diff{: $ vs $|}2,3">;
12710+
def err_hlsl_builtin_scalar_vector_mismatch
12711+
: Error<
12712+
"%select{all|second and third}0 arguments to %1 must be of scalar or "
12713+
"vector type with matching scalar element type%diff{: $ vs $|}2,3">;
1271312714

1271412715
def warn_hlsl_impcast_vector_truncation : Warning<
1271512716
"implicit conversion truncates vector: %0 to %1">, InGroup<Conversion>;

clang/lib/Headers/hlsl/hlsl_detail.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ constexpr vector<T, L> reflect_vec_impl(vector<T, L> I, vector<T, L> N) {
9797
#endif
9898
}
9999

100-
template<typename T>
101-
struct is_arithmetic {
100+
template <typename T> struct is_arithmetic {
102101
static const bool Value = __is_arithmetic(T);
103102
};
104103

clang/test/SemaHLSL/BuiltIns/select-errors.hlsl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33

44
int test_select_first_arg_wrong_type(int1 p0, int t0, int f0) {
5-
return select(p0, t0, f0);
5+
return select(p0, t0, f0); // No diagnostic expected.
66
}
77

88
int1 test_select_bool_vals_diff_vecs(bool p0, int1 t0, int1 f0) {
9-
return select<int1>(p0, t0, f0);
9+
return select<int1>(p0, t0, f0); // No diagnostic expected.
1010
}
1111

1212
int2 test_select_vector_vals_not_vecs(bool2 p0, int t0,
1313
int f0) {
14-
return select(p0, t0, f0);
14+
return select(p0, t0, f0); // No diagnostic expected.
1515
}
1616

1717
int1 test_select_vector_vals_wrong_size(bool2 p0, int1 t0, int1 f0) {
@@ -51,12 +51,12 @@ int test_select_builtin_bool_incompatible_args(bool p0, int t0, double f0) {
5151

5252
// if a vector second arg isnt a vector
5353
int2 test_select_builtin_second_arg_not_vector(bool2 p0, int t0, int2 f0) {
54-
return __builtin_hlsl_select(p0, t0, f0);
54+
return __builtin_hlsl_select(p0, t0, f0); // No diagnostic expected.
5555
}
5656

5757
// if a vector third arg isn't a vector
5858
int2 test_select_builtin_second_arg_not_vector(bool2 p0, int2 t0, int f0) {
59-
return __builtin_hlsl_select(p0, t0, f0);
59+
return __builtin_hlsl_select(p0, t0, f0); // No diagnostic expected.
6060
}
6161

6262
// if vector last 2 aren't same type (so both are vectors but wrong type)

0 commit comments

Comments
 (0)