<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/83348>83348</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[HLSL] Handle HLSL semantic attribute syntax in clang-format
</td>
</tr>
<tr>
<th>Labels</th>
<td>
HLSL
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
bogner
</td>
</tr>
</table>
<pre>
HLSL semantics, like SV_GroupIndex below, are delineated by a colon and aren't recognized by clang-format. This can cause line breaking to be funny when this shows up on a long line, for example:
```hlsl
void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
bbbbbbbbbbbbbbbbbbbbbbb
: SV_GroupIndex) {}
```
here clang-format breaks up the variable name and the semantic for some reason.
We should update clang-format to handle these constructs for HLSL. This may mean we need to add HLSL as an explicitly recognized language, or it may be possible with out that, I'm not sure.
AC:
- clang-format formats HLSL semantics reasonably
- test cases showing what clang-format does for a variety of cases involving HLSL semantics
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycU8GO2zYQ_RrqMliDpuyV9qCDk4WbALmlaI_FUBxLbCjSIIe21a8vKLnoqugphAAC4rw3894jMSU7eKJOHD-J43uFmccQOx0GT7HSwczdl2_fv0GiCT3bPgn1GZz9QfD9tz9-iSFfv3pDD9Dkwr2cYSQw5KwnZDKgZ0Dogwse0Jty6oVqGCL1YfD2r7Wkd-iHl0uIE_IOfh1tgh499JgTQeECHQl_WD8AB9AEl-z9DPeRPHCpTmO4J8hXKH3ABT8ssDLQJUSgB05XR6I-CXkSr3L9RpeckKdbsAbwZ5dQrZAn0P-_yhEAiPq09UuoNxDNJ9G8fxxIyNNIkTZ2rMoXbTwS3DBa1I7A40SLpeXvP-ksYlOYCCJhCn5X2OXpdyoGZWcgXw3yfxpwgBG9cVSoEkEffOKYe04LXYn_mcmEM0yEHu4EnsgUKBqzlAAmQA_0uDrbW3bzx4hLu4zDkkeIYHmh0gTXkJItcu6WRwiZgUfkUvZVqGYCHxhSjvQUcvq8RviyVbBuCbY39ekBajcvEKbE0GOi9bqUy3QfkbdUJtAqGxeriWcIlyfK-ltwt4LbNqpMV5u3-g0r6vaNfNsf2_ZVVmNHjWpMo2pT00XJRrbHQ6_7Sy0N4Z4uurKdkuoglWqVUnspd4St1hfd6ld83cs9iYOkCa3bOXebdiEOlU0pU9fW9aGtHGpyaXm6SpWZhFLlEceulL_oPCRxkM4mTv8SsGW3PPcFcHyHL2v4G02AzNHqzARp9owPsH5jVJWj60bmayqJqLNQ58HymPWuD5NQ59Luub1cY_iTehbqvAyfhDov8_8dAAD__1zUhD8">