[all-commits] [llvm/llvm-project] b43a2a: [clang-tidy] Suppress readability-static-access-th...

Carlos Galvez via All-commits all-commits at lists.llvm.org
Mon Oct 25 22:46:08 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b43a2aee4ee946d8897880e824f4b09fe4c46143
      https://github.com/llvm/llvm-project/commit/b43a2aee4ee946d8897880e824f4b09fe4c46143
  Author: Carlos Galvez <carlosgalvezp at gmail.com>
  Date:   2021-10-26 (Tue, 26 Oct 2021)

  Changed paths:
    M clang-tools-extra/clang-tidy/readability/StaticAccessedThroughInstanceCheck.cpp
    A clang-tools-extra/test/clang-tidy/checkers/Inputs/readability-static-accessed-through-instance/__clang_cuda_builtin_vars.h
    M clang-tools-extra/test/clang-tidy/checkers/readability-static-accessed-through-instance.cpp

  Log Message:
  -----------
  [clang-tidy] Suppress readability-static-access-through-instance for CUDA built-in variables

clang-tidy can be used to statically analyze CUDA code,
thanks to clang being able to compile CUDA code natively.
This makes clang-tidy the one and only open-source
static analyzer for CUDA.

However it currently warns for native CUDA built-in
variables, like threadIdx, due to the way they
are implemented in clang.

Users don't need to know the details of the clang
implementation, and they should continue to write
idiomatic code. Therefore, suppress the warning
if a CUDA built-in variable is encountered.

Fixes https://bugs.llvm.org/show_bug.cgi?id=48758




More information about the All-commits mailing list