Issue 180038
Summary [Sema][HLSL] Make matrix and vector conversion warnings be enabled by `-Wmatrix-conversion` and `-Wvector-conversion` respectively
Labels clang:frontend, HLSL
Assignees Icohedron
Reporter Icohedron
    As mentioned in https://github.com/llvm/llvm-project/pull/179568#discussion_r2771255499 the matrix and vector conversion warnings are currently only enabled with `-Wconversion`. However, we instead want these warnings to be enabled by `-Wmatrix-conversion` and `-Wvector-conversion` respectively, which default to on for HLSL.

Using commit https://github.com/llvm/llvm-project/pull/179568/commits/9719d01b3fc5fb365fdc8d4aa3f2b1058a4e2b06 as a reference:

New diagnostic messages will need to be added for matrices and vectors to `DiagnosticSemaKinds.td` for the groups `InGroup<MatrixConversion>` and `InGroup<VectorConversion>`.

- `warn_impcast_matrix_float_precision`
- `warn_impcast_matrix_float_integer`
- `warn_impcast_vector_float_precision`
- `warn_impcast_vector_float_integer`

The `DiagnoseFloatingImpCast` function in `SemaChecking.cpp` will also need to be updated to take in a diagnostic ID, and the appropriate diagnostic ID should be selected based on whether or not the source type of the implicit cast is a scalar, vector, or matrix.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to