<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/122317>122317</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Update clang-format to handle `[unroll]` when editing HLSL
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
farzonl
</td>
</tr>
</table>
<pre>
clang-format doesn't seem to handle `[unroll]`, but this should probably be one of:
```c++
[unroll]
for (int i = 1; i < N; ++i)
XSquaredSum += XSquared[i];
```
or
```c++
[unroll] for (int i = 1; i < N; ++i)
XSquaredSum += XSquared[i];
```
The latter is closer to what clang-format does with `[[unroll]]` instead of `[unroll]` to trick it into seeing that as an attribute.
_Originally posted by @bogner in https://github.com/llvm/llvm-project/pull/121611#discussion_r1902242837_
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykk01v1DAQhn-Ncxl1ZY_zsTnk0O1qxaGCQ0HiVjmxkxi89mJPWi2_HjldoAWE-JCsxJ7Ib96ZZ0alZCdvTMeqHav2hVpoDrEbVfwcvCv6oM_d4JSfrsYQj4pAB5M8w4YgGXMECjArr50BVnNW7RYfg3Os2ucj3kC_ENBsE6Q5LE7DKYZe9e4MvYHgDYSRyWvG94xf5xvrGhju8lqjAC9UL7ExRGC4tZ7AApN7EEzu1u0NvM7bJwnLsL1ceX_3aVHR6LvluH6U-28hVu1s1pa7H4w8HUP8c3__YAzgP7w9Pd_OBpwiMhFsgsGFZGIm8zgrgp_owaOl-YLrRW1XaGB9IqM0hPEXSLMqRTt8BEtgPYXcBdZPQPlXKoHyoIii7Rcym-ce799EO1mvnDvDKSQyGvozsJL3YfLZuIeZ6JRyO-CB4WGyNC_9ZghHhgfnHr6-rk4xfDADMTycFucYHgSKWgiGUts0LCnZ4O-jaDliiVvZ3F8KXehO6la2qjCdaGRdlthwLOYOuR4M10Pd6LautkZu1YjYN1vRlKLFobAdcqy44K1ohChxU3HU2x6FlnXdynFgJTdHZd0mG9yEOBU2pcV0AlGKpnCqNy6tI4b4nAdDzEMXuzWxfpkSK7mzidJ3JbLkTPfupBWZlzB_N3vwOBsPRlvKdF7d3t0WS3TdX5d4zSOtRV5TeejwSwAAAP__tT5AMw">