[all-commits] [llvm/llvm-project] c6d195: clang-tidy altera-id-dependent-backward-branch: pr...

Egor Suvorov via All-commits all-commits at lists.llvm.org
Sun Mar 5 08:07:13 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c6d195b366c8256184ff40c5e46339eed96b4a81
      https://github.com/llvm/llvm-project/commit/c6d195b366c8256184ff40c5e46339eed96b4a81
  Author: Egor Suvorov <egor.suvorov at gmail.com>
  Date:   2023-03-05 (Sun, 05 Mar 2023)

  Changed paths:
    M clang-tools-extra/clang-tidy/altera/IdDependentBackwardBranchCheck.cpp
    M clang-tools-extra/test/clang-tidy/checkers/altera/id-dependent-backward-branch.cpp

  Log Message:
  -----------
  clang-tidy altera-id-dependent-backward-branch: print notes after warning

In Clang notes are typically printed after a corresponding warning, not before.
For example, all notes issued before the first warning are ignored.

Running `clang-tidy --checks=-*,altera-id-dependent-backward-branch a.cpp` on the following code:
```
long get_local_id(int);
void error() {
  int ThreadID = get_local_id(0);
  for (int i = 0; i < ThreadID; i++) {
  }
  for (int i = 0; i < ThreadID; i++) {
  }
}
```
results in two warnings and a single note in between.

Reviewed By: carlosgalvezp

Differential Revision: https://reviews.llvm.org/D145303




More information about the All-commits mailing list