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

2024-06-24 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/96506 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-06-24 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/96506 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] add fixhint for misc-use-internal-linkage (PR #96203)

2024-06-24 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/96203 >From 669205c0f659239c58a3bde3ddadabb0a8ecbad8 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 20 Jun 2024 15:05:57 + Subject: [PATCH 1/3] [clang-tidy] add fixhint for misc-use-internal-linkage

[clang-tools-extra] [clang-tidy] align all help message in run-clang-tidy (PR #96199)

2024-06-24 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/96199 >From 03bc40a343227cb839ec908492c0d904be9af654 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 20 Jun 2024 14:36:51 + Subject: [PATCH 1/3] [clang-tidy] align all help message in run-clang-tidy

[clang-tools-extra] [clang-tidy] add fixhint for misc-use-internal-linkage (PR #96203)

2024-06-24 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/96203 >From 669205c0f659239c58a3bde3ddadabb0a8ecbad8 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 20 Jun 2024 15:05:57 + Subject: [PATCH 1/2] [clang-tidy] add fixhint for misc-use-internal-linkage

[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)

2024-06-24 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/96122 >From 41993ea6903668c41eef8a4477f5914c894f7109 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 19 Jun 2024 23:20:09 + Subject: [PATCH 1/8] [clang-tidy] add option to avoid "no checks enabled"

[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)

2024-06-24 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/96122 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)

2024-06-24 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: I found it. It named `clang-tidy-diff.py` https://github.com/llvm/llvm-project/pull/96122 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)

2024-06-24 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: Where is `diff-clang-tidy.py`? https://github.com/llvm/llvm-project/pull/96122 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)

2024-06-23 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/96122 >From 41993ea6903668c41eef8a4477f5914c894f7109 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 19 Jun 2024 23:20:09 + Subject: [PATCH 1/6] [clang-tidy] add option to avoid "no checks enabled"

[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)

2024-06-21 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/96122 >From 41993ea6903668c41eef8a4477f5914c894f7109 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 19 Jun 2024 23:20:09 + Subject: [PATCH 1/5] [clang-tidy] add option to avoid "no checks enabled"

[clang-tools-extra] [clang-tidy] Clarify diagnostics of bugprone-sizeof-expression (PR #95550)

2024-06-20 Thread Congcong Cai via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -342,31 +342,33 @@ void SizeofExpressionCheck::check(const MatchFinder::MatchResult ) { if (DenominatorSize > CharUnits::Zero() && !NumeratorSize.isMultipleOf(DenominatorSize)) { -

[clang-tools-extra] [clang-tidy] align all help message in run-clang-tidy (PR #96199)

2024-06-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/96199 >From 03bc40a343227cb839ec908492c0d904be9af654 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 20 Jun 2024 14:36:51 + Subject: [PATCH 1/2] [clang-tidy] align all help message in run-clang-tidy

[clang-tools-extra] [clang-tidy] add fixhint for misc-use-internal-linkage (PR #96203)

2024-06-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/96203 None >From 669205c0f659239c58a3bde3ddadabb0a8ecbad8 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 20 Jun 2024 15:05:57 + Subject: [PATCH] [clang-tidy] add fixhint for misc-use-internal-linkage

[clang-tools-extra] [clang-tidy] align all help message in run-clang-tidy (PR #96199)

2024-06-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/96199 >From 03bc40a343227cb839ec908492c0d904be9af654 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 20 Jun 2024 14:36:51 + Subject: [PATCH] [clang-tidy] align all help message in run-clang-tidy [NFC]

[clang-tools-extra] [clang-tidy] align all help message in run-clang-tidy (PR #96199)

2024-06-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/96199 None >From 36194358315d1614cb6d802d30ffc7c651c9ff44 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 20 Jun 2024 14:36:51 + Subject: [PATCH] [clang-tidy] align all help message in run-clang-tidy

[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)

2024-06-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/96122 >From 41993ea6903668c41eef8a4477f5914c894f7109 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 19 Jun 2024 23:20:09 + Subject: [PATCH 1/4] [clang-tidy] add option to avoid "no checks enabled"

[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)

2024-06-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/96122 >From 41993ea6903668c41eef8a4477f5914c894f7109 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 19 Jun 2024 23:20:09 + Subject: [PATCH 1/3] [clang-tidy] add option to avoid "no checks enabled"

[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)

2024-06-20 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/96122 >From 41993ea6903668c41eef8a4477f5914c894f7109 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 19 Jun 2024 23:20:09 + Subject: [PATCH 1/2] [clang-tidy] add option to avoid "no checks enabled"

[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)

2024-06-20 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: > if a reason for this parameter is not to fail wrapper scripts, then maybe > run-clang-tidy.py / run-clang-tidy-diff.py should also be updated. Both of them is fine because they only count the failed file and don't do any check about failure.

[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)

2024-06-19 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/96122 When clang-tidy get an empty checks, it will throw "no checks enabled" error and exit with non-zero return value. It make clang-tidy's wrapper program confused when in big project some files don't want to

[clang-tools-extra] [clang][include-cleaner]skip stdlib recogntion only when there are defintion with body in main file. (PR #95797)

2024-06-19 Thread Congcong Cai via cfe-commits
@@ -39,20 +40,24 @@ Hints declHints(const Decl *D) { } std::vector> locateDecl(const Decl ) { - std::vector> Result; - // FIXME: Should we also provide physical locations? - if (auto SS = tooling::stdlib::Recognizer()()) { -Result.push_back({*SS,

[clang-tools-extra] [clang][include-cleaner]skip stdlib recogntion only when there are defintion with body in main file. (PR #95797)

2024-06-18 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/95797 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang][include-cleaner]skip stdlib recogntion only when there are defintion with body in main file. (PR #95797)

2024-06-18 Thread Congcong Cai via cfe-commits
@@ -39,20 +40,24 @@ Hints declHints(const Decl *D) { } std::vector> locateDecl(const Decl ) { - std::vector> Result; - // FIXME: Should we also provide physical locations? - if (auto SS = tooling::stdlib::Recognizer()()) { -Result.push_back({*SS,

[clang] [clang][analyzer] use unqualified canonical type during merging equivalence class (PR #95729)

2024-06-17 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: > Excellent quality. Thank for fixing this. Should I fix the other type comparison in static analysis? It looks like not consider this case at lots of position. https://github.com/llvm/llvm-project/pull/95729 ___ cfe-commits

[clang] [clang][analyzer] use unqualified canonical type during merging equivalence class (PR #95729)

2024-06-17 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/95729 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] use unqualified canonical type during merging equivalence class (PR #95729)

2024-06-17 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: > Do you need us to merge this, or you have merge rights? Yes. https://github.com/llvm/llvm-project/pull/95729 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang][include-cleaner]skip stdlib recogntion only when there are defintion with body in main file. (PR #95797)

2024-06-17 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/95797 When a definition is being located, standard library function recognition is skipped if the function has a definition with body in the main file >From 71a2c0d29058edac2539fbbe406890e6a6dc875c Mon Sep 17

[clang] [clang][analyzer] use unqualified canonical type during merging equivalence class (PR #95729)

2024-06-17 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/95729 >From 40f18f2be624ed2a5b4922e67e4ed6070d2d2400 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Mon, 17 Jun 2024 00:13:20 + Subject: [PATCH 1/2] [clang][analyzer] use unqualified canonical type during

[clang] [clang][analyzer] use unqualified canonical type during merging equivalence class (PR #95729)

2024-06-16 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/95729 Fixes: #95658 Unqualified canonical type should be used instead of normal QualType for type equality comparison >From 40f18f2be624ed2a5b4922e67e4ed6070d2d2400 Mon Sep 17 00:00:00 2001 From: Congcong Cai

[clang-tools-extra] [clang-tidy] fix false negatives for performance-inefficient-vector-operation (PR #95667)

2024-06-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/95667 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] fix false negatives for performance-inefficient-vector-operation (PR #95667)

2024-06-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/95667 >From 5a4a4aac26a2a4078f07977b5101d3a1e22a3e0c Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 15 Jun 2024 16:24:55 + Subject: [PATCH 1/2] [clang-tidy] fix false negatives for

[clang-tools-extra] [clang-tidy] fix false negatives for performance-inefficient-vector-operation (PR #95667)

2024-06-15 Thread Congcong Cai via cfe-commits
@@ -387,3 +387,38 @@ void foo(const StructWithFieldContainer ) { B.push_back(Number); } } + +namespace gh95596 { + +void f(std::vector& t) { + { +std::vector gh95596_0; +// CHECK-FIXES: gh95596_0.reserve(10); +for (unsigned i = 0; i < 10; ++i) +

[clang-tools-extra] [clang-tidy] fix false negatives for performance-inefficient-vector-operation (PR #95667)

2024-06-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/95667 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] fix false negatives for performance-inefficient-vector-operation (PR #95667)

2024-06-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/95667 Fixes: #95596 Check will warn if the loop var type is not same as var init expr type >From 5a4a4aac26a2a4078f07977b5101d3a1e22a3e0c Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 15 Jun 2024

[clang-tools-extra] [clang-tidy] Option to ignore anonymous namespaces in avoid-non-const-global-variables (PR #93827)

2024-06-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/93827 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy]fix false positives of the result of std::move() is used as rvalue for performance-move-const-arg (PR #95633)

2024-06-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/95633 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy]fix false positives of the result of std::move() is used as rvalue for performance-move-const-arg (PR #95633)

2024-06-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/95633 >From 0022050f7b537914dff7adf937103def4c9c939a Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 15 Jun 2024 05:40:50 + Subject: [PATCH 1/2] [clang-tidy]fix false positives of the result of

[clang-tools-extra] [clang-tidy]fix false positives of the result of std::move() is used as rvalue for performance-move-const-arg (PR #95633)

2024-06-14 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/95633 Fixes: #86404 >From 0022050f7b537914dff7adf937103def4c9c939a Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Sat, 15 Jun 2024 05:40:50 + Subject: [PATCH] [clang-tidy]fix false positives of the result

[clang-tools-extra] [clang-tidy] Clarify diagnostics of bugprone-sizeof-expression (PR #95550)

2024-06-14 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/95550 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] avoid false positive when overload for bugprone-return-const-ref-from-parameter (PR #95434)

2024-06-14 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/95434 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] avoid false positive when overload for bugprone-return-const-ref-from-parameter (PR #95434)

2024-06-14 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/95434 >From ecbd726bb937361b243ea4433e8c597c8d30f857 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Fri, 14 Jun 2024 00:50:04 +0800 Subject: [PATCH 1/2] [clang-tidy] avoid false positive when overload for

[clang-tools-extra] [clang-tidy] avoid false positive when overload for bugprone-return-const-ref-from-parameter (PR #95434)

2024-06-13 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/95434 Fixes: #90274 >From ecbd726bb937361b243ea4433e8c597c8d30f857 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Fri, 14 Jun 2024 00:50:04 +0800 Subject: [PATCH] [clang-tidy] avoid false positive when

[clang-tools-extra] tidy (PR #95384)

2024-06-13 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/95384 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] 3f9e2e1 - [NFC][clang-tidy] fix typo in readability-else-after-return

2024-06-13 Thread Congcong Cai via cfe-commits
Author: Congcong Cai Date: 2024-06-13T18:24:12+08:00 New Revision: 3f9e2e179a52eb50a2bcff148a5f351a4eddcb37 URL: https://github.com/llvm/llvm-project/commit/3f9e2e179a52eb50a2bcff148a5f351a4eddcb37 DIFF: https://github.com/llvm/llvm-project/commit/3f9e2e179a52eb50a2bcff148a5f351a4eddcb37.diff

[clang-tools-extra] tidy (PR #95384)

2024-06-13 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/95384 - **[MLIR] Translate DIStringType. (#94480)** - **[clangd] Fix crash with null check for Token at Loc (#94528)** - **[flang][Transforms][NFC] Remove boilerplate from vscale range pass (#94598)** -

[clang-tools-extra] [clang-tidy] ignoring macro with hash preprocessing token in cppcoreguidelines-macro-usage (PR #95265)

2024-06-12 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/95265 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] ignoring macro with hash preprocessing token in cppcoreguidelines-macro-usage (PR #95265)

2024-06-12 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/95265 `#` and `##` preprocessing tokens cannot be replaced by constexpr function. It should be ignored in check. >From eaeb5b6493e0c3980a60f9acbc5572de0d619419 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date:

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2024-06-12 Thread Congcong Cai via cfe-commits
Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= Message-ID: In-Reply-To: HerrCai0907 wrote: > >

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2024-06-12 Thread Congcong Cai via cfe-commits
Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= Message-ID: In-Reply-To: HerrCai0907 wrote: > I

[clang-tools-extra] [clang-tidy] fix false positives for the functions with the same name as standard library functions in misc-include-cleaner (PR #94923)

2024-06-11 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/94923 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() (PR #90043)

2024-06-11 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: > To be clear and reiterate my previous comment: this check should NOT require > users to use at(). That behavior should be opt-in. It should only warn about > using operator[]. It's up to the users to figure out what the best > replacement is. I don't think it is a good

[clang-tools-extra] [clang-tidy] fix false positives for the functions with the same name as standard library functions in misc-include-cleaner (PR #94923)

2024-06-11 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/94923 >From e467b03cc120eedc580c185232f000e0d8aa0cc7 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Mon, 10 Jun 2024 09:04:27 +0800 Subject: [PATCH 1/2] [clang-tidy] fix false positives for the functions with

[clang-tools-extra] [clang-tidy] fix false positives for the functions with the same name as standard library functions in misc-include-cleaner (PR #94923)

2024-06-10 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/94923 >From e467b03cc120eedc580c185232f000e0d8aa0cc7 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Mon, 10 Jun 2024 09:04:27 +0800 Subject: [PATCH 1/2] [clang-tidy] fix false positives for the functions with

[clang-tools-extra] [clang-tidy] fix false positives for the functions with the same name as standard library functions in misc-include-cleaner (PR #94923)

2024-06-10 Thread Congcong Cai via cfe-commits
@@ -15,3 +15,5 @@ std::string HelloString; // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: no header providing "std::string" is directly included [misc-include-cleaner] int FooBarResult = foobar(); // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: no header providing "foobar" is

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() (PR #90043)

2024-06-10 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 requested changes to this pull request. `at` and `operator[]` in `std::map` have different meanings. `operator[]` will insert value if key does not exist but `at` won't. Please limit this check only for index containers instead of key-value containers.

[clang-tools-extra] [clang-tidy] fix false positives for the functions with the same name as standard library functions in misc-include-cleaner (PR #94923)

2024-06-09 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/94923 >From e467b03cc120eedc580c185232f000e0d8aa0cc7 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Mon, 10 Jun 2024 09:04:27 +0800 Subject: [PATCH] [clang-tidy] fix false positives for the functions with the

[clang-tools-extra] [clang-tidy] fix false positives for the functions with the same name as standard library functions in misc-include-cleaner (PR #94923)

2024-06-09 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/94923 Fixes: #93335 For decl with body, we should provide physical locations also. Because it may be the function which have the same name as std library. >From e467b03cc120eedc580c185232f000e0d8aa0cc7 Mon Sep 17

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-06-07 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/90830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] refactor misc-header-include-cycle (PR #94697)

2024-06-06 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/94697 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] refactor misc-header-include-cycle (PR #94697)

2024-06-06 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/94697 1. merge valid check 2. use range base loop >From 8104085685772f93bcc595858821f839636ada9e Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Fri, 7 Jun 2024 07:06:37 +0800 Subject: [PATCH] [clang-tidy]

[clang-tools-extra] [clang-tidy]fix crashing when self include cycles for misc-header-include-cycle (PR #94636)

2024-06-06 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/94636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy]fix crashing when self include cycles for misc-header-include-cycle (PR #94636)

2024-06-06 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/94636 Fixes: #94634 >From 28ef0936ee115720bbe6cc20cf255100d63780cc Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Fri, 7 Jun 2024 00:11:55 +0800 Subject: [PATCH] [clang-tidy]fix crashing when self include

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-06-06 Thread Congcong Cai via cfe-commits
@@ -24,12 +24,28 @@ namespace { AST_MATCHER(Decl, isFirstDecl) { return Node.isFirstDecl(); } -AST_MATCHER_P(Decl, isInMainFile, FileExtensionsSet, HeaderFileExtensions) { +static bool isInMainFile(SourceLocation L, SourceManager , + const

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-06-06 Thread Congcong Cai via cfe-commits
@@ -24,12 +24,28 @@ namespace { AST_MATCHER(Decl, isFirstDecl) { return Node.isFirstDecl(); } -AST_MATCHER_P(Decl, isInMainFile, FileExtensionsSet, HeaderFileExtensions) { +static bool isInMainFile(SourceLocation L, SourceManager , + const

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-06-06 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,78 @@ +//===--- UseInternalLinkageCheck.cpp - clang-tidy--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clang-tidy] Fix crash in readability-container-size-empty (PR #94527)

2024-06-05 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/94527 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-06-04 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,78 @@ +//===--- UseInternalLinkageCheck.cpp - clang-tidy--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-06-04 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,78 @@ +//===--- UseInternalLinkageCheck.cpp - clang-tidy--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-05-26 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/90830 >From 24cbbd0c87ab2a06381d210da1dff5f966b72773 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 2 May 2024 15:44:45 +0800 Subject: [PATCH 1/7] reformat --- .../clang-tidy/readability/CMakeLists.txt

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-05-23 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,78 @@ +//===--- UseInternalLinkageCheck.cpp - clang-tidy--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clang-tidy] Fix crash in modernize-use-constraints (PR #92019)

2024-05-13 Thread Congcong Cai via cfe-commits
@@ -306,6 +306,10 @@ Changes in existing checks don't remove parentheses used in ``sizeof`` calls when they have array index accesses as arguments. +- Improved :doc:`modernize-use-constraints + ` check by fixing a crash that + occurred in some scenarios and excluded

[clang-tools-extra] [clang-tidy] Fix crash in modernize-use-constraints (PR #92019)

2024-05-13 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/92019 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Ignore implicit casts with errors in bugprone-implicit-widening-of-multiplication-result (PR #92025)

2024-05-13 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/92025 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-05-13 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,78 @@ +//===--- UseInternalLinkageCheck.cpp - clang-tidy--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-05-13 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,78 @@ +//===--- UseInternalLinkageCheck.cpp - clang-tidy--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-05-13 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/90830 >From 24cbbd0c87ab2a06381d210da1dff5f966b72773 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 2 May 2024 15:44:45 +0800 Subject: [PATCH 1/7] reformat --- .../clang-tidy/readability/CMakeLists.txt

[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

2024-05-13 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/91293 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Ignore `if consteval` in else-after-return (PR #91588)

2024-05-13 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/91588 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] `readability-simplify-boolean-expr` avoid to warn expression expand from macro when ``IgnoreMacro`` option is enabled. (PR #91757)

2024-05-10 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/91757 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add option to exclude headers from clang-tidy analysis (PR #91400)

2024-05-10 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/91400 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] `readability-simplify-boolean-expr` avoid to warn expression expand from macro when ``IgnoreMacro`` option is enabled. (PR #91757)

2024-05-10 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/91757 >From e23675eae31ed9c3cc4bbf31d3bc43b492ef5eac Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 9 May 2024 00:51:58 +0800 Subject: [PATCH 1/2] [clang-tidy] avoid false postive when ignore macro Fixes:

[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

2024-05-10 Thread Congcong Cai via cfe-commits
@@ -226,6 +236,10 @@ def run_clang_tidy(self): print("--") return clang_tidy_output +def check_no_diagnosis(self, clang_tidy_output): +if clang_tidy_output != "": +

[clang-tools-extra] [clang-tidy] `readability-simplify-boolean-expr` avoid to warn expression expand from macro when ``IgnoreMacro`` option is enabled. (PR #91757)

2024-05-10 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/91757 >From e23675eae31ed9c3cc4bbf31d3bc43b492ef5eac Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 9 May 2024 00:51:58 +0800 Subject: [PATCH] [clang-tidy] avoid false postive when ignore macro Fixes:

[clang-tools-extra] [clang-tidy] `readability-simplify-boolean-expr` avoid to warn expression expand from macro when ``IgnoreMacro`` option is enabled. (PR #91757)

2024-05-10 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/91757 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] avoid false postive when ignore macro (PR #91757)

2024-05-10 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/91757 Fixes: #91487 >From d340a04ffa50e03eb5267e267a27dcae5fefa223 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 9 May 2024 00:51:58 +0800 Subject: [PATCH] [clang-tidy] avoid false postive when ignore

[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

2024-05-10 Thread Congcong Cai via cfe-commits
@@ -226,6 +236,10 @@ def run_clang_tidy(self): print("--") return clang_tidy_output +def check_no_diagnosis(self, clang_tidy_output): +if clang_tidy_output != "": +

[clang-tools-extra] [clang-tidy] use llvm::any_of refactor getAnalyzerCheckersAndPackages [NFC] (PR #91713)

2024-05-10 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/91713 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] use llvm::any_of refactor getAnalyzerCheckersAndPackages [NFC] (PR #91713)

2024-05-10 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/91713 None >From 035363d336a9b115d5584efe01733cb1b76792c4 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Fri, 10 May 2024 16:28:06 +0800 Subject: [PATCH] [clang-tidy] use llvm::any_of refactor

[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

2024-05-09 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/91293 >From 55aecbedf3e10207eaef1d4c7913086a32e16b1e Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Tue, 7 May 2024 10:55:45 +0800 Subject: [PATCH 1/5] [clang-tidy] support expect no diagnosis test ---

[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

2024-05-09 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/91293 >From 55aecbedf3e10207eaef1d4c7913086a32e16b1e Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Tue, 7 May 2024 10:55:45 +0800 Subject: [PATCH 1/4] [clang-tidy] support expect no diagnosis test ---

[clang-tools-extra] [NFC][clang-tidy] remove magic-numbers-todo.cpp (PR #91577)

2024-05-09 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/91577 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

2024-05-09 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/91293 >From 55aecbedf3e10207eaef1d4c7913086a32e16b1e Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Tue, 7 May 2024 10:55:45 +0800 Subject: [PATCH 1/3] [clang-tidy] support expect no diagnosis test ---

[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

2024-05-09 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: > And why is this not a valid test? No `CHECK-*` comments in the reference > file, so no violations from `clang-tidy` are expected? Because the FileCheck don't support empty input. https://github.com/llvm/llvm-project/pull/91293

[clang-tools-extra] [NFC][clang-tidy] remove magic-numbers-todo.cpp (PR #91577)

2024-05-09 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/91577 This XFAIL test is written in 4 years ago and still todo. 4 is already in DefaultIgnoredIntegerValues so I do not think this XFAIL case can be passed. >From dbe6590cc841305da753100586054d5c3cccbe6c Mon Sep

[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

2024-05-09 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/91293 >From 55aecbedf3e10207eaef1d4c7913086a32e16b1e Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Tue, 7 May 2024 10:55:45 +0800 Subject: [PATCH 1/3] [clang-tidy] support expect no diagnosis test ---

[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

2024-05-09 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/91293 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

2024-05-09 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: I remove the command line option. Instead, when input don't have any check, check-clang-tidy will assume it should not diagnose anything. https://github.com/llvm/llvm-project/pull/91293 ___ cfe-commits mailing list

[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

2024-05-09 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/91293 >From 55aecbedf3e10207eaef1d4c7913086a32e16b1e Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Tue, 7 May 2024 10:55:45 +0800 Subject: [PATCH 1/3] [clang-tidy] support expect no diagnosis test ---

[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

2024-05-08 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 edited https://github.com/llvm/llvm-project/pull/91293 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   5   6   >