[clang] [clang-tools-extra] [lldb] [llvm] [mlir] A couple of grammar fixes (PR #144368)

2025-07-11 Thread Baranov Victor via cfe-commits
vbvictor wrote: Please write PR description more specific and add (NFC) at the end. Could be: "Fix typos 'seperate' -> 'separate' (NFC)" https://github.com/llvm/llvm-project/pull/144368 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://li

[clang-tools-extra] [clang-tidy][readability-named-parameter] Add an option to print names without comment (PR #147953)

2025-07-11 Thread Baranov Victor via cfe-commits
vbvictor wrote: nit: we typically not write check name in `[]` in the title, the title should be `[clang-tidy] Add an option in 'readability-named-parameter' to print names without comment` https://github.com/llvm/llvm-project/pull/147953 ___ cfe-comm

[clang-tools-extra] [clang-tidy] Add portability-avoid-platform-specific-fundamental-types (PR #146970)

2025-07-10 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,254 @@ +//===--- AvoidPlatformSpecificFundamentalTypesCheck.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: Ap

[clang-tools-extra] [clang-tidy] Add portability-avoid-platform-specific-fundamental-types (PR #146970)

2025-07-10 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,254 @@ +//===--- AvoidPlatformSpecificFundamentalTypesCheck.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: Ap

[clang-tools-extra] [clang-tidy] Add portability-avoid-platform-specific-fundamental-types (PR #146970)

2025-07-10 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,254 @@ +//===--- AvoidPlatformSpecificFundamentalTypesCheck.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: Ap

[clang-tools-extra] [clang-tidy] Add portability-avoid-platform-specific-fundamental-types (PR #146970)

2025-07-10 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,254 @@ +//===--- AvoidPlatformSpecificFundamentalTypesCheck.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: Ap

[clang-tools-extra] [clang-tidy] Add portability-avoid-platform-specific-fundamental-types (PR #146970)

2025-07-10 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,254 @@ +//===--- AvoidPlatformSpecificFundamentalTypesCheck.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: Ap

[clang-tools-extra] [clang-tidy] Add portability-avoid-platform-specific-fundamental-types (PR #146970)

2025-07-10 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,254 @@ +//===--- AvoidPlatformSpecificFundamentalTypesCheck.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: Ap

[clang-tools-extra] [clang-tidy] Add portability-avoid-platform-specific-fundamental-types (PR #146970)

2025-07-10 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,69 @@ +// RUN: %check_clang_tidy -std=c++11-or-later %s portability-avoid-platform-specific-fundamental-types %t -- -config="{CheckOptions: [{key: portability-avoid-platform-specific-fundamental-types.WarnOnInts, value: false}, {key: portability-avoid-platform-spec

[clang-tools-extra] [clang-tidy] Add portability-avoid-platform-specific-fundamental-types (PR #146970)

2025-07-10 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,69 @@ +// RUN: %check_clang_tidy -std=c++11-or-later %s portability-avoid-platform-specific-fundamental-types %t -- -config="{CheckOptions: [{key: portability-avoid-platform-specific-fundamental-types.WarnOnInts, value: false}, {key: portability-avoid-platform-spec

[clang-tools-extra] [clang-tidy] Add portability-avoid-platform-specific-fundamental-types (PR #146970)

2025-07-10 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,50 @@ +//==-- AvoidPlatformSpecificFundamentalTypesCheck.h - clang-tidy -*- C++ -*-==// +// +// 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: Apa

[clang-tools-extra] [clang-tidy] Add portability-avoid-platform-specific-fundamental-types (PR #146970)

2025-07-10 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,254 @@ +//===--- AvoidPlatformSpecificFundamentalTypesCheck.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: Ap

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

2025-07-11 Thread Baranov Victor via cfe-commits
vbvictor wrote: > In this case when looking at the type of Data the IntPtr type does not > appear, only int* This is a known "problem" of clang with preserving type sugar. TL;DR currently there is no way to get `IntPtr` as you need. There is work in progress to preserve `IntPtr` through all AS

[clang-tools-extra] [clang-tidy] Teach `cppcoreguidelines-interfaces-global-init` about `constinit` (PR #148334)

2025-07-11 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor requested changes to this pull request. https://github.com/llvm/llvm-project/pull/148334 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Teach `cppcoreguidelines-interfaces-global-init` about `constinit` (PR #148334)

2025-07-11 Thread Baranov Victor via cfe-commits
@@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s cppcoreguidelines-interfaces-global-init %t +// RUN: %check_clang_tidy -std=c++20 %s cppcoreguidelines-interfaces-global-init %t vbvictor wrote: We shouldn't increase standard here because we still want to check that

[clang-tools-extra] [clang-tidy] Teach `cppcoreguidelines-interfaces-global-init` about `constinit` (PR #148334)

2025-07-11 Thread Baranov Victor via cfe-commits
@@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s cppcoreguidelines-interfaces-global-init %t +// RUN: %check_clang_tidy -std=c++20 %s cppcoreguidelines-interfaces-global-init %t vbvictor wrote: Yes, we could do guards https://github.com/llvm/llvm-project/pull/1483

[clang-tools-extra] [clang-tidy] Teach `cppcoreguidelines-interfaces-global-init` about `constinit` (PR #148334)

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

[clang] [Clang] Improve diagnostics for 'placement new' with const storage argument (PR #144270)

2025-07-11 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/144270 ___ 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-prefer-static-over-anonymous-namespace` (PR #142839)

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

[clang-tools-extra] [clang-tidy] `misc-confusable-identifiers`: Update `confusables.txt` (PR #148399)

2025-07-12 Thread Baranov Victor via cfe-commits
vbvictor wrote: Is this file taken as-is from some place or crafted by hand? Could you share a source? https://github.com/llvm/llvm-project/pull/148399 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr for use-integer-sign-comparison (PR #144240)

2025-07-12 Thread Baranov Victor via cfe-commits
@@ -91,7 +93,8 @@ void UseIntegerSignComparisonCheck::storeOptions( void UseIntegerSignComparisonCheck::registerMatchers(MatchFinder *Finder) { const auto SignedIntCastExpr = intCastExpression(true, "sIntCastExpression"); - const auto UnSignedIntCastExpr = intCastExpression

[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr for use-integer-sign-comparison (PR #144240)

2025-07-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: Could you add more tests, e.g. when we have "inverted" casts in GH127471 like this: ```cpp (unsigned int)a2.size() == size() //size() return int ``` I believe we could also be add more tests with different type of casts in GH127471 case. https://github.c

[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr for use-integer-sign-comparison (PR #144240)

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

[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr for use-integer-sign-comparison (PR #144240)

2025-07-12 Thread Baranov Victor via cfe-commits
@@ -39,21 +39,23 @@ intCastExpression(bool IsSigned, // std::cmp_{} functions trigger a compile-time error if either LHS or RHS // is a non-integer type, char, enum or bool // (unsigned char/ signed char are Ok and can be used). - auto IntTypeExpr = expr(hasType(hasCanon

[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr for use-integer-sign-comparison (PR #144240)

2025-07-12 Thread Baranov Victor via cfe-commits
@@ -112,14 +115,17 @@ void UseIntegerSignComparisonCheck::registerPPCallbacks( void UseIntegerSignComparisonCheck::check( const MatchFinder::MatchResult &Result) { const auto *SignedCastExpression = - Result.Nodes.getNodeAs("sIntCastExpression"); - assert(SignedCast

[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr for use-integer-sign-comparison (PR #144240)

2025-07-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/144240 ___ 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 filtering of check options by enabled checks in '--dump-config' (PR #147142)

2025-07-13 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/147142 >From d70b792ece6709b7a68baf116c0895394c71fd16 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Sat, 5 Jul 2025 15:12:04 +0300 Subject: [PATCH 1/2] [clang-tidy] filter check options by enabled checks in '--

[clang-tools-extra] [clang-tidy] Add filtering of check options by enabled checks in '--dump-config' (PR #147142)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -503,6 +503,21 @@ getCheckNames(const ClangTidyOptions &Options, return Factory.getCheckNames(); } +void filterCheckOptions(ClangTidyOptions &Options, +const std::vector &EnabledChecks) { + StringSet<> EnabledChecksSet(llvm::from_range, EnabledChe

[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr for use-integer-sign-comparison (PR #144240)

2025-07-12 Thread Baranov Victor via cfe-commits
vbvictor wrote: > > I will take a look at the weekend. > > No Rush, enjoy your weekend 😸 Thanks! But that's the only time I can thoughtfully read other code apart from main job 🙃 https://github.com/llvm/llvm-project/pull/144240 ___ cfe-commits maili

[clang-tools-extra] [clang-tidy] `misc-confusable-identifiers`: Update `confusables.txt` (PR #148399)

2025-07-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM. You should place verb in commit message in front so that the whole message would be like a sentence: "Update 'confusables.txt' in 'misc-confusable-identifiers'" That is the usual way of naming in LLVM (see other open PRs) https://git

[clang-tools-extra] [clang-tidy] Add filtering of check options by enabled checks in '--dump-config' (PR #147142)

2025-07-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147142 ___ 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][NFC] Fix link to code review in README.txt (PR #148384)

2025-07-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/148384 ___ 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: `readability-use-concise-preprocessor-directives` (PR #146830)

2025-07-14 Thread Baranov Victor via cfe-commits
vbvictor wrote: > A LLVM syncbot commit turned our buildbot red: > https://lab.llvm.org/buildbot/#/builders/123/builds/23254 > > The syncbot commit links to this PR. [edit] On a second look it looks more > like an infra issue on our end, I'll investigate. [/edit] Hi! Any logs/errors that are

[clang-tools-extra] [clang-tidy] Speed up `misc-header-include-cycle` (PR #148757)

2025-07-14 Thread Baranov Victor via cfe-commits
vbvictor wrote: Could you use `-enable-check-profile` and get a benchmark for standalone `clang-tidy` before and after the patch? https://clang.llvm.org/extra/clang-tidy/Contributing.html#on-checks-profiling https://github.com/llvm/llvm-project/pull/148757 _

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -332,19 +376,42 @@ void UseEmplaceCheck::check(const MatchFinder::MatchResult &Result) { }(); assert(Call && "No call matched"); - assert((CtorCall || MakeCall) && "No push_back parameter matched"); + assert((CtorCall || MakeCall || AggInitCall) && + "No push

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -332,19 +376,42 @@ void UseEmplaceCheck::check(const MatchFinder::MatchResult &Result) { }(); assert(Call && "No call matched"); - assert((CtorCall || MakeCall) && "No push_back parameter matched"); + assert((CtorCall || MakeCall || AggInitCall) && + "No push

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -1,4 +1,12 @@ -// RUN: %check_clang_tidy %s modernize-use-emplace %t -- \ +// RUN: %check_clang_tidy %s -std=c++11 modernize-use-emplace %t -- \ +// RUN: -config="{CheckOptions: \ +// RUN: {modernize-use-emplace.ContainersWithPushBack: \ +// RUN:':

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -1,4 +1,12 @@ -// RUN: %check_clang_tidy %s modernize-use-emplace %t -- \ +// RUN: %check_clang_tidy %s -std=c++11 modernize-use-emplace %t -- \ vbvictor wrote: ```suggestion // RUN: %check_clang_tidy %s -std=c++11,c++14,c++17 modernize-use-emplace %t -- \ ``

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -1434,3 +1436,33 @@ void testWithPointerTypes() { // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: unnecessary temporary object created while calling emplace // CHECK-FIXES: sp->emplace(); } + +namespace GH1225740 { vbvictor wrote: nit: After N years this

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -1434,3 +1436,33 @@ void testWithPointerTypes() { // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: unnecessary temporary object created while calling emplace // CHECK-FIXES: sp->emplace(); } + +namespace GH1225740 { + +void CXX20testBracedInitTemporaries(){ + + std::vector

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -1434,3 +1436,33 @@ void testWithPointerTypes() { // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: unnecessary temporary object created while calling emplace // CHECK-FIXES: sp->emplace(); } + +namespace GH1225740 { + +void CXX20testBracedInitTemporaries(){

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -1434,3 +1436,33 @@ void testWithPointerTypes() { // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: unnecessary temporary object created while calling emplace // CHECK-FIXES: sp->emplace(); } + +namespace GH1225740 { + +void CXX20testBracedInitTemporaries(){ + --

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -332,19 +376,42 @@ void UseEmplaceCheck::check(const MatchFinder::MatchResult &Result) { }(); assert(Call && "No call matched"); - assert((CtorCall || MakeCall) && "No push_back parameter matched"); + assert((CtorCall || MakeCall || AggInitCall) && + "No push

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -332,19 +376,42 @@ void UseEmplaceCheck::check(const MatchFinder::MatchResult &Result) { }(); assert(Call && "No call matched"); - assert((CtorCall || MakeCall) && "No push_back parameter matched"); + assert((CtorCall || MakeCall || AggInitCall) && + "No push

[clang-tools-extra] [clang-tidy] Improve `bugprone-exception-escape`: add stacktrace of escaped exception (PR #134375)

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

[clang-tools-extra] [clang-tidy] Improve `bugprone-exception-escape`: add stacktrace of escaped exception (PR #134375)

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

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

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

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-07-14 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: Tests lgtm, minor comments on code. Please rebase on fresh main https://github.com/llvm/llvm-project/pull/132924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-07-14 Thread Baranov Victor via cfe-commits
@@ -66,22 +89,45 @@ void AvoidCArraysCheck::registerMatchers(MatchFinder *Finder) { hasParent(varDecl(isExternC())), hasParent(fieldDecl( hasParent(recordDecl(isExternCContext(), -

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-07-14 Thread Baranov Victor via cfe-commits
@@ -66,22 +89,45 @@ void AvoidCArraysCheck::registerMatchers(MatchFinder *Finder) { hasParent(varDecl(isExternC())), hasParent(fieldDecl( hasParent(recordDecl(isExternCContext(), -

[clang-tools-extra] [clang-tidy] Improve `bugprone-exception-escape`: add stacktrace of escaped exception (PR #134375)

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

[clang-tools-extra] [clang-tidy] Update `confusables.txt` in `misc-confusable-identifiers` (PR #148399)

2025-07-14 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/148399 ___ 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] Do less unnecessary work in `NoLintDirectiveHandler` (PR #147553)

2025-07-14 Thread Baranov Victor via cfe-commits
@@ -93,15 +92,17 @@ class NoLintToken { // The location of the first character, "N", in "NOLINT". size_t Pos; + // A glob of the checks this NOLINT token disables. + std::unique_ptr ChecksGlob; vbvictor wrote: Do we need to put it in `public`? https://

[clang-tools-extra] [clang-tidy][NFC] Do less unnecessary work in `NoLintDirectiveHandler` (PR #147553)

2025-07-14 Thread Baranov Victor via cfe-commits
@@ -349,46 +369,21 @@ bool NoLintDirectiveHandler::Impl::diagHasNoLint( return false; // Do we have cached NOLINT block locations for this file? - if (Cache.count(*FileName) == 0) + if (!Cache.contains(*FileName)) // Warning: heavy operation - need to read entire

[clang] [clang][docs] Add all clang-tools-extra (PR #148622)

2025-07-14 Thread Baranov Victor via cfe-commits
@@ -97,6 +97,41 @@ linter tool. It provides an extensible framework for building compiler-based static analyses detecting and fixing bug-prone patterns, performance, portability and maintainability issues. +``clang-include-fixer`` +--- + +`clang-include-fi

[clang] [clang][docs] Add all clang-tools-extra (PR #148622)

2025-07-14 Thread Baranov Victor via cfe-commits
@@ -97,6 +97,41 @@ linter tool. It provides an extensible framework for building compiler-based static analyses detecting and fixing bug-prone patterns, performance, portability and maintainability issues. +``clang-include-fixer`` +--- + +`clang-include-fi

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

2025-07-15 Thread Baranov Victor via cfe-commits
@@ -134,14 +136,26 @@ void QualifiedAutoCheck::registerMatchers(MatchFinder *Finder) { auto IsBoundToType = refersToType(equalsBoundNode("type")); auto UnlessFunctionType = unless(hasUnqualifiedDesugaredType(functionType())); - auto IsAutoDeducedToPointer = [](const std

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

2025-07-15 Thread Baranov Victor via cfe-commits
@@ -96,3 +96,49 @@ Note in the LLVM alias, the default value is `false`. matched against only the type name (i.e. ``Type``). E.g. to suppress reports for ``std::array`` iterators use `std::array<.*>::(const_)?iterator` string. The default is an empty string. + +.. option:

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

2025-07-15 Thread Baranov Victor via cfe-commits
@@ -96,3 +96,49 @@ Note in the LLVM alias, the default value is `false`. matched against only the type name (i.e. ``Type``). E.g. to suppress reports for ``std::array`` iterators use `std::array<.*>::(const_)?iterator` string. The default is an empty string. + +.. option:

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

2025-07-15 Thread Baranov Victor via cfe-commits
@@ -96,3 +96,49 @@ Note in the LLVM alias, the default value is `false`. matched against only the type name (i.e. ``Type``). E.g. to suppress reports for ``std::array`` iterators use `std::array<.*>::(const_)?iterator` string. The default is an empty string. + +.. option:

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

2025-07-15 Thread Baranov Victor via cfe-commits
@@ -96,3 +96,49 @@ Note in the LLVM alias, the default value is `false`. matched against only the type name (i.e. ``Type``). E.g. to suppress reports for ``std::array`` iterators use `std::array<.*>::(const_)?iterator` string. The default is an empty string. + +.. option:

[clang] [clang][docs] Add all clang-tools-extra (PR #148622)

2025-07-15 Thread Baranov Victor via cfe-commits
@@ -89,14 +89,53 @@ they'll be tracked here. The focus of this documentation is on the scope and features of the tools for other tool developers; each tool should provide its own user-focused documentation. -``clang-tidy`` +``Clang-Doc`` +- + +`Clang-Doc

[clang] [clang][docs] Add all clang-tools-extra (PR #148622)

2025-07-15 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/148622 ___ 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] bugprone-infinite-loop: Add support for tuple structured bindings (PR #147410)

2025-07-16 Thread Baranov Victor via cfe-commits
vbvictor wrote: Thank you for the PR! Did you try to address this issue https://github.com/llvm/llvm-project/issues/138842? There is an ongoing PR https://github.com/llvm/llvm-project/pull/144213 that essentially tries to handle the same case with structured bindings. To be fair with everyone,

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

2025-07-16 Thread Baranov Victor via cfe-commits
vbvictor wrote: I think we should go through an RFC before creating a new module. TBH, I don't think we need a new module for MLIR in upstream since it is not a widely known thing in C++ community. Would it be viable for MLIR folks to use [plugins](https://clang.llvm.org/extra/clang-tidy/Contr

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

2025-07-17 Thread Baranov Victor via cfe-commits
vbvictor wrote: Yes, Tobias didn't have time to make a PR with cleaning release notes. https://discord.com/channels/636084430946959380/654052269301694465/1394963436538040421. At this time of the week, I can't either:( We shouldn't merge anything before release n

[clang] [clang][docs] Add all clang-tools-extra (PR #148622)

2025-07-16 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM, but please wait some time for EugeneZelenko to leave a review. https://github.com/llvm/llvm-project/pull/148622 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang] [clang][docs] Add all clang-tools-extra to 'ClangTools.rst' (PR #148622)

2025-07-16 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/148622 ___ 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-07-17 Thread Baranov Victor via cfe-commits
vbvictor wrote: > Are they really need to "std::move" in the patch? I think `MixData` is > meaningless since it is still need to copy all field. Do you mean with `CheckTriviallyCopyableMove` set to `true`? Technically, there would probably be no performance benefit. However, from author's poin

[clang-tools-extra] [clang-tidy][NFC] Add mention of running 'clang-tidy' on changes in Contributing.rst (PR #148547)

2025-07-17 Thread Baranov Victor via cfe-commits
vbvictor wrote: > Clang-Tidy pull requests are usually small, so is `-j` really necessary? Do you have anything against `-j` anymore? Otherwise, I'd merge this PR https://github.com/llvm/llvm-project/pull/148547 ___ cfe-commits mailing list cfe-commit

[clang-tools-extra] [clang-tools-extra][NFC] Fix link to code review in README.txt (PR #148384)

2025-07-17 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/148384 ___ 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-17 Thread Baranov Victor via cfe-commits
vbvictor wrote: > Something like > https://github.com/llvm/llvm-project/compare/main...jpienaar:llvm-project:cleanout?expand=1 Looks good, that must be the patch needed. https://github.com/llvm/llvm-project/pull/149148

[clang-tools-extra] Cleanout clang-tools-extra ReleaseNotes (PR #149306)

2025-07-17 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM, Maybe better commit name will be "[clang-tools-extra] Bump ReleaseNotes to 22.0.0git" https://github.com/llvm/llvm-project/pull/149306 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[clang-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-07-18 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/126434 ___ 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: modernize-use-scoped-lock (PR #126434)

2025-07-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,471 @@ +// RUN: %check_clang_tidy -std=c++17-or-later %s modernize-use-scoped-lock %t -- -- -isystem %clang_tidy_headers -fno-delayed-template-parsing + +#include + +void Positive() { + std::mutex m; + { +std::lock_guard l(m); +// CHECK-MESSAGES: :[[@LINE-1]

[clang-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-07-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,471 @@ +// RUN: %check_clang_tidy -std=c++17-or-later %s modernize-use-scoped-lock %t -- -- -isystem %clang_tidy_headers -fno-delayed-template-parsing + +#include + +void Positive() { + std::mutex m; + { +std::lock_guard l(m); +// CHECK-MESSAGES: :[[@LINE-1]

[clang-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-07-18 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,311 @@ +//===--- UseScopedLockCheck.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: Ap

[clang-tools-extra] [clang-tidy] add modernize-use-constexpr check (PR #146553)

2025-07-17 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,972 @@ +//===--- UseConstexprCheck.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: Ap

[clang-tools-extra] [clang-tidy] add modernize-use-constexpr check (PR #146553)

2025-07-17 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,972 @@ +//===--- UseConstexprCheck.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: Ap

[clang-tools-extra] [clang-tidy] add modernize-use-constexpr check (PR #146553)

2025-07-17 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,972 @@ +//===--- UseConstexprCheck.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: Ap

[clang-tools-extra] [clang-tidy] add modernize-use-constexpr check (PR #146553)

2025-07-17 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: Gave this a very rought look, so only a couple of general questions/suggestions. Could we do something with methods that repeat in some of the visitors, e.g. `bool TraverseType(QualType QT)` and others. Maybe macros..? I can't think of a better idea right

[clang-tools-extra] [clang-tidy] add modernize-use-constexpr check (PR #146553)

2025-07-17 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/146553 ___ 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 modernize-use-constexpr check (PR #146553)

2025-07-17 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,972 @@ +//===--- UseConstexprCheck.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: Ap

<    8   9   10   11   12   13