11 Commits

Author SHA1 Message Date
Baranov Victor
65d66625b3
[clang-tidy][NFC] run clang-format over abseil and altera checks. (#143314) 2025-06-08 23:21:35 +03:00
Rainer Orth
03dff0d4ac [clang-tidy] Disambiguate calls to log
c8644b18f570be9d26d83cdeeb2369cd3cbddaf1 <https://reviews.llvm.org/rGc8644b18f570be9d26d83cdeeb2369cd3cbddaf1>
broke the Solaris/amd64 <https://lab.llvm.org/staging/#/builders/101/builds/15078>
and Solaris/sparcv9 <https://lab.llvm.org/staging/#/builders/50/builds/15116> buildbots:

  FAILED: tools/clang/tools/extra/clang-tidy/altera/CMakeFiles/obj.clangTidyAlteraModule.dir/UnrollLoopsCheck.cpp.o
  [...]
  /vol/llvm/src/llvm-project/dist/clang-tools-extra/clang-tidy/altera/UnrollLoopsCheck.cpp:217:25: error: call to 'log' is ambiguous
    217 |       Iterations = 1 + (log(EndValue) - log(InitValue)) / log(ConstantValue);
        |                         ^~~
  /usr/include/iso/math_iso.h:60:15: note: candidate function
     60 | extern double log __P((double));
        |               ^
  /usr/include/iso/math_iso.h:158:15: note: candidate function
    158 |         inline float log(float __X) { return __logf(__X); }
        |                      ^
  /usr/include/iso/math_iso.h:193:21: note: candidate function
    193 |         inline long double log(long double __X) { return __logl(__X); }
        |                            ^

Fixed by disambituating the calls with `double` casts.

Tested on `amd64-pc-solaris2.11` and `x86_64-pc-linux-gnu`.

Differential Revision: https://reviews.llvm.org/D158959
2023-08-27 21:15:43 +02:00
Piotr Zegar
cbdc3e1bf9 [clang-tidy][NFC] Fix cppcoreguidelines-init-variables findings
Fix issues found by clang-tidy in clang-tidy source directory.
2023-08-27 11:59:03 +00:00
Piotr Zegar
9f8220969c [clang-tidy][NFC] Fix clang-analyzer-core.UndefinedBinaryOperatorResult findings
Fix issues found by clang-tidy in clang-tidy source directory.
2023-08-27 11:59:03 +00:00
Piotr Zegar
24a7587b79 [clang-tidy][NFC] Fix readability-make-member-function-const findings
Fix issues found by clang-tidy in clang-tidy source directory.
2023-08-27 08:52:11 +00:00
Piotr Zegar
c8644b18f5 [clang-tidy][NFC] Fix modernize-deprecated-headers findings
Fix issues found by clang-tidy in clang-tidy source directory.
2023-08-27 08:52:10 +00:00
Nathan James
df0c8f2514
[clang-tidy][NFC] Remove redundant allOf matcher calls
Remove calls to the `allOf` matcher in all matchers that are derived from the `VariadicDynCastAllOfMatcher`.
2023-04-11 00:38:37 +01:00
Carlos Galvez
7d2ea6c422 [clang-tidy][NFC] Use C++17 nested namespaces in the clang-tidy folder
Fix applied by running:

run-clang-tidy.py -checks=-*,modernize-concat-nested-namespaces

Differential Revision: https://reviews.llvm.org/D141770
2023-01-14 18:51:39 +00:00
Salman Javed
ade0662c51 [clang-tidy] Fix lint warnings in clang-tidy source code (NFC)
Run clang-tidy on all source files under `clang-tools-extra/clang-tidy`
with `-header-filter=clang-tidy.*` and make suggested corrections.

Differential Revision: https://reviews.llvm.org/D112864
2021-11-02 20:14:25 +13:00
Simon Pilgrim
7674bd4d44 [clang-tidy] Merges separate isa<>/assert/unreachable/dyn_cast<>/cast<> calls
We can directly use cast<> instead of separate dyn_cast<> with assertions as cast<> will perform this for us.

Similarly we can replace a if(isa<>)+cast<>/dyn_cast<> with if(dyn_cast<>)
2021-09-29 16:35:29 +01:00
Frank Derry Wanye
5a87f81fe9 new altera unroll loops check
This lint check is a part of the FLOCL (FPGA Linters for OpenCL)
project out of the Synergy Lab at Virginia Tech.

FLOCL is a set of lint checks aimed at FPGA developers who write code
in OpenCL.

The altera unroll loops check finds inner loops that have not been
unrolled, as well as fully-unrolled loops that should be partially
unrolled due to unknown loop bounds or a large number of loop
iterations.

Based on the Altera SDK for OpenCL: Best Practices Guide.
2021-03-22 13:09:53 -04:00