[mlir] [llvm] [clang] [libcxx] [openmp] [flang] [clang-tools-extra] [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] [llvm] [flang] [openmp] [mlir] [clang] [clang-tools-extra] [clang-tidy] Replace memcpy with std::copy (PR #74663)

2023-12-09 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. **Missing tests.** Lot of issues. Personally i would consider modernize-use-std-copy-fill as an name, and cover also memset, as this would be the same code. And I would convert this into std::copy_n or std::full_n. The only th

[openmp] [flang] [libcxx] [llvm] [mlir] [clang] [clang-tools-extra] [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

[libcxx] [flang] [llvm] [clang-tools-extra] [openmp] [clang] [mlir] [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] [clang] [flang] [libcxx] [openmp] [llvm] [mlir] [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] [libcxx] [llvm] [flang] [openmp] [mlir] [clang] [clang-tidy] Replace memcpy with std::copy (PR #74663)

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

[mlir] [libcxx] [openmp] [flang] [clang] [clang-tools-extra] [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

[clang] [libcxx] [llvm] [openmp] [clang-tools-extra] [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

[llvm] [openmp] [clang] [mlir] [libcxx] [flang] [clang-tools-extra] [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] [clang] [clang-tidy] Added new check to detect redundant inline keyword (PR #73069)

2023-12-09 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] [clang-tidy] Added new check to detect redundant inline keyword (PR #73069)

2023-12-09 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] [clang-tools-extra] [clang-tidy] Added new check to detect redundant inline keyword (PR #73069)

2023-12-09 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] [clang-tools-extra] [clang-tidy] Added new check to detect redundant inline keyword (PR #73069)

2023-12-09 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] [clang-tools-extra] [clang-tidy] Added new check to detect redundant inline keyword (PR #73069)

2023-12-09 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] [clang-tools-extra] [clang-tidy] Added new check to detect redundant inline keyword (PR #73069)

2023-12-09 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

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

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

[clang-tools-extra] create new clang-tidy check to add namespaces to symbol references (PR #70621)

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

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Piotr Zegar via cfe-commits
@@ -22,6 +22,21 @@ struct basic_string { typedef basic_string string; typedef basic_string wstring; +template PiotrZSL wrote: Actually string and string_view is defined already in header test/clang-tidy/checkers/Inputs/Headers/string. Just add `-- -isystem

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: _"I am slowly looking into adding an option to this check to recommend C++20's API starts_with, and move it to modernize. Possibly would like to use it as a codemod on our code."_ Actually best would be to copy this check to performance-use-starts_with (or modernize) or somethi

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL commented: As for this check: - use string header - update check documentation (option default and description) - make sure that documentation is in sync with class documentation - add release notes entry about improving check to support std::string_view https://githu

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. documentation, string header, release notes https://github.com/llvm/llvm-project/pull/72283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Piotr Zegar via cfe-commits
@@ -19,11 +19,14 @@ using namespace clang::ast_matchers; namespace clang::tidy::abseil { +const auto DefaultStringLikeClasses = +"::std::basic_string; ::std::basic_string_view"; PiotrZSL wrote: Remove this space ```suggestion "::std::basic_string;::s

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Piotr Zegar via cfe-commits
@@ -96,6 +83,10 @@ void tests(std::string s, global_string s2) { // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use absl::StartsWith // CHECK-FIXES: {{^[[:space:]]*}}absl::StartsWith(s2, "a");{{$}} + sv.find("a") == 0; + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use absl:

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

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

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Piotr Zegar via cfe-commits
@@ -28,9 +28,9 @@ Options .. option:: StringLikeClasses - Semicolon-separated list of names of string-like classes. By default only - ``std::basic_string`` is considered. The list of methods to considered is - fixed. + Semicolon-separated list of names of string-like

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

2023-11-14 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM, once you correct latest comments & CI will pass, fell free to merge. https://github.com/llvm/llvm-project/pull/72283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang-tools-extra] [clang] [clang][AST] Fix crash in MatchChildASTVisitor::TraverseLambdaExpr (PR #70962)

2023-11-14 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: Would be nice to simply not crash in such case, whatever someone will fix origin issue later is up to debate. I would like to see this change on 17.0.6 (that means 2 weeks left to merge this). Unless someone fixes this somewere in lower layers. https://github.com/llvm/llvm-pro

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

2023-11-14 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed 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-tools-extra] 2aec866 - [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (#72283)

2023-11-14 Thread Piotr Zegar via cfe-commits
Author: Nicolas van Kempen Date: 2023-11-14T22:25:23Z New Revision: 2aec86683c074a19b9c4d42d0b2b33d4f999ba00 URL: https://github.com/llvm/llvm-project/commit/2aec86683c074a19b9c4d42d0b2b33d4f999ba00 DIFF: https://github.com/llvm/llvm-project/commit/2aec86683c074a19b9c4d42d0b2b33d4f999ba00.diff

[clang-tools-extra] [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (PR #72283)

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

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

2023-11-14 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin Message-ID: In-Reply-To: https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/72068 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang-tools-extra] [clang-tidy] Add new modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: would be to support also endswith in same check, so i'm not so sure about check name. https://github.com/llvm/llvm-project/pull/72385 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang-tools-extra] [clang-tidy] Add new modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,105 @@ +//===--- StringFindStartswithCheck.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 new modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,105 @@ +//===--- StringFindStartswithCheck.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 new modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,105 @@ +//===--- StringFindStartswithCheck.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 new modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,41 @@ +//===--- StringFindStartswithCheck.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 new modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Piotr Zegar via cfe-commits
@@ -181,6 +181,14 @@ New checks points in a coroutine. Such hostile types include scoped-lockable types and types belonging to a configurable denylist. +- New :doc:`modernize-string-find-startswith + ` check. + + Checks whether a ``std::string::find()`` or ``std::string:

[clang-tools-extra] [clang-tidy] Add new modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: Maybe modernize-use-starts-ends-with https://github.com/llvm/llvm-project/pull/72385 ___ 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 modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: > contains We already got one check for contains, its readability-container-contains, not sure how it apply for std::string, but maybe instead of calling this check modernize it could be readability, otherwise all checks would be modernize. https://github.com/llvm/llvm-project

[clang-tools-extra] [clang-tidy] Add new modernize-string-find-startswith check (PR #72385)

2023-11-15 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: Performance is fine, go ahead. https://github.com/llvm/llvm-project/pull/72385 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2023-11-15 Thread Piotr Zegar via cfe-commits
@@ -208,6 +208,11 @@ New check aliases Changes in existing checks ^^ +- Improved :doc:`bugprone-assert-side-effect + ` check to report usage of + non-const `<<` and `>>` operators in assertions and fixed some false-positives PiotrZSL

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

2023-11-15 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM, rebase code before merging https://github.com/llvm/llvm-project/pull/71974 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2023-11-16 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. Code is fine and can be merged, unless you want it merged as "schen...@users.noreply.github.com" you may need to disable email privacy options or try to squash all commits in one. https://github.com/llvm/llvm-project/pull/71974 __

[clang-tools-extra] [clang-tidy] Add new performance-use-starts-ends-with check (PR #72385)

2023-11-16 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,106 @@ +//===--- UseStartsEndsWithCheck.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 new performance-use-starts-ends-with check (PR #72385)

2023-11-16 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,106 @@ +//===--- UseStartsEndsWithCheck.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 new performance-use-starts-ends-with check (PR #72385)

2023-11-16 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,106 @@ +//===--- UseStartsEndsWithCheck.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 new performance-use-starts-ends-with check (PR #72385)

2023-11-16 Thread Piotr Zegar via cfe-commits
@@ -31,6 +30,10 @@ class StringFindStartswithCheck : public ClangTidyCheck { void registerMatchers(ast_matchers::MatchFinder *Finder) override; void check(const ast_matchers::MatchFinder::MatchResult &Result) override; void storeOptions(ClangTidyOptions::OptionMap &Opts)

[clang-tools-extra] [clang-tidy] Add new performance-use-starts-ends-with check (PR #72385)

2023-11-16 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,106 @@ +//===--- UseStartsEndsWithCheck.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 new performance-use-starts-ends-with check (PR #72385)

2023-11-16 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,106 @@ +//===--- UseStartsEndsWithCheck.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 new performance-use-starts-ends-with check (PR #72385)

2023-11-16 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,106 @@ +//===--- UseStartsEndsWithCheck.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 new performance-use-starts-ends-with check (PR #72385)

2023-11-16 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL deleted https://github.com/llvm/llvm-project/pull/72385 ___ 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 performance-use-starts-ends-with check (PR #72385)

2023-11-16 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,106 @@ +//===--- UseStartsEndsWithCheck.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 new performance-use-starts-ends-with check (PR #72385)

2023-11-16 Thread Piotr Zegar via cfe-commits
@@ -8,6 +8,10 @@ corresponding ``std::string_view`` methods) result is compared with 0, and suggests replacing with ``absl::StartsWith()``. This is both a readability and performance issue. +``starts_with`` was added as a built-in function on those types in C++20. If +availab

[clang-tools-extra] [clang-tidy] Add new performance-use-starts-ends-with check (PR #72385)

2023-11-16 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,105 @@ +//===--- StringFindStartswithCheck.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] bugprone-assert-side-effect non-const operator methods (PR #71974)

2023-11-16 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/71974 ___ 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][DOC] Add missing HICPP rule id's (PR #72553)

2023-11-16 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. https://github.com/llvm/llvm-project/pull/72553 ___ 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 performance-use-starts-ends-with check (PR #72385)

2023-11-17 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,109 @@ +//===--- UseStartsEndsWithCheck.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 new performance-use-starts-ends-with check (PR #72385)

2023-11-17 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,151 @@ +// RUN: %check_clang_tidy -std=c++20 %s performance-use-starts-ends-with %t -- \ +// RUN: -- -isystem %clang_tidy_headers + +#include + +std::string foo(std::string); +std::string bar(); + +#define A_MACRO(x, y) ((x) == (y)) +#define STR(x) std::string(x) +

[clang-tools-extra] [clang-tidy] Add new performance-use-starts-ends-with check (PR #72385)

2023-11-17 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,37 @@ +//===--- UseStartsEndsWithCheck.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 new performance-use-starts-ends-with check (PR #72385)

2023-11-17 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,37 @@ +//===--- UseStartsEndsWithCheck.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 new performance-use-starts-ends-with check (PR #72385)

2023-11-17 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL commented: Looks good. Minor cleanup and could land. https://github.com/llvm/llvm-project/pull/72385 ___ 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 performance-use-starts-ends-with check (PR #72385)

2023-11-17 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,109 @@ +//===--- UseStartsEndsWithCheck.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 new performance-use-starts-ends-with check (PR #72385)

2023-11-17 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,109 @@ +//===--- UseStartsEndsWithCheck.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] [clang-tidy] Improve performance of misc-const-correctness (PR #72705)

2023-11-17 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL created https://github.com/llvm/llvm-project/pull/72705 Replaced certain AST matchers in ExprMutationAnalyzer with a more direct utilization of AST classes. The primary bottleneck was identified in the canResolveToExpr AST matcher. Since this matcher was employed mu

[clang-tools-extra] [clang-tidy][NFC][DOC] Add missing HICPP rule id's (PR #72553)

2023-11-17 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Björn?= Svensson Message-ID: In-Reply-To: https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/72553 ___ 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-17 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: @jcmoyer Do you want this be merged as jcmo...@users.noreply.github.com ? If not then please disable privacy settings in GitHub or change author of commit. https://github.com/llvm/llvm-project/pull/71385 ___ cfe-commits mailing list cf

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

2023-11-18 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed 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] add modernize-use-std-numbers (PR #66583)

2023-11-19 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: > @PiotrZSL I have implemented the changes you have requested, but because of > #72536, I am not going to push those changes yet, unless you prefer it if I > do. I might take a look into fixing this issue. I came across this when I > checked what would happen when the big templ

[lld] [mlir] [llvm] [clang] [flang] [clang-tools-extra] [clangtidy] Allow safe suspensions in coroutine-hostile-raii check (PR #72954)

2023-11-21 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: Maybe instead of "coro_raii_safe_suspend" we should just use an list of "allowed types" ? https://github.com/llvm/llvm-project/pull/72954 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] [llvm] [clang-tools-extra] [flang] [lld] [mlir] [clangtidy] Allow safe suspensions in coroutine-hostile-raii check (PR #72954)

2023-11-21 Thread Piotr Zegar via cfe-commits
@@ -52,27 +52,41 @@ AST_MATCHER_P(Stmt, forEachPrevStmt, ast_matchers::internal::Matcher, } return IsHostile; } + +// Matches the expression awaited by the `co_await`. +AST_MATCHER_P(CoawaitExpr, awaiatable, ast_matchers::internal::Matcher, + InnerMatcher) { +

[clang] [llvm] [clang-tools-extra] [flang] [lld] [mlir] [clangtidy] Allow safe suspensions in coroutine-hostile-raii check (PR #72954)

2023-11-21 Thread Piotr Zegar via cfe-commits
@@ -52,27 +52,41 @@ AST_MATCHER_P(Stmt, forEachPrevStmt, ast_matchers::internal::Matcher, } return IsHostile; } + +// Matches the expression awaited by the `co_await`. +AST_MATCHER_P(CoawaitExpr, awaiatable, ast_matchers::internal::Matcher, + InnerMatcher) { +

[clang] [llvm] [clang-tools-extra] [flang] [lld] [mlir] [clangtidy] Allow safe suspensions in coroutine-hostile-raii check (PR #72954)

2023-11-21 Thread Piotr Zegar via cfe-commits
@@ -94,5 +108,7 @@ void CoroutineHostileRAIICheck::storeOptions( ClangTidyOptions::OptionMap &Opts) { Options.store(Opts, "RAIITypesList", utils::options::serializeStringList(RAIITypesList)); + Options.store(Opts, "SafeAwaitableList", Pio

[clang] [llvm] [clang-tools-extra] [flang] [lld] [mlir] [clangtidy] Allow safe suspensions in coroutine-hostile-raii check (PR #72954)

2023-11-21 Thread Piotr Zegar via cfe-commits
@@ -52,27 +52,41 @@ AST_MATCHER_P(Stmt, forEachPrevStmt, ast_matchers::internal::Matcher, } return IsHostile; } + +// Matches the expression awaited by the `co_await`. +AST_MATCHER_P(CoawaitExpr, awaiatable, ast_matchers::internal::Matcher, + InnerMatcher) { +

[clang] [llvm] [clang-tools-extra] [flang] [lld] [mlir] [clangtidy] Allow safe suspensions in coroutine-hostile-raii check (PR #72954)

2023-11-21 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. Overall looks +- fine for me. Wait like 1-2 weeks before merging if someone got some more comments. https://github.com/llvm/llvm-project/pull/72954 ___ cfe-commits mailing list cfe-commits@lists.l

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

2023-11-22 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin Message-ID: In-Reply-To: @@ -0,0 +1,99 @@ +//===--- RedundantInlineSpecifierCheck.cpp - +// clang-tidy--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/

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

2023-11-22 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin Message-ID: In-Reply-To: @@ -0,0 +1,99 @@ +//===--- RedundantInlineSpecifierCheck.cpp - +// clang-tidy--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/

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

2023-11-22 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin Message-ID: In-Reply-To: @@ -0,0 +1,99 @@ +//===--- RedundantInlineSpecifierCheck.cpp - +// clang-tidy--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/

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

2023-11-22 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin Message-ID: In-Reply-To: @@ -0,0 +1,99 @@ +//===--- RedundantInlineSpecifierCheck.cpp - +// clang-tidy--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/

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

2023-11-22 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin Message-ID: In-Reply-To: @@ -0,0 +1,99 @@ +//===--- RedundantInlineSpecifierCheck.cpp - +// clang-tidy--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/

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

2023-11-22 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin Message-ID: In-Reply-To: @@ -0,0 +1,99 @@ +//===--- RedundantInlineSpecifierCheck.cpp - +// clang-tidy--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/

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

2023-11-22 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin Message-ID: In-Reply-To: @@ -7889,7 +7889,7 @@ AST_POLYMORPHIC_MATCHER(isInline, AST_POLYMORPHIC_SUPPORTED_TYPES(NamespaceDecl, if (const auto *NSD = dyn_cast(&Node)) return NSD->isInline(); if (const auto *VD = dyn_cast(&Node)) -

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

2023-11-22 Thread Piotr Zegar via cfe-commits
=?utf-8?q?F=C3=A9lix-Antoine?= Constantin Message-ID: In-Reply-To: https://github.com/PiotrZSL requested changes to this pull request. Not bad, just few nits. https://github.com/llvm/llvm-project/pull/73069 ___ cfe-commits mailing list cfe-commits@li

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

2023-11-22 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin Message-ID: In-Reply-To: PiotrZSL wrote: > @PiotrZSL could you use the "Start review" button to avoid spamming people > with dozens of E-Mails for a single review? @philnik777 If you prefer not to receive notifications, simply unsubscribe. Specially if yo

[clang-tools-extra] [clang-tidy] Add new performance-use-starts-ends-with check (PR #72385)

2023-11-22 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: Problem that I see with "modernize" category is that it overlap with other categories, for example modernize-make-shared is mainly a performance check, modernize-redundant-void-arg is an readability check. We basically lack category for code design (rule of 5, limiting class/fi

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

2023-11-23 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Bj=C3=B6rn?= Svensson Message-ID: In-Reply-To: @@ -41,6 +42,15 @@ #include "NoAssemblerCheck.h" #include "SignedBitwiseCheck.h" +namespace { + +// Checked functions for hicpp-ignored-remove-result. +const llvm::StringRef CheckedFunctions = "::std::remove;" ---

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

2023-11-23 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Björn?= Svensson Message-ID: In-Reply-To: @@ -107,6 +119,14 @@ class HICPPModule : public ClangTidyModule { CheckFactories.registerCheck( "hicpp-vararg"); } + + ClangTidyOptions getModuleOptions() override { +ClangTidyOptions Options; +ClangT

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

2023-11-23 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Björn?= Svensson Message-ID: In-Reply-To: @@ -226,6 +226,7 @@ Clang-Tidy Checks :doc:`google-runtime-operator `, :doc:`google-upgrade-googletest-case `, "Yes" :doc:`hicpp-exception-baseclass `, + :doc:`hicpp-ignored-remove-result `, Pio

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

2023-11-23 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Björn?= Svensson Message-ID: In-Reply-To: https://github.com/PiotrZSL commented: Looks fine, as we got already such checks that are and are not aliases. But consider doing this as an actually separate check instead of using an alias functionality. Simply change original check, add o

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

2023-10-28 Thread Piotr Zegar via cfe-commits
@@ -683,6 +683,9 @@ Bug Fixes to AST Handling - Fixed a bug where RecursiveASTVisitor fails to visit the initializer of a bitfield. `Issue 64916 `_ +- Fixed a bug where ``ExprMutationAnalyzer`` did not find a potential muta

[clang-tools-extra] [clang-tidy] Add readability-redundant-casting check (PR #70595)

2023-10-29 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: 431 issues found in llvm. Example: ``` clang/lib/Sema/SemaAttr.cpp:332:21: warning: redundant explicit casting to the same type 'Expr *' as the sub-expression, remove this casting [readability-redundant-casting] 332 | Expr *Alignment = static_cast(alignment); |

[clang-tools-extra] [clang-tidy] Add readability-redundant-casting check (PR #70595)

2023-10-29 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL created https://github.com/llvm/llvm-project/pull/70595 Detects explicit type casting operations that involve the same source and destination types, and subsequently recommend their removal. Covers a range of explicit casting operations. Its primary objective is to

[clang-tools-extra] [clang-tidy] Fix #68492: point to the correct const location (PR #69103)

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

[clang] [clang-tidy] Fix #68492: point to the correct const location (PR #69103)

2023-10-29 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/69103 ___ 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 #68492: point to the correct const location (PR #69103)

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

[clang] [clang-tidy] Fix readability-avoid-const-params-in-decls - point to the correct const location (PR #69103)

2023-10-29 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/69103 ___ 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 readability-avoid-const-params-in-decls - point to the correct const location (PR #69103)

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

[clang] [clang-tidy] Fix readability-avoid-const-params-in-decls - point to the correct const location (PR #69103)

2023-10-29 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/69103 ___ 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 readability-avoid-const-params-in-decls - point to the correct const location (PR #69103)

2023-10-29 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/69103 ___ 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 modernize-make-shared check (PR #70600)

2023-10-29 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL created https://github.com/llvm/llvm-project/pull/70600 Improved modernize-make-shared check to support std::shared_ptr implementations that inherit the reset method from a base class. In GCC that class is called __shared_ptr. Fixes #64481 >From 79c01dbf330cd3489ee8

[clang-tools-extra] create new clang-tidy check to add namespaces to symbol references (PR #70621)

2023-10-30 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,840 @@ +//===--- UseExplicitNamespacesCheck.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

<    1   2   3   4   5   6   7   8   9   10   >