[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][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] Teach `readability-uppercase-literal-suffix` about C++23 and C23 suffixes (PR #148275)

2025-07-19 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,248 @@ +// TODO: When Clang adds support for C++23 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. +// These suffi

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

2025-07-19 Thread Baranov Victor via cfe-commits
@@ -225,6 +226,89 @@ void integer_complex_suffix() { static_assert(v28 == 1J, ""); } +// This is a C++23 feature, but Clang supports it in earlier language modes +// as an extension, so we test it unconditionally. vbvictor wrote: I think we should not depen

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

2025-07-19 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,248 @@ +// TODO: When Clang adds support for C++23 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. +// These suffi

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

2025-07-19 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,248 @@ +// TODO: When Clang adds support for C++23 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. +// These suffi

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

2025-07-19 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] Make `bugprone-unhandled-self-assignment` check more general (PR #147066)

2025-07-19 Thread Baranov Victor via cfe-commits
@@ -69,6 +69,28 @@ void UnhandledSelfAssignmentCheck::registerMatchers(MatchFinder *Finder) { cxxMethodDecl(unless(hasDescendant(cxxMemberCallExpr(callee(cxxMethodDecl( hasName("operator="), ofClass(equalsBoundNode("class"; + // Checking that some ki

[clang-tools-extra] [clang-tidy] Make `bugprone-unhandled-self-assignment` check more general (PR #147066)

2025-07-19 Thread Baranov Victor via cfe-commits
@@ -540,6 +547,89 @@ class NotACopyAssignmentOperator { Uy *getUy() const { return Ptr2; } }; +// Support "extended" copy/move constructors +class AllocatorAwareClass { vbvictor wrote: Could you add cases when the check will fire (I suppose it at least): -

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

2025-07-19 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,103 @@ +//===--- MLIROpBuilderCheck.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 MLIR check for old op builder usage. (PR #149148)

2025-07-19 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,51 @@ +// RUN: %check_clang_tidy --match-partial-fixes %s llvm-mlir-op-builder %t + +namespace mlir { +class Location {}; +class OpBuilder { +public: + template + OpTy create(Location location, Args &&...args) { +return OpTy(args...); + } + Location getUnknownL

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

2025-07-19 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,29 @@ +//===--- MLIROpBuilderCheck.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 MLIR check for old op builder usage. (PR #149148)

2025-07-19 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-19 Thread Baranov Victor via cfe-commits
@@ -40,6 +41,7 @@ class LLVMModule : public ClangTidyModule { CheckFactories.registerCheck( "llvm-qualified-auto"); CheckFactories.registerCheck("llvm-twine-local"); +CheckFactories.registerCheck("llvm-mlir-op-builder"); vbvictor wrote: Ple

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

2025-07-19 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,103 @@ +//===--- MLIROpBuilderCheck.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 MLIR check for old op builder usage. (PR #149148)

2025-07-19 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,21 @@ +.. title:: clang-tidy - llvm-mlir-op-builder + +llvm-mlir-op-builder + + +Flags usage of old form of invoking create on MLIR's ``OpBuilder`` and suggests +new form. vbvictor wrote: I think we should write why the user should

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

2025-07-19 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: I think we need a more verbose check name for users to understand what is the check about, e.g. `llvm-prefer-new-mlir-op-builder` `llvm-use-new-mlir-op-builder` `llvm-use-static-function-mlir-op-builder` https://github.com/llvm/llvm-project/pull/149148 ___

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

2025-07-19 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed 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] Add MLIR check for old op builder usage. (PR #149148)

2025-07-20 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] [clangd][NFC] added const and constexpr (PR #143193)

2025-07-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/143193 ___ 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 compilation by disambiguating equality operator (PR #147048)

2025-07-04 Thread Baranov Victor via cfe-commits
@@ -144,7 +144,8 @@ TaggedUnionMemberCountCheck::getNumberOfEnumValues(const EnumDecl *ED) { if (EnableCountingEnumHeuristic && LastEnumConstant && isCountingEnumLikeName(LastEnumConstant->getName()) && - (LastEnumConstant->getInitVal() == (EnumValues.size() - 1)

[clang] [clang-tools-extra] [clang-tidy] EndSourceFile() for preprocessor before diagnostic client (PR #145784)

2025-07-02 Thread Baranov Victor via cfe-commits
@@ -292,6 +292,21 @@ class ClangTidyDiagnosticConsumer : public DiagnosticConsumer { void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) override; + void BeginSourceFile(const LangOptions &LangOpts, vbv

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

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

[clang-tools-extra] [clangd][NFC] added const and constexpr to HeaderSourceSwitch (PR #143193)

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

[clang-tools-extra] [clangd][NFC] added const and constexpr (PR #143193)

2025-07-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/143193 ___ 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 compilation by disambiguating equality operator (PR #147048)

2025-07-04 Thread Baranov Victor via cfe-commits
vbvictor wrote: > That's probably happening due to incomplete C++20 support in either Clang 14 > or the GNU libstdc++ 12. Current standard that LLVM use is c++17. But we generally should support compilers at [least 3 years of compilers](https://llvm.org/docs/DeveloperPolicy.html#updating-tool

[clang-tools-extra] [clang-tidy][NFC] fix compilation by disambiguating equality operator (PR #147048)

2025-07-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147048 ___ 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] fix compilation by disambiguating equality operator (PR #147048)

2025-07-04 Thread Baranov Victor via cfe-commits
@@ -144,7 +144,8 @@ TaggedUnionMemberCountCheck::getNumberOfEnumValues(const EnumDecl *ED) { if (EnableCountingEnumHeuristic && LastEnumConstant && isCountingEnumLikeName(LastEnumConstant->getName()) && - (LastEnumConstant->getInitVal() == (EnumValues.size() - 1)

[clang-tools-extra] [clangd][NFC] added const and constexpr (PR #143193)

2025-07-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: Patch LGTM, but it may have to be approved by one of clangd's maintainers that I added. You should also add `NFC` in the title if you have non-functional changes. https://github.com/llvm/llvm-project/pull/143193 ___

[clang-tools-extra] [clang-tidy] Teach `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Baranov Victor via cfe-commits
vbvictor wrote: I wonder did you find this somehow automatically or manually? https://github.com/llvm/llvm-project/pull/147074 ___ 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 `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147074 ___ 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 `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Baranov Victor via cfe-commits
@@ -130,6 +149,12 @@ static const llvm::StringSet<> TypeTraits = { "result_of", "invoke_result", "type_identity", +"tuple_element", vbvictor wrote: There are no tests that will handle recursive traits (AFAIK there weren't any recursive trait i

[clang-tools-extra] [clang-tidy] Teach `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor requested changes to this pull request. Thank you for the patch! Could you please add tests with new traits from C++20, 23, 26 standards to make sure we get warning. You will need to change `-std=c++17` to `-std=c++17-or-later` in tests. https://github.com/llvm/llvm

[clang-tools-extra] [clang-tidy] Teach `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147074 ___ 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 `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147074 ___ 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 compilation by disambiguating equality operator (PR #147048)

2025-07-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147048 ___ 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 compilation by disambiguating equality operator (PR #147048)

2025-07-04 Thread Baranov Victor via cfe-commits
@@ -144,7 +144,8 @@ TaggedUnionMemberCountCheck::getNumberOfEnumValues(const EnumDecl *ED) { if (EnableCountingEnumHeuristic && LastEnumConstant && isCountingEnumLikeName(LastEnumConstant->getName()) && - (LastEnumConstant->getInitVal() == (EnumValues.size() - 1)

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

2025-07-08 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,260 @@ +//===--- 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] Teach `modernize-type-traits` about more type traits (PR #147074)

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

[clang] [clang-tools-extra] [ASTMatchers][NFC] Replace `makeMatcher` function with CTAD (PR #147197)

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

2025-07-04 Thread Baranov Victor via cfe-commits
@@ -174,6 +176,21 @@ void QualifiedAutoCheck::registerMatchers(MatchFinder *Finder) { void QualifiedAutoCheck::check(const MatchFinder::MatchResult &Result) { if (const auto *Var = Result.Nodes.getNodeAs("auto")) { +if (RespectOpaqueTypes) { vbvictor wr

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

2025-07-04 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,239 @@ +// RUN: %check_clang_tidy %s readability-qualified-auto %t -- -config="{CheckOptions: [\ vbvictor wrote: Please write tests in existing `qualified-auto.cpp`. You can have multiple RUN commands in one file. https://github.com/llvm/llvm-projec

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

2025-07-04 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 `RespectOpaqueTypes` option to `readability-qualified-auto check` (PR #147060)

2025-07-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor requested changes to this pull request. Please, describe your option in check docs. I find option name a little unclear, I don't encounter "opaque" term ofter, maybe `DesugarTypes` is better? https://github.com/llvm/llvm-project/pull/147060 _

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

2025-07-04 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 `RespectOpaqueTypes` option to `readability-qualified-auto check` (PR #147060)

2025-07-04 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 `RespectOpaqueTypes` option to `readability-qualified-auto check` (PR #147060)

2025-07-04 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 `RespectOpaqueTypes` option to `readability-qualified-auto check` (PR #147060)

2025-07-07 Thread Baranov Victor via cfe-commits
vbvictor wrote: > In that case the default should be true though right? Yes, that would be just as current default behavior. https://github.com/llvm/llvm-project/pull/147060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang] [clang-tools-extra] [ASTMatchers][NFC] Replace `makeMatcher` function with CTAD (PR #147197)

2025-07-06 Thread Baranov Victor via cfe-commits
vbvictor wrote: I'd suggest marking it `[[deprecated]]` for now and removing it completely after 2 releases of LLVM (AFAIK that's usual procedure). I've [searched](https://sourcegraph.com/search?q=context:global+::clang::ast_matchers::internal::makeMatcher+-file:.*Matchers%5C.h%24+-file:.*ASTM

[clang] [LifetimeSafety] Introduce intra-procedural analysis in Clang (PR #142313)

2025-07-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,508 @@ +#include "clang/Analysis/Analyses/LifetimeSafety.h" +#include "clang/AST/Decl.h" +#include "clang/AST/Expr.h" +#include "clang/AST/StmtVisitor.h" +#include "clang/AST/Type.h" +#include "clang/Analysis/AnalysisDeclContext.h" +#include "clang/Analysis/CFG.h" +#inc

[clang] [LifetimeSafety] Introduce intra-procedural analysis in Clang (PR #142313)

2025-07-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,13 @@ +#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIME_SAFETY_H vbvictor wrote: I think this file has a "Header" with `Part of the LLVM Project ...` and a little in-place description like any other file in `Analyses/` dir. Same to .cpp file. https://g

[clang] [LifetimeSafety] Introduce intra-procedural analysis in Clang (PR #142313)

2025-07-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,508 @@ +#include "clang/Analysis/Analyses/LifetimeSafety.h" +#include "clang/AST/Decl.h" +#include "clang/AST/Expr.h" +#include "clang/AST/StmtVisitor.h" +#include "clang/AST/Type.h" +#include "clang/Analysis/AnalysisDeclContext.h" +#include "clang/Analysis/CFG.h" +#inc

[clang] [LifetimeSafety] Introduce intra-procedural analysis in Clang (PR #142313)

2025-07-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,508 @@ +#include "clang/Analysis/Analyses/LifetimeSafety.h" +#include "clang/AST/Decl.h" +#include "clang/AST/Expr.h" +#include "clang/AST/StmtVisitor.h" +#include "clang/AST/Type.h" +#include "clang/Analysis/AnalysisDeclContext.h" +#include "clang/Analysis/CFG.h" +#inc

[clang] [LifetimeSafety] Introduce intra-procedural analysis in Clang (PR #142313)

2025-07-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,508 @@ +#include "clang/Analysis/Analyses/LifetimeSafety.h" +#include "clang/AST/Decl.h" +#include "clang/AST/Expr.h" +#include "clang/AST/StmtVisitor.h" +#include "clang/AST/Type.h" +#include "clang/Analysis/AnalysisDeclContext.h" +#include "clang/Analysis/CFG.h" +#inc

[clang] [LifetimeSafety] Introduce intra-procedural analysis in Clang (PR #142313)

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

[clang] [LifetimeSafety] Introduce intra-procedural analysis in Clang (PR #142313)

2025-07-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,13 @@ +#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIME_SAFETY_H vbvictor wrote: ```suggestion #ifndef LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_H ``` Underscore should be path separators, https://llvm.org/docs/CodingStandards.html#header-guard. https

[clang] [LifetimeSafety] Introduce intra-procedural analysis in Clang (PR #142313)

2025-07-06 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: Thank you for your work! Interested to see this feature in clang. Left a couple of nit comments on code style. https://github.com/llvm/llvm-project/pull/142313 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang] [LifetimeSafety] Introduce intra-procedural analysis in Clang (PR #142313)

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

[clang] [LifetimeSafety] Introduce intra-procedural analysis in Clang (PR #142313)

2025-07-06 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/142313 ___ 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 portability-avoid-platform-specific-fundamental-types (PR #146970)

2025-07-04 Thread Baranov Victor via cfe-commits
vbvictor wrote: > I'm planning for an autofix of float and double since it's unambiguous what > those types should be. For int types, maybe I'll give 3 options for an autofix: Fixed (int32_t) Fast (int_fast32_t) Least (int_least32_t) You could make a universal option to configure autofixes. Mak

[clang-tools-extra] [clang-tidy] Make `bugprone-unhandled-self-assignment` check more general (PR #147066)

2025-07-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147066 ___ 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 `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147074 ___ 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 `modernize-type-traits` about more type traits (PR #147074)

2025-07-04 Thread Baranov Victor via cfe-commits
@@ -130,6 +149,12 @@ static const llvm::StringSet<> TypeTraits = { "result_of", "invoke_result", "type_identity", +"tuple_element", vbvictor wrote: I'd also suggest adding "Limitation" section in check docs. Search in docs directory for refere

[clang-tools-extra] [clang-tidy][NFC] Prefer `constexpr llvm::StringLiteral` over `const char *` (PR #147301)

2025-07-07 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147301 ___ 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] Prefer `constexpr llvm::StringLiteral` over `const char *` (PR #147301)

2025-07-07 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. Could we just use `StringLiteral` without `llvm::`? https://github.com/llvm/llvm-project/pull/147301 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang-tools-extra] [clang-tidy][NFC] Prefer `constexpr llvm::StringLiteral` over `const char *` (PR #147301)

2025-07-07 Thread Baranov Victor via cfe-commits
@@ -55,7 +55,8 @@ namespace clang::tidy { namespace { #if CLANG_TIDY_ENABLE_STATIC_ANALYZER -static const char *AnalyzerCheckNamePrefix = "clang-analyzer-"; +static constexpr llvm::StringLiteral AnalyzerCheckNamePrefix = vbvictor wrote: ```suggestion static c

[clang-tools-extra] [clang-tidy][NFC] Prefer `constexpr llvm::StringLiteral` over `const char *` (PR #147301)

2025-07-07 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147301 ___ 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] Prefer `constexpr llvm::StringLiteral` over `const char *` (PR #147301)

2025-07-07 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147301 ___ 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] Prefer `constexpr llvm::StringLiteral` over `const char *` (PR #147301)

2025-07-07 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147301 ___ 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-07 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/146830 ___ 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] fix compilation by disambiguating equality operator (PR #147048)

2025-07-07 Thread Baranov Victor via cfe-commits
@@ -144,7 +144,9 @@ TaggedUnionMemberCountCheck::getNumberOfEnumValues(const EnumDecl *ED) { if (EnableCountingEnumHeuristic && LastEnumConstant && isCountingEnumLikeName(LastEnumConstant->getName()) && - (LastEnumConstant->getInitVal() == (EnumValues.size() - 1)

[clang-tools-extra] [clang-tidy][NFC] fix compilation by disambiguating equality operator (PR #147048)

2025-07-07 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147048 ___ 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 misc-bool-bitwise-operation check (PR #142324)

2025-07-06 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,62 @@ +.. title:: clang-tidy - misc-bool-bitwise-operation + +misc-bool-bitwise-operation +=== + +Finds potentially inefficient use of bitwise operators such as ``&``, ``|`` +and their compound analogues on Boolean values where logical operator

[clang-tools-extra] [clang-tidy][NFC] fix compilation by disambiguating equality operator (PR #147048)

2025-07-08 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/147048 ___ 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 ak_attr_info in diagnostic forwarding (PR #147503)

2025-07-08 Thread Baranov Victor via cfe-commits
vbvictor wrote: Did any of the builders caught this, or it is some local configuration? Asking just in case if we should create one for catching such CE's. https://github.com/llvm/llvm-project/pull/147503 ___ cfe-commits mailing list cfe-commits@lists

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

2025-07-09 Thread Baranov Victor via cfe-commits
vbvictor wrote: > > Please remove unnecessary comments that tell the same as code itself, > > speaking mostly about comments in `registerMatchers`. They mostly don't > > give any more information that matchers themselves. > > To be honest, this is because I coded 98% of this with AI (except fo

[clang-tools-extra] [clang-tidy] properly handle private move constructors in `modernize-pass-by-value` check (PR #141304)

2025-07-09 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/141304 >From 7323c1b3ed55790cdab240f233113bfb1d52badb Mon Sep 17 00:00:00 2001 From: Baranov Victor Date: Sat, 17 May 2025 18:40:54 +0300 Subject: [PATCH 1/5] [clang-tidy] Add isFriendOfClass helper function for Pass

[clang-tools-extra] [clang-tidy][NFC] add '.clang-tidy' config for clang-tidy project (PR #147793)

2025-07-09 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/147793 >From a0fd1b04817c03685bacd70f763ef0f62dd4e425 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Wed, 9 Jul 2025 21:00:30 +0300 Subject: [PATCH 1/2] [clang-tidy][NFC] add '.clang-tidy' config for clang-tidy

[clang-tools-extra] [clang-tidy] properly handle private move constructors in `modernize-pass-by-value` check (PR #141304)

2025-07-09 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/141304 ___ 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 .clang-tidy config for clang-tidy project (PR #147793)

2025-07-09 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/147793 Added `.clang-tidy` config as discussed in [RFC](https://discourse.llvm.org/t/rfc-create-hardened-clang-tidy-config-for-clang-tidy-directory/87247). Added `bugprone` checks that didn't create many warnings. Fix

[clang-tools-extra] [clang-tidy][NFC] add '.clang-tidy' config for clang-tidy project (PR #147793)

2025-07-09 Thread Baranov Victor via cfe-commits
vbvictor wrote: Added all people that participated in RFC and regular clang-tidy reviewers to see this change. https://github.com/llvm/llvm-project/pull/147793 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang-tools-extra] [clang-tidy][NFC] add '.clang-tidy' config for clang-tidy project (PR #147793)

2025-07-09 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147793 ___ 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] add '.clang-tidy' config for clang-tidy project (PR #147793)

2025-07-09 Thread Baranov Victor via cfe-commits
vbvictor wrote: > How about adding modernize relevant to currently used C++ standard? Also some > of readability checks are useful. Yes, I will add more and more checks to config. Just started with `bugprone` as it is the most straightforward improvement. > Please also consider top-level .cla

[clang-tools-extra] [clang-tidy][NFC] add '.clang-tidy' config for clang-tidy project (PR #147793)

2025-07-09 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/147793 >From a0fd1b04817c03685bacd70f763ef0f62dd4e425 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Wed, 9 Jul 2025 21:00:30 +0300 Subject: [PATCH] [clang-tidy][NFC] add '.clang-tidy' config for clang-tidy proj

[clang-tools-extra] [clang-tidy] Add new check `llvm-prefer-static-over-anonymous-namespace` (PR #142839)

2025-07-08 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/142839 >From d9ecaedefd6d98c653affc76e375fa1f8644a0df Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Wed, 4 Jun 2025 22:29:51 +0300 Subject: [PATCH 1/4] [clang-tidy] Add new check `llvm-prefer-static-over-anonym

[clang-tools-extra] [clang-tidy] Add new check `llvm-prefer-static-over-anonymous-namespace` (PR #142839)

2025-07-08 Thread Baranov Victor via cfe-commits
vbvictor wrote: Ping if anyone else what to review this new check. 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] Add new check `llvm-prefer-static-over-anonymous-namespace` (PR #142839)

2025-07-08 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/142839 >From d9ecaedefd6d98c653affc76e375fa1f8644a0df Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Wed, 4 Jun 2025 22:29:51 +0300 Subject: [PATCH 1/3] [clang-tidy] Add new check `llvm-prefer-static-over-anonym

[clang-tools-extra] [clang-tidy][NFC] Do more work at compile time (PR #147406)

2025-07-08 Thread Baranov Victor via cfe-commits
vbvictor wrote: Please make the title more detailed about what you changed excatly. https://github.com/llvm/llvm-project/pull/147406 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [ASTMatchers][NFC] Replace `makeMatcher` function with CTAD (PR #147197)

2025-07-08 Thread Baranov Victor via cfe-commits
@@ -672,9 +672,15 @@ class Matcher { DynTypedMatcher Implementation; }; // class Matcher -/// A convenient helper for creating a Matcher without specifying -/// the template type argument. +// Deduction guide for Matcher. +template Matcher(MatcherInterface *) -> Matcher; +

[clang-tools-extra] [clang-tidy][NFC] Prefer `constexpr llvm::StringLiteral` over `const char *` (PR #147301)

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

[clang] [clang-tools-extra] [ASTMatchers][NFC] Replace `makeMatcher` function with CTAD (PR #147197)

2025-07-08 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/147197 ___ 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] add '.clang-tidy' config for clang-tidy project (PR #147793)

2025-07-09 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/147793 >From c4466d677619e6eb8ca65ed943bfb103207527c9 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Wed, 9 Jul 2025 21:00:30 +0300 Subject: [PATCH 1/3] [clang-tidy][NFC] add '.clang-tidy' config for clang-tidy

[clang-tools-extra] [clang-tidy][NFC] add '.clang-tidy' config for clang-tidy project (PR #147793)

2025-07-10 Thread Baranov Victor via cfe-commits
vbvictor wrote: Based on [carlosgalvezp](https://github.com/carlosgalvezp)'s comment in https://github.com/llvm/llvm-project/pull/147902#pullrequestreview-3005674950 changed `Checks: []` to `Checks: >` to comply with older version of `clang-tidy`. https://github.com/llvm/llvm-project/pull/147

[clang-tools-extra] [clang-tidy][NFC] add '.clang-tidy' config for clang-tidy project (PR #147793)

2025-07-10 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/147793 >From c4466d677619e6eb8ca65ed943bfb103207527c9 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Wed, 9 Jul 2025 21:00:30 +0300 Subject: [PATCH 1/4] [clang-tidy][NFC] add '.clang-tidy' config for clang-tidy

[clang-tools-extra] [clang-tidy] Use lexical anon-ns matcher in llvm-prefer-static-over-anonymous-namespace (PR #148357)

2025-07-12 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/148357 >From 82bee931621536e7e59910f1833289510909ce23 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Sat, 12 Jul 2025 14:24:31 +0300 Subject: [PATCH] [clang-tidy] Use lexical anon-ns matcher in llvm-prefer-stati

[clang-tools-extra] [clang-tidy][NFC] fixed invalid formatting in 'ReleaseNotes.rst' (PR #148352)

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

<    7   8   9   10   11   12   13   14   >