Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7
# a5364444 12-Jan-2025 Barnabás Pőcze <pobrn@protonmail.com>

[clang-tidy] performance-unnecessary-copy-initialization: Consider static functions (#119974)

Static member functions can be considered the same way as free functions
are, so do that.


Revision tags: llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init
# 8348d720 25-Jun-2024 Clement Courbet <courbet@google.com>

[clang-tidy] Fix assert in performance-unnecessary-copy-init. (#96506)

`GetDirectCallee` can be null.

Fixes #96498.


Revision tags: llvmorg-18.1.8
# 415a82c6 10-Jun-2024 Clement Courbet <courbet@google.com>

[clang-tidy] `doesNotMutateObject`: Handle calls to member functions … (#94362)

…and operators that have non-const overloads.

This allows `unnecessary-copy-initialization` to warn on more cases.

[clang-tidy] `doesNotMutateObject`: Handle calls to member functions … (#94362)

…and operators that have non-const overloads.

This allows `unnecessary-copy-initialization` to warn on more cases.

The common case is a class with a a set of const/non-sconst overloads
(e.g. std::vector::operator[]).

```
void F() {
std::vector<Expensive> v;
// ...

const Expensive e = v[i];
}
```

show more ...


Revision tags: llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4
# 94ca854d 26-Feb-2024 Clement Courbet <courbet@google.com>

[clang-tidy] Add support for determining constness of more expressions. (#82617)

This uses a more systematic approach for determining whcich
`DeclRefExpr`s mutate the underlying object: Instead of

[clang-tidy] Add support for determining constness of more expressions. (#82617)

This uses a more systematic approach for determining whcich
`DeclRefExpr`s mutate the underlying object: Instead of using a few
matchers, we walk up the AST until we find a parent that we can prove
cannot change the underlying object.

This allows us to handle most address taking and dereference, bindings
to value and const& variables, and track constness of pointee (see
changes in DeclRefExprUtilsTest.cpp).

This allows supporting more patterns in
`performance-unnecessary-copy-initialization`.

Those two patterns are relatively common:

```
const auto e = (*vector_ptr)[i]
```

and

```
const auto e = vector_ptr->at(i);
```

In our codebase, we have around 25% additional findings from
`performance-unnecessary-copy-initialization` with this change. I did
not see any additional false positives.

show more ...


Revision tags: llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init
# 1e512688 23-Jul-2023 Shivam Gupta <Shivam.Gupta2@amd.com>

[clang-tidy] performance-* checks: Also allow allow member expressions to be used in a const manner.

Until now when determining all the const uses of a VarDecl we only considered
how the variable it

[clang-tidy] performance-* checks: Also allow allow member expressions to be used in a const manner.

Until now when determining all the const uses of a VarDecl we only considered
how the variable itself was used. This change extends checking for const usages
of the type's members as well.

This increases the number of true positives for various performance checks that
share the same const usage analysis.

Path by Felix Berger

Reviewed By: njames93, PiotrZSL

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

show more ...


Revision tags: llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3
# b4d9ac8b 21-Feb-2023 Utkarsh Saxena <usx@google.com>

[C++20][ClangTidy] Update the ClangTidy tests to also test in C++20 mode

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


Revision tags: llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6
# 89a1d03e 17-Jun-2022 Richard <legalize@xmission.com>

[clang-tidy] Organize test files into subdirectories by module (NFC)

Eliminate clutter by reorganizing the Lit test files for clang-tidy:
- Move checkers/<module>-* to checkers/<module>/*.
- Move mo

[clang-tidy] Organize test files into subdirectories by module (NFC)

Eliminate clutter by reorganizing the Lit test files for clang-tidy:
- Move checkers/<module>-* to checkers/<module>/*.
- Move module specific inputs from Inputs to <module>/Inputs. Remove
any module prefix from the file or subdirectory name as they are no
longer needed.
- Introduce a Lit substitution %clang_tidy_headers for the system
headers in checkers/Inputs/Headers and use this throughout. This
avoids referencing system headers through a relative path to the
parent directory and makes it clear that these fake system headers are
shared among all modules.
- Update add_new_check.py to follow the above conventions when creating
the boiler plate test files for a new check.
- Update Contributing.rst to describe per-module Inputs directory and
fix link to test source code.

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

show more ...