[clang-tools-extra] Reland "[clang-tidy] fix bugprone-narrowing-conversions false positive for conditional expression" (PR #151874)

2025-08-05 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM because every other tests use `x86_64-unknown-linux`. Though I'm not sure why it has to be `x86_64-unknown-linux` and not `x86_64-unknown-unknown`. When tests run, only `arm` failed, so `x86_64_windows` must work too. But it is not a

[clang-tools-extra] [clang-tidy] Print type information to performance-unnecessary-* checks (PR #152101)

2025-08-05 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/152101 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][docs][NFC] Add limitation of variable lifetimes in performance-unnecessary-copy-initialization (PR #151862)

2025-08-05 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/151862 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][docs][NFC] Make uniform "Limitations" sections across all checks (PR #151863)

2025-08-05 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/151863 ___ 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 new check 'llvm-use-ranges' (PR #152047)

2025-08-05 Thread Baranov Victor via cfe-commits
vbvictor wrote: > Thank you for coming up with this! It might be a very hacky thing to say, but > could we exclude `llvm::sort` from the list? Changing `std::sort` to > `llvm::sort` sometimes changes the underlying sort algorithm, and that breaks > the order of "tie" elements. That in turn bre

[clang-tools-extra] [clang-tidy] Add new check 'llvm-use-ranges' (PR #152047)

2025-08-05 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/152047 >From 070a713efb6e860fd7d5b0af2d2b8e4fe35ff196 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Tue, 5 Aug 2025 01:15:02 +0300 Subject: [PATCH 1/2] [clang-tidy] Add new check 'llvm-use-ranges' --- .../clan

[clang-tools-extra] Reland "[clang-tidy] fix bugprone-narrowing-conversions false positive for conditional expression" (PR #151874)

2025-08-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/151874 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang-tidy] Avoid matching nodes in system headers (PR #151035)

2025-08-03 Thread Baranov Victor via cfe-commits
@@ -1336,6 +1336,44 @@ class MatchASTVisitor : public RecursiveASTVisitor, return false; } + template static SourceLocation getNodeLocation(const T &Node) { +return Node.getBeginLoc(); + } + + static SourceLocation getNodeLocation(const QualType &Node) { return

[clang-tools-extra] [NFC][run-clang-tidy] Add minor type hints (PR #151873)

2025-08-03 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM, thanks! Indeed, CI checks could be helpful https://github.com/llvm/llvm-project/pull/151873 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[clang] [clang-tools-extra] [flang] [lldb] [llvm] [NFC] Fix `assignment` typo. (PR #151864)

2025-08-03 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/151864 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][docs][NFC] Make uniform "Limitations" sections across all checks (PR #151863)

2025-08-03 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/151863 None >From d1bd9c4f5b004397653e7d0a1668c74422cf847a Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Sun, 3 Aug 2025 15:54:21 +0300 Subject: [PATCH] [clang-tidy][docs][NFC] Make uniform "Limitations" sectio

[clang-tools-extra] [clang-tidy][docs][NFC] Add limitation of variable lifetimes in performance-unnecessary-copy-initialization (PR #151862)

2025-08-03 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/151862 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][NFC][docs] Add limitation of variable lifetimes in performance-unnecessary-copy-initialization (PR #151862)

2025-08-03 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/151862 Addresses https://github.com/llvm/llvm-project/issues/150189. >From 9ac52ed93d36d03bd347c477edbb07c20395d6cc Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Sun, 3 Aug 2025 15:35:01 +0300 Subject: [PATCH]

[clang-tools-extra] [clang-tidy] Fix bugprone-tagged-union-member-count false-positive (PR #135831)

2025-08-03 Thread Baranov Victor via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=, =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=, =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=, =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?Message-ID: In-Reply-To: https://git

[clang-tools-extra] [clang-tidy] fix `bugprone-narrowing-conversions` false positive for conditional expression (PR #139474)

2025-08-03 Thread Baranov Victor via cfe-commits
vbvictor wrote: Please, investigate this issue and when re-applying the reverted patch, commit message should be updated to indicate the problem that was addressed and how it was addressed. https://llvm.org/docs/DeveloperPolicy.html#patch-reversion-policy https://github.com/llvm/llvm-project/

[clang-tools-extra] Revert "[clang-tidy] fix `bugprone-narrowing-conversions` false positive for conditional expression" (PR #151859)

2025-08-03 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/151859 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Revert "[clang-tidy] fix `bugprone-narrowing-conversions` false positive for conditional expression" (PR #151859)

2025-08-03 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/151859 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Revert "[clang-tidy] fix `bugprone-narrowing-conversions` false positive for conditional expression" (PR #151859)

2025-08-03 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/151859 Reverts llvm/llvm-project#139474 due to lit failures on `arm` platforms. >From 858e6ae29b80ee992d60cfba199938934db2ea5f Mon Sep 17 00:00:00 2001 From: Baranov Victor Date: Sun, 3 Aug 2025 13:57:11 +0300 Subjec

[clang-tools-extra] [clang-tidy] fix `bugprone-narrowing-conversions` false positive for conditional expression (PR #139474)

2025-08-03 Thread Baranov Victor via cfe-commits
vbvictor wrote: It seems we are having issues on arm platforms, I need to revert this patch. https://github.com/llvm/llvm-project/pull/139474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang-tools-extra] [clang-tidy] fix `bugprone-narrowing-conversions` false positive for conditional expression (PR #139474)

2025-08-03 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/139474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][NFC] Enable 'performance-move-const-arg' in '.clang-tidy' config (PR #148549)

2025-08-03 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/148549 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][NFC] Enable 'performance-move-const-arg' in '.clang-tidy' config (PR #148549)

2025-08-03 Thread Baranov Victor via cfe-commits
vbvictor wrote: Merging it as is with `CheckTriviallyCopyableMove: false`. We can always put `CheckTriviallyCopyableMove: true` in the future and fix the remaining warnings. https://github.com/llvm/llvm-project/pull/148549 ___ cfe-commits mailing list

[clang] [clang-tools-extra] [clang-tidy] Avoid matching nodes in system headers (PR #151035)

2025-08-03 Thread Baranov Victor via cfe-commits
vbvictor wrote: Benchmark of whole LLVM with new option `-enable-check-profile` in `run-clang-tidy`: Without this patch: ``` ===-=== clang-tidy checks profiling ===--

[clang-tools-extra] [clang-tidy] Add 'enable-check-profiling' with aggregated results to 'run-clang-tidy' (PR #151011)

2025-08-03 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/151011 ___ 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 'enable-check-profiling' with aggregated results to 'run-clang-tidy' (PR #151011)

2025-08-03 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/151011 >From 65a04c0b903243bbc854477075b8e9e1a62fdfeb Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 28 Jul 2025 21:12:04 +0300 Subject: [PATCH 1/5] [clang-tidy] Add 'enable-check-profiling' with aggregated

[clang] [clang-tools-extra] [clang-tidy] Avoid matching nodes in system headers (PR #151035)

2025-08-02 Thread Baranov Victor via cfe-commits
vbvictor wrote: > As a benchmark, I ran clang-tidy with all checks activated, on a single .cpp > file which #includes all the standard C++ headers, then measure the time as > well as found warnings. Could you please save this file (or make a gist) for later. I think we could have some benchma

[clang-tools-extra] [clang-tidy] Use llvm::none_of (NFC) (PR #151801)

2025-08-02 Thread Baranov Victor via cfe-commits
vbvictor wrote: Or maybe you already use a hand-made check yourself? https://github.com/llvm/llvm-project/pull/151801 ___ 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::none_of (NFC) (PR #151801)

2025-08-02 Thread Baranov Victor via cfe-commits
vbvictor wrote: As a side note, should we create a clang-tidy check to detect these cases automatically: to use `llvm` algorithms instead of `std` and so on? Is it documented that we should always prefer the `llvm` version? I see a lot of work by @kazutakahirata and wish to make it future-proof

[clang-tools-extra] [clang-tidy] Skip declarations in system headers in RenamerClangTidyC… (PR #151772)

2025-08-02 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. https://github.com/llvm/llvm-project/pull/151772 ___ 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::none_of (NFC) (PR #151801)

2025-08-02 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. https://github.com/llvm/llvm-project/pull/151801 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][NFC] Enable `readability-avoid-return-with-void-value` check in the codebase (PR #151356)

2025-08-01 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/151356 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][NFC] Enable `readability-avoid-return-with-void-value` check in the codebase (PR #151356)

2025-07-30 Thread Baranov Victor via cfe-commits
@@ -577,19 +579,26 @@ void NarrowingConversionsCheck::handleImplicitCast( SourceLocation SourceLoc = Lhs.getExprLoc(); switch (Cast.getCastKind()) { case CK_BooleanToSignedIntegral: -return handleBooleanToSignedIntegral(Context, SourceLoc, Lhs, Rhs); +handleBoolea

[clang-tools-extra] [clang-tidy][NFC] Enable `readability-avoid-return-with-void-value` check in the codebase (PR #151356)

2025-07-30 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/151356 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][NFC] Enable `readability-avoid-return-with-void-value` check in the codebase (PR #151356)

2025-07-30 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. Thank you for working on this! LGTM with couple nits https://github.com/llvm/llvm-project/pull/151356 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang-tools-extra] [clang-tidy] Fix bugprone-tagged-union-member-count false-positive (PR #135831)

2025-07-30 Thread Baranov Victor via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=, =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=, =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=, =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?Message-ID: In-Reply-To: vbvictor wr

[clang-tools-extra] [clang-tidy] Fix bugprone-tagged-union-member-count false-positive (PR #135831)

2025-07-30 Thread Baranov Victor via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=, =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=, =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=, =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?Message-ID: In-Reply-To: https://git

[clang-tools-extra] [clang-tidy] Add 'enable-check-profiling' with aggregated results to 'run-clang-tidy' (PR #151011)

2025-07-28 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/151011 >From 65a04c0b903243bbc854477075b8e9e1a62fdfeb Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 28 Jul 2025 21:12:04 +0300 Subject: [PATCH 1/4] [clang-tidy] Add 'enable-check-profiling' with aggregated

[clang-tools-extra] [clang-tidy] Add 'enable-check-profiling' with aggregated results to 'run-clang-tidy' (PR #151011)

2025-07-28 Thread Baranov Victor via cfe-commits
@@ -178,6 +182,122 @@ def merge_replacement_files(tmpdir: str, mergefile: str) -> None: open(mergefile, "w").close() +def aggregate_profiles(profile_dir: str) -> Dict[str, float]: +"""Aggregate timing data from multiple profile JSON files""" +aggregated: Dict

[clang-tools-extra] [clang-tidy] Add 'enable-check-profiling' with aggregated results to 'run-clang-tidy' (PR #151011)

2025-07-28 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/151011 >From 65a04c0b903243bbc854477075b8e9e1a62fdfeb Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 28 Jul 2025 21:12:04 +0300 Subject: [PATCH 1/3] [clang-tidy] Add 'enable-check-profiling' with aggregated

[clang-tools-extra] [clang-tidy] Add 'enable-check-profiling' with aggregated results to 'run-clang-tidy' (PR #151011)

2025-07-28 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/151011 >From 65a04c0b903243bbc854477075b8e9e1a62fdfeb Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 28 Jul 2025 21:12:04 +0300 Subject: [PATCH 1/2] [clang-tidy] Add 'enable-check-profiling' with aggregated

[clang] [clang-tools-extra] [clang-tidy] Avoid matching nodes in system headers (PR #151035)

2025-07-28 Thread Baranov Victor via cfe-commits
@@ -1336,6 +1336,45 @@ class MatchASTVisitor : public RecursiveASTVisitor, return false; } + bool isInSystemHeader(const SourceLocation &Loc) { +const SourceManager &SM = getASTContext().getSourceManager(); +return SM.isInSystemHeader(Loc); + } + + template

[clang] [clang-tools-extra] [clang-tidy] Avoid matching nodes in system headers (PR #151035)

2025-07-28 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/151035 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang-tidy] Avoid matching nodes in system headers (PR #151035)

2025-07-28 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: Thank you for working on this! Left a couple of NFC comments on style https://github.com/llvm/llvm-project/pull/151035 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang] [clang-tools-extra] [clang-tidy] Avoid matching nodes in system headers (PR #151035)

2025-07-28 Thread Baranov Victor via cfe-commits
@@ -1336,6 +1336,45 @@ class MatchASTVisitor : public RecursiveASTVisitor, return false; } + bool isInSystemHeader(const SourceLocation &Loc) { +const SourceManager &SM = getASTContext().getSourceManager(); +return SM.isInSystemHeader(Loc); + } + + template

[clang-tools-extra] [clang-tidy] Add 'enable-check-profiling' with aggregated results to 'run-clang-tidy' (PR #151011)

2025-07-28 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/151011 Add new option `enable-check-profiling` to `run-clang-tidy` for seamless integration of `clang-tidy`'s `enable-check-profiling` option. `run-clang-tidy` will post aggregated results report in the same style as

[clang-tools-extra] [clang-tidy] Add `-std` argument in `check_clang_tidy.py` for C files (PR #150791)

2025-07-28 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM, but I think we should wait for a second approve for some time. It's a kind-of big change and improvement for tests. https://github.com/llvm/llvm-project/pull/150791 ___ cfe-commits mailing

[clang-tools-extra] [clang-tidy] Add `-std` argument in `check_clang_tidy.py` for C files (PR #150791)

2025-07-28 Thread Baranov Victor via cfe-commits
@@ -1,6 +1,5 @@ -// RUN: %check_clang_tidy %s readability-magic-numbers %t -- +// RUN: %check_clang_tidy -std=c23-or-later %s readability-magic-numbers %t // Don't crash _BitInt(128) A = 4533629751480627964421wb; -// CHECK-MESSAGES: warning vbvictor wrote:

[clang-tools-extra] [clang-tidy] Add `IgnoreAliasing` option to `readability-qualified-auto check` (PR #147060)

2025-07-28 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/147060 ___ 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 `IgnoreAliasing` option to `readability-qualified-auto check` (PR #147060)

2025-07-28 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] added `IgnoreAliasing` option to `readability-qualified-auto check` (PR #147060)

2025-07-28 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][mlir] Make rewrite more conservative. (PR #150757)

2025-07-28 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM with nit https://github.com/llvm/llvm-project/pull/150757 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][mlir] Make rewrite more conservative. (PR #150757)

2025-07-28 Thread Baranov Victor via cfe-commits
@@ -69,4 +69,7 @@ void f() { // CHECK-MESSAGES: :[[@LINE+2]]:3: warning: use 'OpType::create(builder, ...)' instead of 'builder.create(...)' [llvm-use-new-mlir-op-builder] // CHECK-FIXES: mlir::ModuleOp::create(ib) ib.create( ); + + // CHECK-MESSAGES: :[[@LINE+1]]:3:

[clang-tools-extra] [clang-tidy][mlir] Make rewrite more conservative. (PR #150757)

2025-07-28 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/150757 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] added `IgnoreAliasing` option to `readability-qualified-auto check` (PR #147060)

2025-07-28 Thread Baranov Victor via cfe-commits
vbvictor wrote: Could you please change email in GitHub from private to public? We have a policy on it: https://llvm.org/docs/DeveloperPolicy.html#email-addresses https://github.com/llvm/llvm-project/pull/147060 ___ cfe-commits mailing list cfe-commit

[clang-tools-extra] [clang-tidy] Add handling of type aliases in `use-designated-initializers` check (PR #150842)

2025-07-27 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/150842 ___ 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 handling of type aliases in `use-designated-initializers` check (PR #150842)

2025-07-27 Thread Baranov Victor via cfe-commits
@@ -224,3 +224,22 @@ std::array a{1,2,3}; std::array b{10, 11}; using array = std::array; array c{10, 11}; + vbvictor wrote: I think this still needs case like `S18 s183{.a=1, .b=2} // no warning at all` Probably good to have one nested like ```cpp struct S20

[clang-tools-extra] [clang-tidy] Take type aliases into account (PR #150842)

2025-07-27 Thread Baranov Victor via cfe-commits
@@ -224,3 +224,22 @@ std::array a{1,2,3}; std::array b{10, 11}; using array = std::array; array c{10, 11}; + +struct S16 { +int a; +int b; +}; + +using S17 = S16; + +S17 s171{1, 2}; vbvictor wrote: Just to double check, there are no fix-its for aliases

[clang-tools-extra] [clang-tidy] Take type aliases into account (PR #150842)

2025-07-27 Thread Baranov Victor via cfe-commits
@@ -224,3 +224,22 @@ std::array a{1,2,3}; std::array b{10, 11}; using array = std::array; array c{10, 11}; + vbvictor wrote: Please add tests with: - alias with all fields using designated-init - alias with some field using designated-init https://github.com

[clang-tools-extra] [clang-tidy] Take type aliases into account (PR #150842)

2025-07-27 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: Please add release notes and check name in PR title like "Add handling of type aliases in use-designated-initializers" https://github.com/llvm/llvm-project/pull/150842 ___ cfe-commits mailing list cfe-commits@lis

[clang-tools-extra] [clang-tidy] Take type aliases into account (PR #150842)

2025-07-27 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/150842 ___ 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 `-std` argument in `check_clang_tidy.py` for C files (PR #150791)

2025-07-27 Thread Baranov Victor via cfe-commits
@@ -5,14 +5,14 @@ // parsing and preprocessor state will not have that case. // UNSUPPORTED: target={{.*-(ps4|ps5)}} // -// RUN: %check_clang_tidy -check-suffix=WITH-ANNEX-K%s bugprone-unsafe-functions %t -- -- -D__STDC_LIB_EXT1__=1 -D__STDC_WANT_LIB_EXT1__=1 -//

[clang-tools-extra] [clang-tidy] Add `-std` argument in `check_clang_tidy.py` for C files (PR #150791)

2025-07-27 Thread Baranov Victor via cfe-commits
@@ -1,6 +1,5 @@ -// RUN: %check_clang_tidy %s readability-magic-numbers %t -- +// RUN: %check_clang_tidy -std=c23-or-later %s readability-magic-numbers %t // Don't crash _BitInt(128) A = 4533629751480627964421wb; -// CHECK-MESSAGES: warning vbvictor wrote:

[clang-tools-extra] [clang-tidy] Add `-std` argument in `check_clang_tidy.py` for C files (PR #150791)

2025-07-27 Thread Baranov Victor via cfe-commits
@@ -5,14 +5,14 @@ // parsing and preprocessor state will not have that case. // UNSUPPORTED: target={{.*-(ps4|ps5)}} // -// RUN: %check_clang_tidy -check-suffix=WITH-ANNEX-K%s bugprone-unsafe-functions %t -- -- -D__STDC_LIB_EXT1__=1 -D__STDC_WANT_LIB_EXT1__=1 -//

[clang-tools-extra] [clang-tidy] Add `-std` argument in `check_clang_tidy.py` for C files (PR #150791)

2025-07-27 Thread Baranov Victor via cfe-commits
@@ -19,13 +18,16 @@ void notRelated(int A, int B) {} int addedTogether(int A, int B) { return add(A, B); } // NO-WARN: Passed to same function. +// FIXME: This triggers a false positive: the "passed to same function" heuristic +// can't map the parameter index 1 to A and B

[clang-tools-extra] [clang-tidy] Add `-std` argument in `check_clang_tidy.py` for C files (PR #150791)

2025-07-27 Thread Baranov Victor via cfe-commits
@@ -19,13 +18,16 @@ void notRelated(int A, int B) {} int addedTogether(int A, int B) { return add(A, B); } // NO-WARN: Passed to same function. +// FIXME: This triggers a false positive: the "passed to same function" heuristic +// can't map the parameter index 1 to A and B

[clang-tools-extra] [clang-tidy] Add `-std` argument in `check_clang_tidy.py` for C files (PR #150791)

2025-07-27 Thread Baranov Victor via cfe-commits
@@ -374,15 +373,25 @@ def parse_arguments() -> Tuple[argparse.Namespace, List[str]]: parser.add_argument( "-std", type=csv, -default=["c++11-or-later"], +default=None, help="Passed to clang. Special -or-later values are expanded.",

[clang-tools-extra] [clang-tidy] Stop ignoring `-std` argument in `check_clang_tidy.py` for C files (PR #150791)

2025-07-26 Thread Baranov Victor via cfe-commits
@@ -5,14 +5,14 @@ // parsing and preprocessor state will not have that case. // UNSUPPORTED: target={{.*-(ps4|ps5)}} // -// RUN: %check_clang_tidy -check-suffix=WITH-ANNEX-K%s bugprone-unsafe-functions %t -- -- -D__STDC_LIB_EXT1__=1 -D__STDC_WANT_LIB_EXT1__=1 -//

[clang-tools-extra] [clang-tidy] Stop ignoring `-std` argument in `check_clang_tidy.py` for C files (PR #150791)

2025-07-26 Thread Baranov Victor via cfe-commits
@@ -19,13 +18,16 @@ void notRelated(int A, int B) {} int addedTogether(int A, int B) { return add(A, B); } // NO-WARN: Passed to same function. +// FIXME: This triggers a false positive: the "passed to same function" heuristic +// can't map the parameter index 1 to A and B

[clang-tools-extra] [clang-tidy] Stop ignoring `-std` argument in `check_clang_tidy.py` for C files (PR #150791)

2025-07-26 Thread Baranov Victor via cfe-commits
@@ -374,15 +373,25 @@ def parse_arguments() -> Tuple[argparse.Namespace, List[str]]: parser.add_argument( "-std", type=csv, -default=["c++11-or-later"], +default=None, help="Passed to clang. Special -or-later values are expanded.",

[clang-tools-extra] [clang-tidy] Stop ignoring `-std` argument in `check_clang_tidy.py` for C files (PR #150791)

2025-07-26 Thread Baranov Victor via cfe-commits
@@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s readability-non-const-parameter %t +// RUN: %check_clang_tidy -std=c99,c11,c17 %s readability-non-const-parameter %t vbvictor wrote: It didn't work with c23? Please leave a fixme. https://github.com/llvm/llvm-projec

[clang-tools-extra] [clang-tidy] Stop ignoring `-std` argument in `check_clang_tidy.py` for C files (PR #150791)

2025-07-26 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/150791 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Stop ignoring `-std` argument in `check_clang_tidy.py` for C files (PR #150791)

2025-07-26 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: Thank you for working on this. This change is worth ReleaseNotes IMO, you could add them, we had [release notes ](https://github.com/llvm/llvm-project/blob/release/21.x/clang-tools-extra/docs/ReleaseNotes.rst#improvements-to-clang-tidy)for change in `chec

[clang-tools-extra] [clang-tidy] Teach `readability-uppercase-literal-suffix` about C++23 and C23 suffixes (PR #148275)

2025-07-26 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,162 @@ +// TODO: When Clang adds support for decimal floating point types, enable these tests by: +//1. Removing all the #if 0 + #endif guards. +//2. Removing all occurrences of the string "DISABLED-" in this file. +//3. Deleting this message. + +// RUN: %c

[clang-tools-extra] [clang-tidy] Teach `readability-uppercase-literal-suffix` about C++23 and C23 suffixes (PR #148275)

2025-07-26 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,162 @@ +// TODO: When Clang adds support for decimal floating point types, enable these tests by: +//1. Removing all the #if 0 + #endif guards. +//2. Removing all occurrences of the string "DISABLED-" in this file. +//3. Deleting this message. + +// RUN: %c

[clang-tools-extra] [clang-tidy] Add MLIR check for old op builder usage. (PR #149148)

2025-07-25 Thread Baranov Victor via cfe-commits
vbvictor wrote: > @EugeneZelenko i am also seeing downstream failures same as above noted by > buildbots, could you revert and fix ? Hi, could you share build logs/link if you can? First fail seems unrelated to the PR. On second I don't see exactly that this new check fails buildbot, seems mo

[clang] [analyzer] Fix crash on compound literals with bitfields in unions (PR #146418)

2025-07-25 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/146418 >From c1083bbdd281a686a6d38585ac201735f244090f Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 30 Jun 2025 23:34:33 +0300 Subject: [PATCH 1/3] [analyzer] Fix crash on compound literals with bitfields

[clang] [analyzer] Fix crash on compound literals with bitfields in unions (PR #146418)

2025-07-25 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/146418 >From 3611049b862e1738237c0092f1e13c08f409663f Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 30 Jun 2025 23:34:33 +0300 Subject: [PATCH 1/3] [analyzer] Fix crash on compound literals with bitfields

[clang-tools-extra] [clang-tidy] fix `bugprone-narrowing-conversions` false positive for conditional expression (PR #139474)

2025-07-25 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM, please rebase on latest main, ReleaseNotes were cleared after 21th release. After that, could be merged. https://github.com/llvm/llvm-project/pull/139474 ___ cfe-commits mailing list cfe-co

[clang-tools-extra] [clang-tidy] Add parallel execution by default in 'run-clang-tidy' and 'clang-tidy-diff' (PR #149739)

2025-07-24 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/149739 ___ 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 parallel execution by default in 'run-clang-tidy' and 'clang-tidy-diff' (PR #149739)

2025-07-24 Thread Baranov Victor via cfe-commits
vbvictor wrote: I will make the renaming on the next PR. https://github.com/llvm/llvm-project/pull/149739 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] modernize-use-std-print, format: Fix checks with Abseil functions (PR #142312)

2025-07-24 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/142312 ___ 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 bugprone-tagged-union-member-count false-positive (PR #135831)

2025-07-24 Thread Baranov Victor via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=, =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=, =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: @@ -110,6 +110,19 @@ Changes in existing checks ` check by fixin

[clang-tools-extra] [clang-tidy] added `IgnoreAliasing` option to `readability-qualified-auto check` (PR #147060)

2025-07-24 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/147060 ___ 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 MLIR check for old op builder usage. (PR #149148)

2025-07-24 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/149148 ___ 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 MLIR check for old op builder usage. (PR #149148)

2025-07-24 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/149148 ___ 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 MLIR check for old op builder usage. (PR #149148)

2025-07-24 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/149148 ___ 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 MLIR check for old op builder usage. (PR #149148)

2025-07-24 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/149148 ___ 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 MLIR check for old op builder usage. (PR #149148)

2025-07-24 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/149148 ___ 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 MLIR check for old op builder usage. (PR #149148)

2025-07-24 Thread Baranov Victor via cfe-commits
@@ -29,6 +30,8 @@ class LLVMModule : public ClangTidyModule { "llvm-else-after-return"); CheckFactories.registerCheck("llvm-header-guard"); CheckFactories.registerCheck("llvm-include-order"); +CheckFactories.registerCheck( +"llvm-use-new-mlir-op-buil

[clang-tools-extra] [clang-tidy] Add MLIR check for old op builder usage. (PR #149148)

2025-07-24 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,132 @@ +//===--- MLIROpBuilderCheck.cpp - clang-tidy --===// vbvictor wrote: ```suggestion //===--- UseNewMLIROpBuilderCheck.cpp - clang-tidy ===// ``` https://github.com/llvm/llvm-project/pull/1491

[clang-tools-extra] [clang-tidy] Add MLIR check for old op builder usage. (PR #149148)

2025-07-24 Thread Baranov Victor via cfe-commits
@@ -14,6 +14,7 @@ #include "../readability/QualifiedAutoCheck.h" #include "HeaderGuardCheck.h" #include "IncludeOrderCheck.h" +#include "MLIROpBuilderCheck.h" vbvictor wrote: Please rename `MLIROpBuilderCheck.h` -> `UseNewMLIROpBuilderCheck.h` And make in alph

[clang-tools-extra] [clang-tidy] Add MLIR check for old op builder usage. (PR #149148)

2025-07-24 Thread Baranov Victor via cfe-commits
@@ -7,6 +7,7 @@ add_clang_library(clangTidyLLVMModule STATIC HeaderGuardCheck.cpp IncludeOrderCheck.cpp LLVMTidyModule.cpp + MLIROpBuilderCheck.cpp vbvictor wrote: Please rename `MLIROpBuilderCheck.cpp` -> `UseNewMLIROpBuilderCheck.cpp` And make in alph

[clang-tools-extra] [clang-tidy] Add MLIR check for old op builder usage. (PR #149148)

2025-07-24 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: Please rename all files/classes to use `UseNewMLIROpBuilder` as the new check name, otherwise LGTM https://github.com/llvm/llvm-project/pull/149148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

[clang-tools-extra] [clang-tidy] Fix false positives in `bugprone-signed-char-misuse` (PR #149790)

2025-07-24 Thread Baranov Victor via cfe-commits
=?utf-8?q?Bj=C3=B6rn?= Svensson , =?utf-8?q?Bj=C3=B6rn?= Svensson , =?utf-8?q?Bj=C3=B6rn?= Svensson Message-ID: In-Reply-To: https://github.com/vbvictor approved this pull request. https://github.com/llvm/llvm-project/pull/149790 ___ cfe-commits mai

[clang-tools-extra] [clang-tidy] Fix false positives in `bugprone-signed-char-misuse` (PR #149790)

2025-07-24 Thread Baranov Victor via cfe-commits
=?utf-8?q?Björn?= Svensson , =?utf-8?q?Björn?= Svensson , =?utf-8?q?Björn?= Svensson Message-ID: In-Reply-To: vbvictor wrote: > Hum, the release notes seems to have been cleared again, and I think there > are some entries lost. I now see that some of the release notes are recovered > so I'll

[clang-tools-extra] [clang-tools-extra][Docs][NFC] Add back lost release notes (PR #150409)

2025-07-24 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/150409 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tools-extra][Docs][NFC] Add back lost release notes (PR #150409)

2025-07-24 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/150409 >From 79a34ab58726b563f1dfc4c9850bd317f93065fd Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Thu, 24 Jul 2025 14:54:49 +0300 Subject: [PATCH 1/3] [clang-tools-extra][Docs] Add back lost release notes ---

[clang-tools-extra] [clang-tools-extra][Docs][NFC] Add back lost release notes (PR #150409)

2025-07-24 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/150409 >From 79a34ab58726b563f1dfc4c9850bd317f93065fd Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Thu, 24 Jul 2025 14:54:49 +0300 Subject: [PATCH 1/2] [clang-tools-extra][Docs] Add back lost release notes ---

[clang-tools-extra] [clang-tools-extra][Docs][NFC] Add back lost release notes (PR #150409)

2025-07-24 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/150409 When release notes were cleared on ``main``, clang-tools-extra project already cleared release notes and commit 3d8db8ef50b7e59d5a1943ddc14597327eff88fd flushed them. This patch restores those release notes.

[clang-tools-extra] [clang-tidy] Add parallel execution by default in 'run-clang-tidy' and 'clang-tidy-diff' (PR #149739)

2025-07-23 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/149739 >From cb439cc703699279f690d6a4d0497a60ebfa4c08 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 21 Jul 2025 00:06:26 +0300 Subject: [PATCH 1/2] [clang-tidy] Add parallel execution by default in 'run-cl

  1   2   3   4   5   6   7   8   9   10   >