Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update clang-format to handle [unroll] when editing HLSL #122317

Open
farzonl opened this issue Jan 9, 2025 · 1 comment
Open

Update clang-format to handle [unroll] when editing HLSL #122317

farzonl opened this issue Jan 9, 2025 · 1 comment
Labels
clang-format HLSL HLSL Language Support

Comments

@farzonl
Copy link
Member

farzonl commented Jan 9, 2025

clang-format doesn't seem to handle [unroll], but this should probably be one of:

  [unroll]
  for (int i = 1; i < N; ++i)
    XSquaredSum += XSquared[i];

or

  [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 #121611 (comment)

@farzonl farzonl added the HLSL HLSL Language Support label Jan 9, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 9, 2025

@llvm/issue-subscribers-clang-format

Author: Farzon Lotfi (farzonl)

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 #121611 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang-format HLSL HLSL Language Support
Projects
None yet
Development

No branches or pull requests

2 participants