[clang] [llvm] [CUDA] [Headers] Mark getters for `threadIdx` etc. as `const` (PR #228166)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 1 10:47:33 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions h -- clang/lib/Headers/__clang_cuda_builtin_vars.h --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Headers/__clang_cuda_builtin_vars.h b/clang/lib/Headers/__clang_cuda_builtin_vars.h
index ddbe0989c..7f6b5c3b0 100644
--- a/clang/lib/Headers/__clang_cuda_builtin_vars.h
+++ b/clang/lib/Headers/__clang_cuda_builtin_vars.h
@@ -30,7 +30,8 @@ struct dim3;
#define __CUDA_DEVICE_BUILTIN(FIELD, INTRINSIC) \
__declspec(property(get = __fetch_builtin_##FIELD)) unsigned int FIELD; \
static inline __attribute__((always_inline)) __attribute__((const)) \
- __attribute__((device)) unsigned int __fetch_builtin_##FIELD(void) { \
+ __attribute__((device)) unsigned int \
+ __fetch_builtin_##FIELD(void) { \
return INTRINSIC; \
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/228166
More information about the llvm-commits
mailing list