[clang-tools-extra] [clang] [clang][NFC] Refactor `CXXNewExpr::InitializationStyle` (PR #71322)

2023-11-06 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: It catches (https://buildkite.com/llvm-project/github-pull-requests/builds/12931#018ba4b7-1e05-425f-a30d-46ac33f582b6), you just didn't wait for a results (or ignored them) and forced a merge. https://github.com/llvm/llvm-project/pull/71322 _

[clang-tools-extra] [clang-tidy] Improve alternate snake case warnings (PR #71385)

2023-11-06 Thread Piotr Zegar via cfe-commits
@@ -871,8 +871,8 @@ bool IdentifierNamingCheck::matchesStyle( llvm::Regex("^[a-z][a-zA-Z0-9]*$"), llvm::Regex("^[A-Z][A-Z0-9_]*$"), llvm::Regex("^[A-Z][a-zA-Z0-9]*$"), - llvm::Regex("^[A-Z]([a-z0-9]*(_[A-Z])?)*"), - llvm::Regex("^[a-z]([a-z0-9]*(_[A-

[clang-tools-extra] [clang-tidy] Improve alternate snake case warnings (PR #71385)

2023-11-06 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/71385 ___ 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 alternate snake case warnings (PR #71385)

2023-11-06 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: Also update release notes, add one sentence there about this. https://github.com/llvm/llvm-project/pull/71385 ___ 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 performance-enum-size to exclude empty enums (PR #71640)

2023-11-08 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL created https://github.com/llvm/llvm-project/pull/71640 Enums without enumerators (empty) are now excluded from analysis as it's not possible to peroperly determinate new narrowed type, and such enums can be used in diffrent way, like as strong-types. Closes #71544

[clang-tools-extra] [clang-tidy] Improve performance-enum-size to exclude empty enums (PR #71640)

2023-11-08 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: No release notes entry, as this check were added in this release. https://github.com/llvm/llvm-project/pull/71640 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] readability-identifier-naming: add support for concepts (PR #71586)

2023-11-08 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. Update release notes, and update pull request description. Except those two, looks fine for me. https://github.com/llvm/llvm-project/pull/71586 ___ cfe-commits mailing list cfe-commits

[clang-tools-extra] [clang-tidy] Improve performance-enum-size to exclude empty enums (PR #71640)

2023-11-08 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL updated https://github.com/llvm/llvm-project/pull/71640 >From eeacce5ffae9eca72484a7e51f9e55592fe4ca13 Mon Sep 17 00:00:00 2001 From: Piotr Zegar Date: Wed, 8 Nov 2023 09:02:54 + Subject: [PATCH 1/2] [clang-tidy] Improve performance-enum-size to exclude empty en

[clang-tools-extra] [clang-tidy] Improve performance-enum-size to exclude empty enums (PR #71640)

2023-11-08 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL updated https://github.com/llvm/llvm-project/pull/71640 >From f74559586a11455e2b4c1f2c63076c5c441c527b Mon Sep 17 00:00:00 2001 From: Piotr Zegar Date: Wed, 8 Nov 2023 09:02:54 + Subject: [PATCH] [clang-tidy] Improve performance-enum-size to exclude empty enums

[clang-tools-extra] [clang-tidy] Improve performance-enum-size to exclude empty enums (PR #71640)

2023-11-08 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/71640 ___ 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 handling of functional cast in google-readability-casting (PR #71650)

2023-11-08 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL created https://github.com/llvm/llvm-project/pull/71650 Fix issue with constructor call being interpreted as functional cast and considered for a replacement with static cast or being removed as redundant. Closes #57959 >From b2da54fc89e99d3056ee80d47b8be2874916e02

[clang-tools-extra] [clang-tidy] readability-identifier-naming: add support for concepts (PR #71586)

2023-11-08 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/71586 ___ 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 AllowImplicitlyDeletedCopyOrMove option to cppcoreguidelines-special-member-functions (PR #71683)

2023-11-08 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL created https://github.com/llvm/llvm-project/pull/71683 Improved cppcoreguidelines-special-member-functions check with a new option AllowImplicitlyDeletedCopyOrMove, which removes the requirement for explicit copy or move special member functions when they are alrea

[clang-tools-extra] [clang-tidy] Add AllowStringArrays option to modernize-avoid-c-arrays (PR #71701)

2023-11-08 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL created https://github.com/llvm/llvm-project/pull/71701 Add AllowStringArrays option, enabling the exclusion of array types with deduced sizes constructed from string literals. This includes only var declarations of array of characters constructed directly from c-st

[clang] [clang-tools-extra] [clang-tidy] fix match for binaryOperator in ExprMutationAnalyzer for misc-const-correctness (PR #70559)

2023-11-08 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: In tests we usually use `-fno-delayed-template-parsing` to overcome this issue with templates and windows. https://github.com/llvm/llvm-project/pull/70559 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-11-09 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. Example: ``` llvm/include/llvm/Support/MathExtras.h:59:31: warning: prefer std::numbers math constant [modernize-use-std-numbers] 59 | inv_sqrt3f = .577350269F, // (0x1.279a74P-1) |

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-11-09 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/66583 ___ 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 `container-data-pointer` check to use `c_str()` (PR #71304)

2023-11-09 Thread Piotr Zegar via cfe-commits
@@ -3,13 +3,9 @@ readability-container-data-pointer == -Finds cases where code could use ``data()`` rather than the address of the -element at index 0 in a container. This pattern is commonly used to materialize -a pointer to the backing data of

[clang-tools-extra] [clang-tidy] Improve `container-data-pointer` check to use `c_str()` (PR #71304)

2023-11-09 Thread Piotr Zegar via cfe-commits
@@ -111,16 +115,18 @@ void ContainerDataPointerCheck::check(const MatchFinder::MatchResult &Result) { MemberExpr>(CE)) ReplacementText = "(" + ReplacementText + ")"; - if (CE->getType()->isPointerType()) -ReplacementText += "->data()"; - else -Replace

[clang-tools-extra] [clang-tidy] readability-identifier-naming: add support for concepts (PR #71586)

2023-11-09 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/71586 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] 8909ff6 - [clang-tidy][NFC] Reduce map lookups in IncludeSorter

2023-11-10 Thread Piotr Zegar via cfe-commits
Author: Piotr Zegar Date: 2023-11-10T18:11:10Z New Revision: 8909ff6927f856774a907148cadd3af904361601 URL: https://github.com/llvm/llvm-project/commit/8909ff6927f856774a907148cadd3af904361601 DIFF: https://github.com/llvm/llvm-project/commit/8909ff6927f856774a907148cadd3af904361601.diff LOG: [

[clang-tools-extra] [clang-tidy] bugprone-assert-side-effect non-const operator methods (PR #71974)

2023-11-10 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. Update documentation of this check to mention this, and update release notes. Code looks fine. https://github.com/llvm/llvm-project/pull/71974 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang-tools-extra] [clang-tidy] bugprone-assert-side-effect non-const operator methods (PR #71974)

2023-11-10 Thread Piotr Zegar via cfe-commits
@@ -41,6 +41,10 @@ AST_MATCHER_P2(Expr, hasSideEffect, bool, CheckFunctionCalls, } if (const auto *OpCallExpr = dyn_cast(E)) { +if (const auto *FuncDecl = OpCallExpr->getDirectCallee()) + if (const auto *MethodDecl = dyn_cast(FuncDecl)) +return !MethodDecl

[clang-tools-extra] [clang-tidy] bugprone-assert-side-effect non-const operator methods (PR #71974)

2023-11-10 Thread Piotr Zegar via cfe-commits
@@ -41,6 +41,10 @@ AST_MATCHER_P2(Expr, hasSideEffect, bool, CheckFunctionCalls, } if (const auto *OpCallExpr = dyn_cast(E)) { +if (const auto *FuncDecl = OpCallExpr->getDirectCallee()) PiotrZSL wrote: Merge this FuncDecl with MethodDecl by using dyn_

[clang-tools-extra] [clang-tidy] bugprone-assert-side-effect non-const operator methods (PR #71974)

2023-11-10 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: One more question, there is option for this check: "CheckFunctionCalls Whether to treat non-const member and non-member functions as they produce side effects. Disabled by default because it can increase the number of false positive warnings." Won't this overlap this change ?

[clang-tools-extra] [clang-tidy] bugprone-assert-side-effect non-const operator methods (PR #71974)

2023-11-10 Thread Piotr Zegar via cfe-commits
@@ -41,6 +41,10 @@ AST_MATCHER_P2(Expr, hasSideEffect, bool, CheckFunctionCalls, } if (const auto *OpCallExpr = dyn_cast(E)) { +if (const auto *MethodDecl = +dyn_cast_or_null(OpCallExpr->getDirectCallee())) + return !MethodDecl->isConst();

[clang-tools-extra] [clang-tidy] bugprone-assert-side-effect non-const operator methods (PR #71974)

2023-11-10 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. I'm not sure now if this wont cause too much false-positives, after all this is why CheckFunctionCalls option were added. Sometimes object can have 2 same operators, one const and one not, in such case depend on "this" type, no

[clang-tools-extra] [clang-tidy] bugprone-assert-side-effect non-const operator methods (PR #71974)

2023-11-10 Thread Piotr Zegar via cfe-commits
@@ -41,6 +41,10 @@ AST_MATCHER_P2(Expr, hasSideEffect, bool, CheckFunctionCalls, } if (const auto *OpCallExpr = dyn_cast(E)) { +if (const auto *MethodDecl = +dyn_cast_or_null(OpCallExpr->getDirectCallee())) + return !MethodDecl->isConst();

[clang-tools-extra] d867f66 - [clang-tidy] modernize-avoid-bind: Fix handling of operators

2023-11-11 Thread Piotr Zegar via cfe-commits
Author: Joachim Priesner Date: 2023-11-11T09:56:33Z New Revision: d867f668672d634d52eaeae4cdcb7f9740890082 URL: https://github.com/llvm/llvm-project/commit/d867f668672d634d52eaeae4cdcb7f9740890082 DIFF: https://github.com/llvm/llvm-project/commit/d867f668672d634d52eaeae4cdcb7f9740890082.diff L

[clang-tools-extra] 9311d12 - [clang-tidy][DOC] Add release notes for modernize-avoid-bind

2023-11-11 Thread Piotr Zegar via cfe-commits
Author: Piotr Zegar Date: 2023-11-11T09:56:33Z New Revision: 9311d12281c33e0ab8fc19ec956bdb7e13e59303 URL: https://github.com/llvm/llvm-project/commit/9311d12281c33e0ab8fc19ec956bdb7e13e59303 DIFF: https://github.com/llvm/llvm-project/commit/9311d12281c33e0ab8fc19ec956bdb7e13e59303.diff LOG: [

[clang-tools-extra] 0e55fef - [clang-tidy] Tweak diag ranges for bugprone-sizeof-expression

2023-11-11 Thread Piotr Zegar via cfe-commits
Author: Nathan James Date: 2023-11-11T09:56:33Z New Revision: 0e55fef0e98ff5fc6898f3eda43e02143dbe0748 URL: https://github.com/llvm/llvm-project/commit/0e55fef0e98ff5fc6898f3eda43e02143dbe0748 DIFF: https://github.com/llvm/llvm-project/commit/0e55fef0e98ff5fc6898f3eda43e02143dbe0748.diff LOG:

[clang-tools-extra] bbb7cb8 - [clang-tidy][DOC] Add relase notes for bugprone-sizeof-expression

2023-11-11 Thread Piotr Zegar via cfe-commits
Author: Piotr Zegar Date: 2023-11-11T09:56:33Z New Revision: bbb7cb80598de12347204aefa4fe6146512ad4a1 URL: https://github.com/llvm/llvm-project/commit/bbb7cb80598de12347204aefa4fe6146512ad4a1 DIFF: https://github.com/llvm/llvm-project/commit/bbb7cb80598de12347204aefa4fe6146512ad4a1.diff LOG: [

[clang-tools-extra] [clang-tidy] Fix macros handling in cppcoreguidelines-prefer-member-initializer (PR #72037)

2023-11-11 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL created https://github.com/llvm/llvm-project/pull/72037 Produces now valid fixes for a member variables initialized with macros. Correctly uses expansion location instead of location inside macro to get init code. Close #70189 >From 4b47913beaecf4f22354b423bbe3441

[clang-tools-extra] [clang-tidy] Fixes to readability-implicit-bool-conversion (PR #72050)

2023-11-12 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL created https://github.com/llvm/llvm-project/pull/72050 - Fixed issue with invalid code being generated when static_cast is put into fix, and no space were added before it. - Fixed issue with duplicate parentheses being added when double implicit cast is used. Clos

[clang-tools-extra] [clang-tidy] Improved readability-bool-conversion to be more consistent when using parentheses (PR #72068)

2023-11-12 Thread Piotr Zegar via cfe-commits
@@ -412,6 +412,10 @@ Changes in existing checks do-while loops into account for the `AllowIntegerConditions` and `AllowPointerConditions` options. +- Improved :doc:`readability-implicit-bool-conversion PiotrZSL wrote: merge release notes, one entry for a

[clang-tools-extra] [clang-tidy] Improved readability-bool-conversion to be more consistent when using parentheses (PR #72068)

2023-11-12 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. Description for a change (commit / PR) needed. Except that looks fine. https://github.com/llvm/llvm-project/pull/72068 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [clang-tools-extra] [clang-tidy] fix match for binaryOperator in ExprMutationAnalyzer for misc-const-correctness (PR #70559)

2023-11-12 Thread Piotr Zegar via cfe-commits
@@ -308,6 +308,11 @@ Changes in existing checks ` check to avoid false positive when using pointer to member function. +- Improved :doc:`misc-const-correctness PiotrZSL wrote: there is already entry for this check, just merge changes. https://github.com

[clang] [clang-tools-extra] [clang-tidy] fix match for binaryOperator in ExprMutationAnalyzer for misc-const-correctness (PR #70559)

2023-11-12 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. https://github.com/llvm/llvm-project/pull/70559 ___ 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] fix match for binaryOperator in ExprMutationAnalyzer for misc-const-correctness (PR #70559)

2023-11-12 Thread Piotr Zegar via cfe-commits
@@ -307,11 +307,9 @@ Changes in existing checks - Improved :doc:`misc-const-correctness ` check to avoid false positive when using pointer to member function. - -- Improved :doc:`misc-const-correctness - ` check to not warn on uses in - type-dependent binary operators, w

[clang] [clang-tools-extra] [clang][tidy] Ensure rewriter has the correct CWD (PR #67839)

2023-12-04 Thread Piotr Zegar via cfe-commits
@@ -227,6 +227,14 @@ class ErrorReporter { llvm::errs() << "Can't apply replacements for file " << File << "\n"; } } + + auto BuildDir = Context.getCurrentBuildDirectory(); PiotrZSL wrote: I think you may need to do what is done in

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-12-04 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/66583 ___ 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-std-numbers (PR #66583)

2023-12-04 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM, this should be merged so other llvm users could test it. As check is complicated I expect that there can be some false-positives or issues reported when llvm 18 would release. https://github.com/llvm/llvm-project/pull/66583 _

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-12-04 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,58 @@ +.. title:: clang-tidy - modernize-use-std-numbers + +modernize-use-std-numbers += + +Finds constants and function calls to math functions that can be replaced +with c++20's mathematical constants from the ``numbers`` header and offers +fix

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-12-04 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/66583 ___ 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-std-numbers (PR #66583)

2023-12-04 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. Unless you want this to be merged as 44101708+5chmi...@users.noreply.github.com, correct your github settings, squash all commits into one and make sure that author of commit is correct. https://github.com/llvm/llvm-project/pull/66583 ___

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-12-04 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,74 @@ +.. title:: clang-tidy - modernize-use-std-numbers + +modernize-use-std-numbers += + +Finds constants and function calls to math functions that can be replaced +with c++20's mathematical constants from the ``numbers`` header and offers +fix

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-12-04 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,74 @@ +.. title:: clang-tidy - modernize-use-std-numbers + +modernize-use-std-numbers += + +Finds constants and function calls to math functions that can be replaced +with c++20's mathematical constants from the ``numbers`` header and offers +fix

[libc] [flang] [openmp] [compiler-rt] [libcxx] [clang] [llvm] [clang-tools-extra] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2023-12-04 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,49 @@ +//===--- MoveSharedPointerContentsCheck.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: Apa

[clang] [libcxx] [llvm] [flang] [libc] [openmp] [clang-tools-extra] [compiler-rt] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2023-12-04 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,49 @@ +//===--- MoveSharedPointerContentsCheck.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: Apa

[clang] [openmp] [compiler-rt] [libc] [llvm] [libcxx] [clang-tools-extra] [flang] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2023-12-04 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL commented: Few issues with `unaryOperator` left, after that will be fixed, it would look fine. https://github.com/llvm/llvm-project/pull/67467 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[openmp] [libc] [llvm] [clang-tools-extra] [libcxx] [compiler-rt] [clang] [flang] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2023-12-04 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/67467 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [compiler-rt] [flang] [libcxx] [libc] [llvm] [clang] [openmp] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2023-12-04 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,39 @@ +//===--- MoveSharedPointerContentsCheck.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] performance-unnecessary-copy-init: Add a hook... (PR #73921)

2023-12-05 Thread Piotr Zegar via cfe-commits
@@ -261,21 +262,27 @@ void UnnecessaryCopyInitialization::registerMatchers(MatchFinder *Finder) { this); } +UnnecessaryCopyInitialization::CheckContext::CheckContext( PiotrZSL wrote: I'm not a fan of this constructor, it should exist. in

[clang-tools-extra] [clang-tidy] performance-unnecessary-copy-init: Add a hook... (PR #73921)

2023-12-05 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. https://github.com/llvm/llvm-project/pull/73921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] performance-unnecessary-copy-init: Add a hook... (PR #73921)

2023-12-05 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/73921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] performance-unnecessary-copy-init: Add a hook... (PR #73921)

2023-12-05 Thread Piotr Zegar via cfe-commits
@@ -290,69 +296,72 @@ void UnnecessaryCopyInitialization::check( // instantiations where the types differ and rely on implicit conversion would // no longer compile if we switched to a reference. if (differentReplacedTemplateParams( - NewVar->getType(), construc

[clang-tools-extra] [clang-tidy] performance-unnecessary-copy-init: Add a hook... (PR #73921)

2023-12-05 Thread Piotr Zegar via cfe-commits
@@ -32,14 +32,34 @@ class UnnecessaryCopyInitialization : public ClangTidyCheck { void check(const ast_matchers::MatchFinder::MatchResult &Result) override; void storeOptions(ClangTidyOptions::OptionMap &Opts) override; +protected: + // A helper to manipulate the state c

[clang-tools-extra] [clang] [clang][tidy] Ensure rewriter has the correct CWD (PR #67839)

2023-12-05 Thread Piotr Zegar via cfe-commits
@@ -189,9 +191,12 @@ class ErrorReporter { void finish() { if (TotalFixes > 0) { - Rewriter Rewrite(SourceMgr, LangOpts); + bool AnyNotWritten = false; for (const auto &FileAndReplacements : FileReplacements) { +Rewriter Rewrite(SourceMgr, LangOp

[clang-tools-extra] [clang] [clang][tidy] Ensure rewriter has the correct CWD (PR #67839)

2023-12-05 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/67839 ___ 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 check hicpp-ignored-remove-result (PR #73119)

2023-12-06 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Björn?= Svensson , =?utf-8?q?Björn?= Svensson Message-ID: In-Reply-To: @@ -133,6 +133,11 @@ UnusedReturnValueCheck::UnusedReturnValueCheck(llvm::StringRef Name, "::boost::system::error_code"))), AllowCastToVoid(Opti

[clang-tools-extra] [clang-tidy] Add check hicpp-ignored-remove-result (PR #73119)

2023-12-06 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Björn?= Svensson , =?utf-8?q?Björn?= Svensson Message-ID: In-Reply-To: @@ -133,6 +133,11 @@ UnusedReturnValueCheck::UnusedReturnValueCheck(llvm::StringRef Name, "::boost::system::error_code"))), AllowCastToVoid(Opti

[clang-tools-extra] [clang-tidy] Add check hicpp-ignored-remove-result (PR #73119)

2023-12-06 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Björn?= Svensson , =?utf-8?q?Björn?= Svensson Message-ID: In-Reply-To: https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/73119 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang-tools-extra] [clang-tidy] Add check hicpp-ignored-remove-result (PR #73119)

2023-12-06 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Björn?= Svensson , =?utf-8?q?Björn?= Svensson Message-ID: In-Reply-To: @@ -0,0 +1,28 @@ +//===--- IgnoredRemoveResultCheck.cpp - clang-tidy ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See ht

[clang-tools-extra] [clang-tidy] Add check hicpp-ignored-remove-result (PR #73119)

2023-12-06 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Bj=C3=B6rn?= Svensson , =?utf-8?q?Bj=C3=B6rn?= Svensson Message-ID: In-Reply-To: https://github.com/PiotrZSL commented: Small nits, but looks fine. https://github.com/llvm/llvm-project/pull/73119 ___ cfe-commits mailing list cfe-commits@li

[clang-tools-extra] [clang-tidy] Add check hicpp-ignored-remove-result (PR #73119)

2023-12-06 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Bj=C3=B6rn?= Svensson , =?utf-8?q?Bj=C3=B6rn?= Svensson Message-ID: In-Reply-To: @@ -28,10 +28,12 @@ class UnusedReturnValueCheck : public ClangTidyCheck { return TK_IgnoreUnlessSpelledInSource; } -private: +protected: + UnusedReturnValueCheck(StringRef Nam

[clang-tools-extra] [clang-tidy] Add check hicpp-ignored-remove-result (PR #73119)

2023-12-06 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Björn?= Svensson , =?utf-8?q?Björn?= Svensson Message-ID: In-Reply-To: @@ -0,0 +1,17 @@ +.. title:: clang-tidy - hicpp-ignored-remove-result + +hicpp-ignored-remove-result +=== + +Ensure that the result of ``std::remove``, ``std::remove_if`` an

[clang-tools-extra] [clang-tidy] Add check hicpp-ignored-remove-result (PR #73119)

2023-12-06 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Björn?= Svensson , =?utf-8?q?Björn?= Svensson Message-ID: In-Reply-To: @@ -133,6 +133,11 @@ UnusedReturnValueCheck::UnusedReturnValueCheck(llvm::StringRef Name, "::boost::system::error_code"))), AllowCastToVoid(Opti

[clang-tools-extra] [clang-tidy] performance-unnecessary-copy-init: Add a hook... (PR #73921)

2023-12-06 Thread Piotr Zegar via cfe-commits
@@ -261,21 +262,27 @@ void UnnecessaryCopyInitialization::registerMatchers(MatchFinder *Finder) { this); } +UnnecessaryCopyInitialization::CheckContext::CheckContext( PiotrZSL wrote: Problem is that code were moved from check method to C

[clang-tools-extra] [clang-tidy] performance-unnecessary-copy-init: Add a hook... (PR #73921)

2023-12-06 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/73921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] performance-unnecessary-copy-init: Add a hook... (PR #73921)

2023-12-06 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL commented: Last nits, and it will look fine. https://github.com/llvm/llvm-project/pull/73921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] performance-unnecessary-copy-init: Add a hook... (PR #73921)

2023-12-06 Thread Piotr Zegar via cfe-commits
@@ -263,19 +264,26 @@ void UnnecessaryCopyInitialization::registerMatchers(MatchFinder *Finder) { void UnnecessaryCopyInitialization::check( const MatchFinder::MatchResult &Result) { - const auto *NewVar = Result.Nodes.getNodeAs("newVarDecl"); + const auto &NewVar = *Re

[clang-tools-extra] [clang-tidy] performance-unnecessary-copy-init: Add a hook... (PR #73921)

2023-12-06 Thread Piotr Zegar via cfe-commits
@@ -289,74 +297,72 @@ void UnnecessaryCopyInitialization::check( // instantiations where the types differ and rely on implicit conversion would // no longer compile if we switched to a reference. if (differentReplacedTemplateParams( - NewVar->getType(), construc

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-12-06 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/66583 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] bb0b261 - [clang-tidy][NFC] Attemp to fix compliation issue in UseStdNumbersCheck.cpp

2023-12-06 Thread Piotr Zegar via cfe-commits
Author: Piotr Zegar Date: 2023-12-06T18:47:59Z New Revision: bb0b261c2c731f9ceb5a70b2343b892b2ee05f3e URL: https://github.com/llvm/llvm-project/commit/bb0b261c2c731f9ceb5a70b2343b892b2ee05f3e DIFF: https://github.com/llvm/llvm-project/commit/bb0b261c2c731f9ceb5a70b2343b892b2ee05f3e.diff LOG: [

[clang-tools-extra] [clang] [clang-tidy] Added new check to detect redundant inline keyword (PR #73069)

2023-12-06 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constantin, =?utf-8?q?Félix-Antoine?= Constan

[clang-tools-extra] [clang-tidy] performance-unnecessary-copy-init: Add a hook... (PR #73921)

2023-12-06 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/73921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] 7deb41d - Revert "[clang-tidy][NFC] Attemp to fix compliation issue in UseStdNumbersCheck.cpp"

2023-12-06 Thread Piotr Zegar via cfe-commits
Author: Piotr Zegar Date: 2023-12-06T18:59:25Z New Revision: 7deb41db98230938486ad2f22dda353f8950ac95 URL: https://github.com/llvm/llvm-project/commit/7deb41db98230938486ad2f22dda353f8950ac95 DIFF: https://github.com/llvm/llvm-project/commit/7deb41db98230938486ad2f22dda353f8950ac95.diff LOG: R

[clang-tools-extra] 1e1e11a - Revert "[clang-tidy] add modernize-use-std-numbers (#66583)"

2023-12-06 Thread Piotr Zegar via cfe-commits
Author: Piotr Zegar Date: 2023-12-06T18:59:25Z New Revision: 1e1e11a4d7c57028953a23deae622acab5eee9ff URL: https://github.com/llvm/llvm-project/commit/1e1e11a4d7c57028953a23deae622acab5eee9ff DIFF: https://github.com/llvm/llvm-project/commit/1e1e11a4d7c57028953a23deae622acab5eee9ff.diff LOG: R

[clang-tools-extra] [clang-tidy] add modernize-use-std-numbers (PR #66583)

2023-12-06 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: I will compile this locally and try to fix it & recommit. https://github.com/llvm/llvm-project/pull/66583 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] 0eb7d53 - [clang-tidy] add modernize-use-std-numbers (#66583)

2023-12-06 Thread Piotr Zegar via cfe-commits
Author: Julian Schmidt Date: 2023-12-06T20:49:14Z New Revision: 0eb7d53cfc48f2e9287bb116415620618ca850b7 URL: https://github.com/llvm/llvm-project/commit/0eb7d53cfc48f2e9287bb116415620618ca850b7 DIFF: https://github.com/llvm/llvm-project/commit/0eb7d53cfc48f2e9287bb116415620618ca850b7.diff LOG

[clang-tools-extra] e1fa2fe - [clang-tidy][NFC] Change ArrayRef into std::vector in modernize-use-std-numbers

2023-12-06 Thread Piotr Zegar via cfe-commits
Author: Piotr Zegar Date: 2023-12-06T20:50:48Z New Revision: e1fa2fea03ff94627008054267a244744d76b5c2 URL: https://github.com/llvm/llvm-project/commit/e1fa2fea03ff94627008054267a244744d76b5c2 DIFF: https://github.com/llvm/llvm-project/commit/e1fa2fea03ff94627008054267a244744d76b5c2.diff LOG: [

[clang-tools-extra] [clang-tidy] Add check hicpp-ignored-remove-result (PR #73119)

2023-12-06 Thread Piotr Zegar 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: @@ -0,0 +1,21 @@ +.. title:: clang-tidy - hicpp-ignored-remove-result + +hicpp-ignored-remove-result +=== + +Ensure that the result of ``std::re

[clang-tools-extra] [clang-tidy] Add check hicpp-ignored-remove-result (PR #73119)

2023-12-06 Thread Piotr Zegar 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/PiotrZSL approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/73119 ___ cfe-commits

[clang-tools-extra] [clang] [llvm] Fix #35272: Don't replace typedefs in extern c scope (PR #69102)

2023-12-06 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/69102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [clang-tools-extra] Fix #35272: Don't replace typedefs in extern c scope (PR #69102)

2023-12-06 Thread Piotr Zegar via cfe-commits
@@ -318,7 +318,8 @@ Changes in existing checks - Improved :doc:`modernize-use-using ` check to fix function pointer and - forward declared ``typedef`` correctly. + forward declared ``typedef`` correctly. Ignore ``typedef`` declaration in PiotrZSL wrote: A

[clang] [clang-tools-extra] [llvm] Fix #35272: Don't replace typedefs in extern c scope (PR #69102)

2023-12-06 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. Loooks, good, minor nit in release notes. https://github.com/llvm/llvm-project/pull/69102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[mlir] [lldb] [clang-tools-extra] [llvm] [flang] [libcxx] [openmp] [libc] [compiler-rt] [clang] [clang-tidy] Add performance-move-smart-pointer-contents check. (PR #66139)

2023-12-06 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: Personally I think that check for move out of std::unique_ptr, and check for overall heavy moves could be implemented as an separate one, not related to unique_ptr. Easiest way to detect heavy moves is to check size of object, and above some threshold mark them as heavy. But th

[clang-tools-extra] [clang-tidy] Add check hicpp-ignored-remove-result (PR #73119)

2023-12-07 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Björn?= Svensson , =?utf-8?q?Björn?= Svensson , =?utf-8?q?Björn?= Svensson , =?utf-8?q?Björn?= Svensson Message-ID: In-Reply-To: https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/73119 ___ cfe-commits mailing list

[clang-tools-extra] [clang-tidy] Fix missing parentheses in readability-implicit-bool-conversion fixes (PR #74891)

2023-12-08 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL created https://github.com/llvm/llvm-project/pull/74891 Check now more properly add missing parentheses to code like this: 'bool bar = true ? 1 : 0 != 0;'. Closes #71867 >From 8c3b797f1f34d18c1e9211898f7d1a5697251317 Mon Sep 17 00:00:00 2001 From: Piotr Zegar Date

[llvm] [clang] [flang] [clang-tools-extra] [libcxx] [openmp] [mlir] [clang-tidy] Replace memcpy with std::copy (PR #74663)

2023-12-09 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,49 @@ +//===--- ReplaceMemcpyWithStdCopy.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

[libcxx] [clang] [clang-tools-extra] [flang] [mlir] [openmp] [llvm] [clang-tidy] Replace memcpy with std::copy (PR #74663)

2023-12-09 Thread Piotr Zegar via cfe-commits
@@ -275,6 +275,7 @@ Clang-Tidy Checks :doc:`modernize-raw-string-literal `, "Yes" :doc:`modernize-redundant-void-arg `, "Yes" :doc:`modernize-replace-auto-ptr `, "Yes" + :doc:`modernize-replace-memcpy-with-std-copy `, "Yes" PiotrZSL wrote: wrong li

[libcxx] [flang] [clang] [mlir] [llvm] [openmp] [clang-tools-extra] [clang-tidy] Replace memcpy with std::copy (PR #74663)

2023-12-09 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,47 @@ +.. title:: clang-tidy - modernize-replace-memcpy-with-stdcopy + +modernize-replace-memcpy-with-stdcopy +=== + +Replaces all occurrences of the C ``memcpy`` function with ``std::copy`` PiotrZSL wrote: not function,

[mlir] [clang-tools-extra] [libcxx] [openmp] [llvm] [clang] [flang] [clang-tidy] Replace memcpy with std::copy (PR #74663)

2023-12-09 Thread Piotr Zegar via cfe-commits
@@ -275,6 +275,7 @@ Clang-Tidy Checks :doc:`modernize-raw-string-literal `, "Yes" :doc:`modernize-redundant-void-arg `, "Yes" :doc:`modernize-replace-auto-ptr `, "Yes" + :doc:`modernize-replace-memcpy-with-std-copy `, "Yes" PiotrZSL wrote: And wron

[openmp] [llvm] [flang] [mlir] [clang] [clang-tools-extra] [libcxx] [clang-tidy] Replace memcpy with std::copy (PR #74663)

2023-12-09 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,119 @@ +//===--- ReplaceMemcpyWithStdCopy.cpp - 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: Ap

[clang-tools-extra] [mlir] [libcxx] [llvm] [flang] [openmp] [clang] [clang-tidy] Replace memcpy with std::copy (PR #74663)

2023-12-09 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,119 @@ +//===--- ReplaceMemcpyWithStdCopy.cpp - 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: Ap

[clang-tools-extra] [openmp] [mlir] [clang] [llvm] [libcxx] [flang] [clang-tidy] Replace memcpy with std::copy (PR #74663)

2023-12-09 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,119 @@ +//===--- ReplaceMemcpyWithStdCopy.cpp - 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: Ap

[clang] [clang-tools-extra] [llvm] [libcxx] [openmp] [flang] [mlir] [clang-tidy] Replace memcpy with std::copy (PR #74663)

2023-12-09 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,49 @@ +//===--- ReplaceMemcpyWithStdCopy.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] [libcxx] [flang] [openmp] [clang-tools-extra] [mlir] [llvm] [clang-tidy] Replace memcpy with std::copy (PR #74663)

2023-12-09 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,119 @@ +//===--- ReplaceMemcpyWithStdCopy.cpp - 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: Ap

[openmp] [libcxx] [llvm] [clang-tools-extra] [flang] [clang] [mlir] [clang-tidy] Replace memcpy with std::copy (PR #74663)

2023-12-09 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,47 @@ +.. title:: clang-tidy - modernize-replace-memcpy-with-stdcopy + +modernize-replace-memcpy-with-stdcopy +=== PiotrZSL wrote: should cover check name https://github.com/llvm/llvm-project/pull/74663

[libcxx] [llvm] [clang-tools-extra] [mlir] [clang] [openmp] [flang] [clang-tidy] Replace memcpy with std::copy (PR #74663)

2023-12-09 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,119 @@ +//===--- ReplaceMemcpyWithStdCopy.cpp - 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: Ap

  1   2   3   4   5   6   7   8   9   10   >