#
e6979432 |
| 28-Jun-2024 |
Congcong Cai <congcongcai0907@163.com> |
[clang-tidy] improve messages when auto-fix does not work (#96917)
Fixes: #93157
|
Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6 |
|
#
3676b094 |
| 11-May-2024 |
Congcong Cai <congcongcai0907@163.com> |
[clang-tidy] `readability-simplify-boolean-expr` avoid to warn expression expand from macro when ``IgnoreMacro`` option is enabled. (#91757)
Fixes: #91487
|
Revision tags: 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, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init |
|
#
5295ca1a |
| 14-Jan-2024 |
Danny Mösch <danny.moesch@icloud.com> |
[clang-tidy] Add option to ignore macros in `readability-simplify-boolean-expr` check (#78043)
|
Revision tags: 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 |
|
#
f1f16331 |
| 26-Aug-2023 |
Piotr Zegar <me@piotrzegar.pl> |
[clang-tidy][NFC] Fix readability-inconsistent-declaration-parameter-name findings
Fix issues found by clang-tidy in clang-tidy source directory.
|
Revision tags: llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, 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, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init |
|
#
4718da50 |
| 22-Jan-2023 |
Carlos Galvez <carlosgalvezp@gmail.com> |
[clang-tidy][NFC] Use C++17 nested namespaces in clang-tidy headers
We forgot to apply the change to headers in the previous patch, due to missing "-header-filter" in the run-clang-tidy invocation.
[clang-tidy][NFC] Use C++17 nested namespaces in clang-tidy headers
We forgot to apply the change to headers in the previous patch, due to missing "-header-filter" in the run-clang-tidy invocation.
Differential Revision: https://reviews.llvm.org/D142307
show more ...
|
Revision tags: llvmorg-15.0.7 |
|
#
b0de3630 |
| 14-Dec-2022 |
Fangrui Song <i@maskray.me> |
[clang] Remove uses of ::testing::Matcher<const Optional<T> &>
Change a few functions (getCheckTraversalKind, some clang/Tooling/ API, etc) from llvm::Optional to std::optional.
|
Revision tags: 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, llvmorg-14.0.5, llvmorg-14.0.4 |
|
#
6e566bc5 |
| 18-May-2022 |
Richard <legalize@xmission.com> |
[clang-tidy] Organize check doc files into subdirectories (NFC)
- Rename doc files to subdirs by module - Update release notes and check list to use subdirs - Update add_new_check.py to handle doc s
[clang-tidy] Organize check doc files into subdirectories (NFC)
- Rename doc files to subdirs by module - Update release notes and check list to use subdirs - Update add_new_check.py to handle doc subdirs
Differential Revision: https://reviews.llvm.org/D126495
show more ...
|
#
f3c1d281 |
| 25-May-2022 |
Nathan James <n.james93@hotmail.co.uk> |
[clang-tidy] Extend SimplifyBooleanExpr demorgan support.
Adds an option SimplifyDemorganRelaxed which, when enabled, will transform negated conjunctions or disjunctions when neither operand is a ne
[clang-tidy] Extend SimplifyBooleanExpr demorgan support.
Adds an option SimplifyDemorganRelaxed which, when enabled, will transform negated conjunctions or disjunctions when neither operand is a negation. Default value is `false`.
Reviewed By: LegalizeAdulthood
Differential Revision: https://reviews.llvm.org/D126162
show more ...
|
#
af77b1d9 |
| 22-May-2022 |
Nathan James <n.james93@hotmail.co.uk> |
[clang-tidy] add support for Demorgan conversions to readability-simplify-bool-expr
Adds support for recognising and converting boolean expressions that can be simplified using De Morgans Law.
This
[clang-tidy] add support for Demorgan conversions to readability-simplify-bool-expr
Adds support for recognising and converting boolean expressions that can be simplified using De Morgans Law.
This is a different implementation to D124650.
Fixes https://github.com/llvm/llvm-project/issues/55092
Reviewed By: LegalizeAdulthood
Differential Revision: https://reviews.llvm.org/D124806
show more ...
|
#
4739176f |
| 18-May-2022 |
Nathan James <n.james93@hotmail.co.uk> |
[clang-tidy] Fix readability-simplify-boolean-expr crash with implicit cast in return.
Fixes https://github.com/llvm/llvm-project/issues/55557
Reviewed By: LegalizeAdulthood
Differential Revision:
[clang-tidy] Fix readability-simplify-boolean-expr crash with implicit cast in return.
Fixes https://github.com/llvm/llvm-project/issues/55557
Reviewed By: LegalizeAdulthood
Differential Revision: https://reviews.llvm.org/D125877
show more ...
|
#
6f872619 |
| 16-May-2022 |
Nathan James <n.james93@hotmail.co.uk> |
[clang-tidy][NFC] Reimplement SimplifyBooleanExpr with RecursiveASTVisitors
Reimplement the matching logic using Visitors instead of matchers.
Benchmarks from running the check over SemaCodeComplet
[clang-tidy][NFC] Reimplement SimplifyBooleanExpr with RecursiveASTVisitors
Reimplement the matching logic using Visitors instead of matchers.
Benchmarks from running the check over SemaCodeComplete.cpp Before 0.20s, After 0.04s
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D125026
show more ...
|
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 |
|
#
99217fa8 |
| 30-Dec-2021 |
Richard <legalize@xmission.com> |
[clang-tidy] Recognize labelled statements when simplifying boolean exprs
Inside a switch the caseStmt() and defaultStmt() have a nested statement associated with them. Similarly, labelStmt() has a
[clang-tidy] Recognize labelled statements when simplifying boolean exprs
Inside a switch the caseStmt() and defaultStmt() have a nested statement associated with them. Similarly, labelStmt() has a nested statement. These statements were being missed when looking for a compound-if of the form "if (x) return true; return false;" when the if is nested under one of these labelling constructs.
Enhance the matchers to look for these nested statements using some private matcher hasSubstatement() traversal matcher on case, default and label statements. Add the private matcher hasSubstatementSequence() to match the compound "if (x) return true; return false;" pattern.
- Add unit tests for private matchers and corresponding test infrastructure - Add corresponding test file readability-simplify-bool-expr-case.cpp. - Fix variable name copy/paste error in readability-simplify-bool-expr.cpp. - Drop the asserts, which were used only for debugging matchers. - Run clang-format on the whole check. - Move local functions out of anonymous namespace and declare state, per LLVM style guide - Declare labels constexpr - Declare visitor arguments as pointer to const - Drop braces around simple control statements per LLVM style guide - Prefer explicit arguments over default arguments to methods
Differential Revision: https://reviews.llvm.org/D56303
Fixes #27078
show more ...
|
Revision tags: 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 |
|
#
302cc842 |
| 29-Dec-2020 |
Stephen Kelly <steveire@gmail.com> |
[clang-tidy] Simplify boolean expr check
Differential Revision: https://reviews.llvm.org/D97153
|
Revision tags: llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1, llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3 |
|
#
df5335a3 |
| 22-Aug-2020 |
Nathan James <n.james93@hotmail.co.uk> |
[clang-tidy] readability-simplify-boolean-expr detects negated literals
Adds support for detecting cases like `if (!true) ...`. Addresses [[ https://bugs.llvm.org/show_bug.cgi?id=47166 | readability
[clang-tidy] readability-simplify-boolean-expr detects negated literals
Adds support for detecting cases like `if (!true) ...`. Addresses [[ https://bugs.llvm.org/show_bug.cgi?id=47166 | readability-simplify-boolean-expr not detected for negated boolean literals. ]]
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D86176
show more ...
|
Revision tags: llvmorg-11.0.0-rc2, llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2, llvmorg-10.0.1-rc1, llvmorg-10.0.0, llvmorg-10.0.0-rc6, llvmorg-10.0.0-rc5, llvmorg-10.0.0-rc4, llvmorg-10.0.0-rc3, llvmorg-10.0.0-rc2, llvmorg-10.0.0-rc1, llvmorg-11-init, llvmorg-9.0.1, llvmorg-9.0.1-rc3, llvmorg-9.0.1-rc2, llvmorg-9.0.1-rc1, llvmorg-9.0.0, llvmorg-9.0.0-rc6, llvmorg-9.0.0-rc5, llvmorg-9.0.0-rc4, llvmorg-9.0.0-rc3, llvmorg-9.0.0-rc2, llvmorg-9.0.0-rc1, llvmorg-10-init, llvmorg-8.0.1, llvmorg-8.0.1-rc4, llvmorg-8.0.1-rc3, llvmorg-8.0.1-rc2, llvmorg-8.0.1-rc1 |
|
#
478fc5c8 |
| 25-Mar-2019 |
Alexander Kornienko <alexfh@google.com> |
[clang-tidy] Switch checks to #include "ClangTidyCheck.h"
llvm-svn: 356892
|
Revision tags: llvmorg-8.0.0, llvmorg-8.0.0-rc5, llvmorg-8.0.0-rc4, llvmorg-8.0.0-rc3, llvmorg-7.1.0, llvmorg-7.1.0-rc1, llvmorg-8.0.0-rc2, llvmorg-8.0.0-rc1 |
|
#
2946cd70 |
| 19-Jan-2019 |
Chandler Carruth <chandlerc@gmail.com> |
Update the file headers across all of the LLVM projects in the monorepo to reflect the new license.
We understand that people may be surprised that we're moving the header entirely to discuss the ne
Update the file headers across all of the LLVM projects in the monorepo to reflect the new license.
We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach.
Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository.
llvm-svn: 351636
show more ...
|
#
14706b96 |
| 20-Dec-2018 |
Alexander Kornienko <alexfh@google.com> |
[clang-tidy] Use translationUnitDecl() instead of a custom matcher.
llvm-svn: 349758
|
Revision tags: llvmorg-7.0.1, llvmorg-7.0.1-rc3 |
|
#
35f3da19 |
| 15-Nov-2018 |
Sam McCall <sam.mccall@gmail.com> |
[clang-tidy] Update checks to play nicely with limited traversal scope added in r346847
Summary: (See D54204 for original review)
Reviewers: hokein
Subscribers: xazax.hun, cfe-commits
Differentia
[clang-tidy] Update checks to play nicely with limited traversal scope added in r346847
Summary: (See D54204 for original review)
Reviewers: hokein
Subscribers: xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D54579
llvm-svn: 346961
show more ...
|
Revision tags: llvmorg-7.0.1-rc2, llvmorg-7.0.1-rc1, llvmorg-7.0.0, llvmorg-7.0.0-rc3, llvmorg-7.0.0-rc2, llvmorg-7.0.0-rc1, llvmorg-6.0.1, llvmorg-6.0.1-rc3, llvmorg-6.0.1-rc2, llvmorg-6.0.1-rc1, llvmorg-5.0.2, llvmorg-5.0.2-rc2, llvmorg-5.0.2-rc1, llvmorg-6.0.0, llvmorg-6.0.0-rc3, llvmorg-6.0.0-rc2, llvmorg-6.0.0-rc1, llvmorg-5.0.1, llvmorg-5.0.1-rc3, llvmorg-5.0.1-rc2, llvmorg-5.0.1-rc1, llvmorg-5.0.0, llvmorg-5.0.0-rc5, llvmorg-5.0.0-rc4, llvmorg-5.0.0-rc3, llvmorg-5.0.0-rc2, llvmorg-5.0.0-rc1, llvmorg-4.0.1, llvmorg-4.0.1-rc3, llvmorg-4.0.1-rc2 |
|
#
7009d657 |
| 15-May-2017 |
Alexander Kornienko <alexfh@google.com> |
[clang-tidy] Partly rewrite readability-simplify-boolean-expr using RAV
The check was using AST matchers in a very inefficient manner. By rewriting the BinaryOperator-related parts using RAV, the ch
[clang-tidy] Partly rewrite readability-simplify-boolean-expr using RAV
The check was using AST matchers in a very inefficient manner. By rewriting the BinaryOperator-related parts using RAV, the check was sped up by a factor of up to 10000 on some files (mostly, generated code using binary operators in tables), but also significantly sped up for regular large files. As a side effect, the code became clearer and more readable.
llvm-svn: 303081
show more ...
|
Revision tags: llvmorg-4.0.1-rc1, llvmorg-4.0.0, llvmorg-4.0.0-rc4, llvmorg-4.0.0-rc3, llvmorg-4.0.0-rc2, llvmorg-4.0.0-rc1, llvmorg-3.9.1, llvmorg-3.9.1-rc3, llvmorg-3.9.1-rc2, llvmorg-3.9.1-rc1, llvmorg-3.9.0, llvmorg-3.9.0-rc3, llvmorg-3.9.0-rc2, llvmorg-3.9.0-rc1, llvmorg-3.8.1, llvmorg-3.8.1-rc1, llvmorg-3.8.0, llvmorg-3.8.0-rc3 |
|
#
f034a8c7 |
| 12-Feb-2016 |
Aaron Ballman <aaron@aaronballman.com> |
Reapply r260096.
Expand the simplify boolean expression check to handle implicit conversion of integral types to bool and improve the handling of implicit conversion of member pointers to bool.
Imp
Reapply r260096.
Expand the simplify boolean expression check to handle implicit conversion of integral types to bool and improve the handling of implicit conversion of member pointers to bool.
Implicit conversion of member pointers are replaced with explicit comparisons to nullptr.
Implicit conversions of integral types are replaced with explicit comparisons to 0.
Patch by Richard Thomson.
llvm-svn: 260681
show more ...
|
#
54391c8c |
| 08-Feb-2016 |
Aaron Ballman <aaron@aaronballman.com> |
Reverting r260096; it causes build bot failures:
http://bb.pgr.jp/builders/cmake-clang-tools-x86_64-linux/builds/23351 http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/492
llvm-svn: 260097
|
#
f4490cab |
| 08-Feb-2016 |
Aaron Ballman <aaron@aaronballman.com> |
Expand the simplify boolean expression check to handle implicit conversion of integral types to bool and improve the handling of implicit conversion of member pointers to bool.
Implicit conversion o
Expand the simplify boolean expression check to handle implicit conversion of integral types to bool and improve the handling of implicit conversion of member pointers to bool.
Implicit conversion of member pointers are replaced with explicit comparisons to nullptr.
Implicit conversions of integral types are replaced with explicit comparisons to 0.
Patch by Richard Thomson.
llvm-svn: 260096
show more ...
|
Revision tags: llvmorg-3.8.0-rc2, llvmorg-3.8.0-rc1 |
|
#
4f74ec0d |
| 28-Dec-2015 |
Alexander Kornienko <alexfh@google.com> |
[clang-tidy] Preserve comments and preprocessor directives when simplifying boolean expressions
This changeset still emits the diagnostic that the expression could be simplified, but it doesn't gene
[clang-tidy] Preserve comments and preprocessor directives when simplifying boolean expressions
This changeset still emits the diagnostic that the expression could be simplified, but it doesn't generate any fix-its that would lose comments or preprocessor directives within the text that would be replaced.
Fixes PR25842
Reviewers: alexfh
Subscribers: xazax.hun, cfe-commits
Patch by Richard Thomson! (+a naming style fix)
Differential Revision: http://reviews.llvm.org/D15737
llvm-svn: 256492
show more ...
|
Revision tags: llvmorg-3.7.1, llvmorg-3.7.1-rc2, llvmorg-3.7.1-rc1 |
|
#
f8ed0a8d |
| 27-Aug-2015 |
Alexander Kornienko <alexfh@google.com> |
[clang-tidy] Update docs for clang-tidy checks. NFC
Changes mostly address formatting and unification of the style. Use MarkDown style for inline code snippets and lists. Added some text for a few c
[clang-tidy] Update docs for clang-tidy checks. NFC
Changes mostly address formatting and unification of the style. Use MarkDown style for inline code snippets and lists. Added some text for a few checks.
The idea is to move most of the documentation out to separate rST files and have implementation files refer to the corresponding documentation files.
llvm-svn: 246169
show more ...
|
Revision tags: llvmorg-3.7.0, llvmorg-3.7.0-rc4, llvmorg-3.7.0-rc3, studio-1.4, llvmorg-3.7.0-rc2, llvmorg-3.7.0-rc1 |
|
#
6ae400d1 |
| 01-Jul-2015 |
Alexander Kornienko <alexfh@google.com> |
[clang-tidy] Enhance clang-tidy readability-simplify-boolean-expr...
Enhance clang-tidy readability-simplify-boolean-expr to handle 'if (e) return true; return false;' and improve replacement expres
[clang-tidy] Enhance clang-tidy readability-simplify-boolean-expr...
Enhance clang-tidy readability-simplify-boolean-expr to handle 'if (e) return true; return false;' and improve replacement expressions.
This changeset extends the simplify boolean expression check in clang-tidy to simplify if (e) return true; return false; to return e; (note the lack of an else clause on the if statement.) By default, chained conditional assignment is left unchanged, unless a configuration parameter is set to non-zero to override this behavior.
It also improves the handling of replacement expressions to apply static_cast<bool>(expr) when expr is not of type bool.
http://reviews.llvm.org/D9810
Patch by Richard Thomson!
llvm-svn: 241155
show more ...
|