History log of /llvm-project/clang/lib/Analysis/ExprMutationAnalyzer.cpp (Results 1 – 25 of 38)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init
# 53ea5ffc 22-Jan-2025 Congcong Cai <congcongcai0907@163.com>

[mutation analyzer] support mutation analysis for pointee (#118593)

This patch wants to add mutation analyzer for pointee object.


# eb7dea8b 17-Jan-2025 Congcong Cai <congcongcai0907@163.com>

[mutation analyzer] enhance stability for `hasAnyInit` matcher (#122915)

I cannot minimal produce it, but when I run clangd with
`misc-const-correctness` check in a big project
clangd crashed due to

[mutation analyzer] enhance stability for `hasAnyInit` matcher (#122915)

I cannot minimal produce it, but when I run clangd with
`misc-const-correctness` check in a big project
clangd crashed due to deref nullptr here.
clang may pass a nullptr to `InitExprs` when meets some error cases.

show more ...


Revision tags: llvmorg-19.1.7, llvmorg-19.1.6
# f98c9a9b 05-Dec-2024 Congcong Cai <congcongcai0907@163.com>

[mutation analyzer][NFC] combine `ConditionalOperator` `BinaryConditionalOperator` (#118602)


Revision tags: llvmorg-19.1.5
# ae20dbdd 24-Nov-2024 Congcong Cai <congcongcai0907@163.com>

[clang][analysis] refactor the unevaluated api (#117474)

It is hard to understand for `ExprMutationAnalyzer::isUnevaluated` to
accept 2 Stmt as parameters.
This patch wants to redesign the API to ac

[clang][analysis] refactor the unevaluated api (#117474)

It is hard to understand for `ExprMutationAnalyzer::isUnevaluated` to
accept 2 Stmt as parameters.
This patch wants to redesign the API to accept only 1 Stmt. Now it will
only check whether stmt is a sub-stmt of an unevaluated stmt.

show more ...


# 68a48ec9 24-Nov-2024 Congcong Cai <congcongcai0907@163.com>

[clang][analysis][NFC]place the comment to correct position (#117467)


Revision tags: llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2
# 28733ed6 03-Oct-2024 Kazu Hirata <kazu@google.com>

[Analysis] Avoid repeated hash lookups (NFC) (#110949)


Revision tags: 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
# 1ce89899 18-Jul-2024 Dmitry Polukhin <34227995+dmpolukhin@users.noreply.github.com>

[clang-tidy] Fix false in unnecessary-value-param inside templates (#98488)

Summary:
If callExpr is type dependent, there is no way to analyze individual
arguments until template specialization. B

[clang-tidy] Fix false in unnecessary-value-param inside templates (#98488)

Summary:
If callExpr is type dependent, there is no way to analyze individual
arguments until template specialization. Before this diff only calls
with dependent callees were skipped so unnecessary-value-param was
processing arguments that had non-dependent type that gave false
positives because the call was not fully resolved till specialization.
So now instead of checking type dependent callee, the whole expression
will be checked for type dependent.

Test Plan: check-clang-tools

show more ...


Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5
# 6e31714d 01-May-2024 Congcong Cai <congcongcai0907@163.com>

[analysis] assume expr is not mutated after analysis to avoid recursive (#90581)

Fixes: #89376.


# f40f4fce 17-Apr-2024 Congcong Cai <congcongcai0907@163.com>

[clang analysis] ExprMutationAnalyzer support recursive forwarding reference (#88843)

Reapply for #88765.
Partially fixes: #60895.


Revision tags: llvmorg-18.1.4
# b2f07a91 15-Apr-2024 Florian Mayer <fmayer@google.com>

Revert "[clang analysis] ExprMutationAnalyzer avoid infinite recursion for recursive forwarding reference" (#88765)

Reverts llvm/llvm-project#87954

Broke sanitizer bots, e.g.
https://lab.llvm.or

Revert "[clang analysis] ExprMutationAnalyzer avoid infinite recursion for recursive forwarding reference" (#88765)

Reverts llvm/llvm-project#87954

Broke sanitizer bots, e.g.
https://lab.llvm.org/buildbot/#/builders/239/builds/6587/steps/10/logs/stdio

show more ...


# 8095b9ce 15-Apr-2024 Congcong Cai <congcongcai0907@163.com>

[clang analysis] ExprMutationAnalyzer avoid infinite recursion for recursive forwarding reference (#87954)


Revision tags: llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init
# 9f8ccf50 22-Jan-2024 Julian Schmidt <44101708+5chmidti@users.noreply.github.com>

[clang-tidy] fix misc-const-correctnes false-positive for fold expressions (#78320)

The check no longer emits a diagnostic for non-parameter-pack
variables in C++17 fold expressions.
The operator

[clang-tidy] fix misc-const-correctnes false-positive for fold expressions (#78320)

The check no longer emits a diagnostic for non-parameter-pack
variables in C++17 fold expressions.
The operator used is type-dependent because of the parameter pack
and can therefore not be guaranteed to not mutate the variable.

Fixes: #70323

show more ...


# 8fd32b96 16-Jan-2024 Clement Courbet <courbet@google.com>

[clang-tidy] Handle C++ structured bindings in `performance-for-range-copy` (#77105)

Right now we are not triggering on:

```
for (auto [x, y] : container) {
// const-only access
}
```


# 6eb372e4 09-Jan-2024 Piotr Zegar <me@piotrzegar.pl>

[clang-tidy] Improve performance of misc-const-correctness (#72705)

Replaced certain AST matchers in ExprMutationAnalyzer with a more direct
utilization of AST classes. The primary bottleneck was i

[clang-tidy] Improve performance of misc-const-correctness (#72705)

Replaced certain AST matchers in ExprMutationAnalyzer with a more direct
utilization of AST classes. The primary bottleneck was identified in the
canResolveToExpr AST matcher. Since this matcher was employed multiple
times and used recursively, each invocation led to the constant creation
and destruction of other matchers within it. Additionally, the continual
comparison of DynTypedNode resulted in significant performance
degradation.

The optimization was tested on the TargetLowering.cpp file. Originally,
the check took 156 seconds on that file, but after implementing this
enhancement, it now takes approximately 40 seconds, making it nearly
four times faster.

Despite this improvement, there are still numerous issues in this file.
To further reduce the computational cost of this class, it is advisable
to consider removing the remaining matchers and exploring alternatives
such as leveraging RecursiveASTVisitor and increasing the direct use of
AST classes.

Closes #71786

show more ...


Revision tags: llvmorg-17.0.6
# a3d76b3f 14-Nov-2023 Julian Schmidt <44101708+5chmidti@users.noreply.github.com>

[clang-tidy] fix match for binaryOperator in ExprMutationAnalyzer for misc-const-correctness (#70559)

The `ExprMutationAnalyzer`s matcher of `binaryOperator`s
that contained the variable expr, were

[clang-tidy] fix match for binaryOperator in ExprMutationAnalyzer for misc-const-correctness (#70559)

The `ExprMutationAnalyzer`s matcher of `binaryOperator`s
that contained the variable expr, were previously narrowing the
variable to be type dependent, when the `binaryOperator` should
have been narrowed as dependent.
The variable we are trying to find mutations for does
not need to be the dependent type, the other operand of
the `binaryOperator` could be dependent.

Fixes #57297

show more ...


Revision tags: llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2
# feb7b191 25-Sep-2023 Congcong Cai <congcongcai0907@163.com>

[clang-analysis]Fix false positive in mutation check when using pointer to member function (#66846)

Fixes: #66204


Revision tags: 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, llvmorg-16.0.6
# 12728e14 05-Jun-2023 Aaron Ballman <aaron@aaronballman.com>

[C] Support _Generic expressions with a type operand

_Generic accepts an expression operand whose type is matched against a
list of associations. The expression operand is unevaluated, but the
type

[C] Support _Generic expressions with a type operand

_Generic accepts an expression operand whose type is matched against a
list of associations. The expression operand is unevaluated, but the
type matched is the type after lvalue conversion. This conversion loses
type information, which makes it more difficult to match against
qualified or incomplete types.

This extension allows _Generic to accept a type operand instead of an
expression operand. The type operand form does not undergo any
conversions and is matched directly against the association list.

This extension is also supported in C++ as we already supported
_Generic selection expressions there.

The RFC for this extension can be found at:
https://discourse.llvm.org/t/rfc-generic-selection-expression-with-a-type-operand/70388

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

show more ...


Revision tags: llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0
# ea9d4040 15-Mar-2023 Kazu Hirata <kazu@google.com>

[clang] Use *{Set,Map}::contains (NFC)


Revision tags: llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, 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
# 46ae26e7 24-Jul-2022 Jonas Toth <development@jonas-toth.eu>

[clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

This patch connects the check for const-correctness with the new general
utility to add `const` to va

[clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

This patch connects the check for const-correctness with the new general
utility to add `const` to variables.
The code-transformation is only done, if the detected variable for const-ness
is not part of a group-declaration.

The check allows to control multiple facets of adding `const`, e.g. if pointers themself should be
marked as `const` if they are not changed.

Reviewed By: njames93

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

show more ...


Revision tags: llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4
# ca81abcf 23-May-2022 usama hameed <usamahameed@g.ucla.edu>

updated canResolveToExpr to accept both statements and expressions. Removed unnecessary code


# 63ecb7dc 23-May-2022 usama hameed <usamahameed@g.ucla.edu>

bugfix in InfiniteLoopCheck to not print warnings for unevaluated loops

Added a separate check for unevaluated statements. Updated InfiniteLoopCheck to use new check

Differential Revision: https://

bugfix in InfiniteLoopCheck to not print warnings for unevaluated loops

Added a separate check for unevaluated statements. Updated InfiniteLoopCheck to use new check

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

show more ...


# 60268222 19-May-2022 usama hameed <usamahameed@g.ucla.edu>

bugfix in InfiniteLoopCheck to not print warnings for unevaluated loops

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


Revision tags: llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2
# 1844ab77 02-Dec-2020 Tom Roeder <tmroeder@google.com>

[ASTImporter] Add support for importing GenericSelectionExpr AST nodes.

This allows ASTs to be merged when they contain GenericSelectionExpr
nodes (this is _Generic from C11). This is needed, for ex

[ASTImporter] Add support for importing GenericSelectionExpr AST nodes.

This allows ASTs to be merged when they contain GenericSelectionExpr
nodes (this is _Generic from C11). This is needed, for example, for
CTU analysis of C code that makes use of _Generic, like the Linux
kernel.

The node is already supported in the AST, but it didn't have a matcher
in ASTMatchers. So, this change adds the matcher and adds support to
ASTImporter. Additionally, this change adds support for structural
equivalence of _Generic in the AST.

Reviewed By: martong, aaron.ballman

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

show more ...


# 027899da 10-Dec-2020 Alexander Kornienko <alexfh@google.com>

Remove references to the ast_type_traits namespace

Follow up to cd62511496938e33c061c90796dd23a5288ff843 /
https://reviews.llvm.org/D74499

Reviewed By: aaron.ballman

Differential Revision: https:/

Remove references to the ast_type_traits namespace

Follow up to cd62511496938e33c061c90796dd23a5288ff843 /
https://reviews.llvm.org/D74499

Reviewed By: aaron.ballman

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

show more ...


Revision tags: llvmorg-11.0.1-rc1
# e517e5cf 09-Oct-2020 Jonas Toth <development@jonas-toth.eu>

[clang] improve accuracy of ExprMutAnalyzer

This patch extracts the ExprMutAnalyzer changes from https://reviews.llvm.org/D54943
into its own revision for simpler review and more atomic changes.

Th

[clang] improve accuracy of ExprMutAnalyzer

This patch extracts the ExprMutAnalyzer changes from https://reviews.llvm.org/D54943
into its own revision for simpler review and more atomic changes.

The analysis results are improved. Nested expressions (e.g. conditional
operators) are now detected properly. Some edge cases, especially
template induced imprecisions are improved upon.

Reviewed By: aaron.ballman

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

show more ...


12