Re: [PATCH] D18442: A clang-tidy check for std:accumulate.

2016-04-26 Thread Clement Courbet via cfe-commits
courbet added inline comments. Comment at: docs/clang-tidy/checks/misc-fold-init-type.rst:16-17 @@ +15,4 @@ + +.. code:: c++ + auto a = {0.5f, 0.5f, 0.5f, 0.5f}; + return std::accumulate(std::begin(a), std::end(a), 0); alexfh wrote: > Prazek wrote: > > Doesn't .

Re: [PATCH] D18442: A clang-tidy check for std:accumulate.

2016-04-26 Thread Clement Courbet via cfe-commits
courbet added a comment. In http://reviews.llvm.org/D18442#411785, @alexfh wrote: > Looks good now. Thank you for the new check! Thanks for the review. > Do you need me to submit the patch for you? Yes, please. http://reviews.llvm.org/D18442 _

[PATCH] D19534: [clang-tidy] new google-default-arguments check

2016-04-26 Thread Clement Courbet via cfe-commits
courbet created this revision. courbet added a reviewer: alexfh. courbet added a subscriber: cfe-commits. To check the google style guide rule here: https://google.github.io/styleguide/cppguide.html#Default_Arguments http://reviews.llvm.org/D19534 Files: clang-tidy/google/CMakeLists.txt clan

Re: [PATCH] D19324: [ASTMatchers] new forEachOverriden matcher

2016-06-03 Thread Clement Courbet via cfe-commits
courbet updated this revision to Diff 59502. courbet added a comment. Rebase on origin/master http://reviews.llvm.org/D19324 Files: docs/LibASTMatchersReference.html include/clang/AST/ASTContext.h include/clang/AST/DeclCXX.h include/clang/ASTMatchers/ASTMatchers.h lib/AST/ASTContext.c

Re: [PATCH] D19324: [ASTMatchers] new forEachOverriden matcher

2016-06-03 Thread Clement Courbet via cfe-commits
courbet added a comment. @sbenza @aaron.ballman I don't have write access. Can one of you submit this on my behalf ? Thanks ! http://reviews.llvm.org/D19324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailm

Re: [PATCH] D19324: [ASTMatchers] new forEachOverriden matcher

2016-06-03 Thread Clement Courbet via cfe-commits
courbet added a comment. That could work :) I'm not sure my commit history is considered a "track record of submitting high quality patches" but I'll give it a try. http://reviews.llvm.org/D19324 ___ cfe-commits mailing list cfe-commits@lists.llvm.

r272378 - test commit: remove trailing whitespace in comments

2016-06-10 Thread Clement Courbet via cfe-commits
Author: courbet Date: Fri Jun 10 03:12:37 2016 New Revision: 272378 URL: http://llvm.org/viewvc/llvm-project?rev=272378&view=rev Log: test commit: remove trailing whitespace in comments Modified: cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h Modified: cfe/trunk/include/clang/ASTMatchers/

r272386 - [ASTMatchers] New forEachOverriden matcher.

2016-06-10 Thread Clement Courbet via cfe-commits
Author: courbet Date: Fri Jun 10 06:54:43 2016 New Revision: 272386 URL: http://llvm.org/viewvc/llvm-project?rev=272386&view=rev Log: [ASTMatchers] New forEachOverriden matcher. Matches methods overridden by the given method. Modified: cfe/trunk/docs/LibASTMatchersReference.html cfe/trun

Re: [PATCH] D19324: [ASTMatchers] new forEachOverriden matcher

2016-06-10 Thread Clement Courbet via cfe-commits
courbet closed this revision. courbet added a comment. This was submitted as r272386. http://reviews.llvm.org/D19324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

r274531 - [ASTMatchers] New forEachOverriden matcher.

2016-07-05 Thread Clement Courbet via cfe-commits
Author: courbet Date: Tue Jul 5 02:49:31 2016 New Revision: 274531 URL: http://llvm.org/viewvc/llvm-project?rev=274531&view=rev Log: [ASTMatchers] New forEachOverriden matcher. Matches methods overridden by the given method. Modified: cfe/trunk/docs/LibASTMatchersReference.html cfe/trun

Re: [PATCH] D21992: [clang-tidy] new cppcoreguidelines-slicing

2016-07-06 Thread Clement Courbet via cfe-commits
courbet updated this revision to Diff 62845. courbet added a comment. Update release notes. http://reviews.llvm.org/D21992 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp clang-tidy/cppcoreguidelines/SlicingCheck.cpp clang-

Re: [PATCH] D21992: [clang-tidy] new cppcoreguidelines-slicing

2016-07-11 Thread Clement Courbet via cfe-commits
courbet added a comment. Thanks for the comments. Comment at: clang-tidy/cppcoreguidelines/SlicingCheck.cpp:48 @@ +47,3 @@ + + // Assignement slicing: "a = b;" and "a = std::move(b);" variants. + const auto SlicesObjectInAssignment = hokein wrote: > Looks like

Re: [PATCH] D21992: [clang-tidy] new cppcoreguidelines-slicing

2016-07-11 Thread Clement Courbet via cfe-commits
courbet updated this revision to Diff 63477. courbet marked 4 inline comments as done. courbet added a comment. - Add a test case following comments. - Add more comments in tests. - Add examples in doc. - Simplify code a bit. http://reviews.llvm.org/D21992 Files: clang-tidy/cppcoreguidelines/

Re: [PATCH] D21992: [clang-tidy] new cppcoreguidelines-slicing

2016-07-11 Thread Clement Courbet via cfe-commits
courbet added a comment. I've ran this check on llvm. There are 0 instances of virtual function slicing (which is not surprising since these usually result in actual bugs) and 71 instances of member varaible slicing: - 'FullSourceLoc' to 'SourceLocation': 57 - 'APSInt' to 'APInt': 5 - 'DeducedT

[PATCH] D22222: [ASTMatchers] isSignedInteger() and isUnsignedInteger()

2016-07-11 Thread Clement Courbet via cfe-commits
courbet created this revision. courbet added a reviewer: aaron.ballman. courbet added a subscriber: cfe-commits. Herald added a subscriber: klimek. I could not find a way to match signedness of integers in the AST, so I'm adding these two matchers. http://reviews.llvm.org/D2 Files: includ

Re: [PATCH] D22222: [ASTMatchers] isSignedInteger() and isUnsignedInteger()

2016-07-11 Thread Clement Courbet via cfe-commits
courbet updated this revision to Diff 63644. courbet added a comment. Regenerate doc. http://reviews.llvm.org/D2 Files: docs/LibASTMatchersReference.html include/clang/ASTMatchers/ASTMatchers.h lib/ASTMatchers/Dynamic/Registry.cpp unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp

Re: [PATCH] D22222: [ASTMatchers] isSignedInteger() and isUnsignedInteger()

2016-07-11 Thread Clement Courbet via cfe-commits
courbet added a comment. Thanks. http://reviews.llvm.org/D2 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

r275157 - [ASTMatchers] isSignedInteger() and isUnsignedInteger()

2016-07-11 Thread Clement Courbet via cfe-commits
Author: courbet Date: Tue Jul 12 01:36:00 2016 New Revision: 275157 URL: http://llvm.org/viewvc/llvm-project?rev=275157&view=rev Log: [ASTMatchers] isSignedInteger() and isUnsignedInteger() Complementary to isInteger(), these match signed and unsigned integers respectively. Review: http://review

Re: [PATCH] D21992: [clang-tidy] new cppcoreguidelines-slicing

2016-07-18 Thread Clement Courbet via cfe-commits
courbet updated this revision to Diff 64302. courbet marked 3 inline comments as done. courbet added a comment. Cosmetics. https://reviews.llvm.org/D21992 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp clang-tidy/cppcoreguid

[clang-tools-extra] [clang-tidy] Add support for determining constness of more expressions. (PR #82617)

2024-02-22 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle created https://github.com/llvm/llvm-project/pull/82617 This uses a more systematic approach for determining whcich `DeclRefExpr`s mutate the underlying object: Instead of using a few matchers, we walk up the AST until we find a parent that we can prove cannot c

[clang-tools-extra] Allow unnecessary-value-param to match templated functions including lambdas with auto. (PR #97767)

2024-07-04 Thread Clement Courbet via cfe-commits
legrosbuffle wrote: There seems to be failing tests (see "buildkite" above). Can you please update the release notes too (`clang-tools-extra/docs/ReleaseNotes.rst`) ? https://github.com/llvm/llvm-project/pull/97767 ___ cfe-commits mailing list cfe-co

[clang-tools-extra] Allow unnecessary-value-param to match templated functions including lambdas with auto. (PR #97767)

2024-07-04 Thread Clement Courbet via cfe-commits
@@ -0,0 +1,92 @@ +// RUN: %check_clang_tidy -std=c++14-or-later %s performance-unnecessary-value-param %t + +struct ExpensiveToCopyType { + virtual ~ExpensiveToCopyType(); +}; + +template void templateWithNonTemplatizedParameter(const ExpensiveToCopyType S, T V) { + // CHECK

[clang-tools-extra] Allow unnecessary-value-param to match templated functions including lambdas with auto. (PR #97767)

2024-07-05 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle approved this pull request. https://github.com/llvm/llvm-project/pull/97767 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][transformer] Add `join` stencil. (PR #107366)

2024-09-05 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle created https://github.com/llvm/llvm-project/pull/107366 `join(",", a, b, c)` is the same as `cat(a, ",", b, ",", c)`. >From 0c9d87c0e25e598f40ecf3f4977cd5ed2e205636 Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Thu, 5 Sep 2024 06:53:07 + Subject: [PA

[clang] [clang][transformer] Make `describe()` terser for `NamedDecl`s. (PR #108215)

2024-09-11 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle created https://github.com/llvm/llvm-project/pull/108215 Right now `describe()`ing a `FunctionDecl` dups the whole code of the function. Dump only its name. >From 42f1e67d2186fd90b8fc08206b33e077912039a1 Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Wed,

[clang] [clang][transformer] Make `describe()` terser for `NamedDecl`s. (PR #108215)

2024-09-11 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle closed https://github.com/llvm/llvm-project/pull/108215 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] `doesNotMutateObject`: Handle calls to member functions … (PR #94362)

2024-06-06 Thread Clement Courbet via cfe-commits
@@ -36,6 +36,111 @@ void extractNodesByIdTo(ArrayRef Matches, StringRef ID, Nodes.insert(Match.getNodeAs(ID)); } +// If `D` has a const-qualified overload with otherwise identical +// ref-qualifiers, returns that overload. +const CXXMethodDecl *findConstOverload(const CXX

[clang-tools-extra] [clang-tidy] `doesNotMutateObject`: Handle calls to member functions … (PR #94362)

2024-06-06 Thread Clement Courbet via cfe-commits
@@ -36,6 +36,111 @@ void extractNodesByIdTo(ArrayRef Matches, StringRef ID, Nodes.insert(Match.getNodeAs(ID)); } +// If `D` has a const-qualified overload with otherwise identical +// ref-qualifiers, returns that overload. +const CXXMethodDecl *findConstOverload(const CXX

[clang-tools-extra] [clang-tidy] `doesNotMutateObject`: Handle calls to member functions … (PR #94362)

2024-06-06 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/94362 >From 8a7e3ee49295b55193440da6b796c9ada43ee5ef Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Tue, 4 Jun 2024 12:49:39 + Subject: [PATCH 1/2] [clang-tidy] `doesNotMutateObject`: Handle calls to me

[clang-tools-extra] [clang-tidy] `doesNotMutateObject`: Handle calls to member functions … (PR #94362)

2024-06-06 Thread Clement Courbet via cfe-commits
@@ -259,9 +258,9 @@ void UnnecessaryCopyInitialization::registerMatchers(MatchFinder *Finder) { .bind("blockStmt"); }; - Finder->addMatcher(LocalVarCopiedFrom(anyOf(isConstRefReturningFunctionCall(), - isConstRefReturni

[clang-tools-extra] [clang-tidy] `doesNotMutateObject`: Handle calls to member functions … (PR #94362)

2024-06-06 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/94362 >From 8a7e3ee49295b55193440da6b796c9ada43ee5ef Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Tue, 4 Jun 2024 12:49:39 + Subject: [PATCH 1/3] [clang-tidy] `doesNotMutateObject`: Handle calls to me

[clang-tools-extra] [clang-tidy] `doesNotMutateObject`: Handle calls to member functions … (PR #94362)

2024-06-06 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/94362 >From 8a7e3ee49295b55193440da6b796c9ada43ee5ef Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Tue, 4 Jun 2024 12:49:39 + Subject: [PATCH 1/4] [clang-tidy] `doesNotMutateObject`: Handle calls to me

[clang-tools-extra] [clang-tidy] `doesNotMutateObject`: Handle calls to member functions … (PR #94362)

2024-06-10 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle closed https://github.com/llvm/llvm-project/pull/94362 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] `doesNotMutateObject`: Handle calls to member functions … (PR #94362)

2024-06-04 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle created https://github.com/llvm/llvm-project/pull/94362 …and operators that have non-const overloads. This allows `unnecessary-copy-initialization` to warn on more cases. The common case is a class with a a set of const/non-sconst overloads (e.g. std::vector::

[clang-tools-extra] [clang-tidy] `doesNotMutateObject`: Handle calls to member functions … (PR #94362)

2024-06-05 Thread Clement Courbet via cfe-commits
legrosbuffle wrote: > Could this also be applied for > https://github.com/llvm/llvm-project/issues/69577? Weirdly, those two checks are using distinct methods to infer whether the underlying container is mutated. `unnecessary-copy-initialization` uses `doesNotMutateObject` while `performance-

[clang-tools-extra] [clang-tidy][performance-unnecessary-value-param] Make `handleMoveFix` virtual (PR #99867)

2024-07-23 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle closed https://github.com/llvm/llvm-project/pull/99867 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

2024-07-18 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle created https://github.com/llvm/llvm-project/pull/99477 This provides a way to inform the check that we're intending to use an the forwarding reference as a specific reference category Fixes #99474. >From b423b26cba90288912b3377c39ab4207c9fc95dc Mon Sep 17 00:0

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

2024-07-19 Thread Clement Courbet via cfe-commits
legrosbuffle wrote: Thanks for the comments. I went for a disabled-by-default option as that seems to be the consensus. https://github.com/llvm/llvm-project/pull/99477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

2024-07-19 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/99477 >From b423b26cba90288912b3377c39ab4207c9fc95dc Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Thu, 18 Jul 2024 11:47:56 + Subject: [PATCH 1/2] [clang-tidy][cppcoreguidelines-missing-std-forward] Do

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

2024-07-19 Thread Clement Courbet via cfe-commits
@@ -129,15 +129,19 @@ void MissingStdForwardCheck::registerMatchers(MatchFinder *Finder) { unless(anyOf(hasAncestor(typeLoc()), hasAncestor(expr(hasUnevaluatedContext()); + auto StaticCast = cxxStaticCastExpr( + hasSourceExpression(declRefEx

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

2024-07-22 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/99477 >From b423b26cba90288912b3377c39ab4207c9fc95dc Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Thu, 18 Jul 2024 11:47:56 + Subject: [PATCH 1/3] [clang-tidy][cppcoreguidelines-missing-std-forward] Do

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

2024-07-22 Thread Clement Courbet via cfe-commits
@@ -129,15 +129,19 @@ void MissingStdForwardCheck::registerMatchers(MatchFinder *Finder) { unless(anyOf(hasAncestor(typeLoc()), hasAncestor(expr(hasUnevaluatedContext()); + auto StaticCast = cxxStaticCastExpr( + hasSourceExpression(declRefEx

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

2024-07-22 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/99477 >From b423b26cba90288912b3377c39ab4207c9fc95dc Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Thu, 18 Jul 2024 11:47:56 + Subject: [PATCH 1/4] [clang-tidy][cppcoreguidelines-missing-std-forward] Do

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

2024-07-22 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle edited https://github.com/llvm/llvm-project/pull/99477 ___ 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-value-param] Make `handleMoveFix` virtual (PR #99867)

2024-07-22 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle created https://github.com/llvm/llvm-project/pull/99867 ... so that downstream checks can override behaviour to do additional processing. Refactor the rest of the logic to `handleConstRefFix` (which is also `virtual`). This is otherwise and NFC. This is simila

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

2024-08-28 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/99477 >From d64268021d53e05fb64a4788e99fcd966d7b559a Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Thu, 18 Jul 2024 11:47:56 + Subject: [PATCH 1/8] [clang-tidy][cppcoreguidelines-missing-std-forward] Do

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

2024-08-28 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/99477 >From d64268021d53e05fb64a4788e99fcd966d7b559a Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Thu, 18 Jul 2024 11:47:56 + Subject: [PATCH 1/9] [clang-tidy][cppcoreguidelines-missing-std-forward] Do

[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast`. (PR #99477)

2024-08-28 Thread Clement Courbet via cfe-commits
legrosbuffle wrote: Sorry for the delay (vacations). https://github.com/llvm/llvm-project/pull/99477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang analysis][thread safety] Warn when returning rvalue references. (PR #91229)

2024-05-06 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle created https://github.com/llvm/llvm-project/pull/91229 We're missing `T&& Consume() && { return std::move(member); }`. >From 86733474a1bf1486b807c95792781aa2d869c2ca Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Mon, 6 May 2024 14:15:47 + Subject: [P

[clang-tools-extra] ed8ff29 - [clang-tidy] Fix false positive in modernize-pass-by-value

2022-01-05 Thread Clement Courbet via cfe-commits
Author: Clement Courbet Date: 2022-01-05T14:33:40+01:00 New Revision: ed8ff29aa6835187f3d5e7b64de022fe6b33a131 URL: https://github.com/llvm/llvm-project/commit/ed8ff29aa6835187f3d5e7b64de022fe6b33a131 DIFF: https://github.com/llvm/llvm-project/commit/ed8ff29aa6835187f3d5e7b64de022fe6b33a131.dif

[clang-tools-extra] [clang-tidy] Fix assert in performance-unnecessary-copy-init. (PR #96506)

2024-06-24 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle created https://github.com/llvm/llvm-project/pull/96506 `GetDirectCallee` can be null. Fixes #96498. >From 5034dc92f9098874471b3f035fceb8275629b37a Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Mon, 24 Jun 2024 15:05:48 + Subject: [PATCH] [clang-tidy

[clang-tools-extra] [clang-tidy] Fix assert in performance-unnecessary-copy-init. (PR #96506)

2024-06-24 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/96506 >From 834b63adeea098ec2d815a85fe47e7577ff3baa9 Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Mon, 24 Jun 2024 15:05:48 + Subject: [PATCH] [clang-tidy] Fix assert in performance-unnecessary-copy-in

[clang-tools-extra] [clang-tidy] Fix assert in performance-unnecessary-copy-init. (PR #96506)

2024-06-24 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle closed https://github.com/llvm/llvm-project/pull/96506 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][transformer] Introduce a `constructExprArgs` range selector. (PR #95901)

2024-06-26 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/95901 >From 8f6ff99ddb035d63e99910f873a8d9938bd0b3e4 Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Mon, 17 Jun 2024 15:33:34 + Subject: [PATCH] [clang][transformer] Introduce a `constructExprArgs` range

[clang] [clang][transformer] Introduce a `constructExprArgs` range selector. (PR #95901)

2024-06-26 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/95901 >From 8f6ff99ddb035d63e99910f873a8d9938bd0b3e4 Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Mon, 17 Jun 2024 15:33:34 + Subject: [PATCH 1/2] [clang][transformer] Introduce a `constructExprArgs`

[clang] [clang][transformer] Introduce a `constructExprArgs` range selector. (PR #95901)

2024-06-26 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle closed https://github.com/llvm/llvm-project/pull/95901 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-reorder-fields] Handle macros fields declarations. (PR #118005)

2024-11-28 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle closed https://github.com/llvm/llvm-project/pull/118005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-reorder-fields] Handle macros fields declarations. (PR #118005)

2024-11-28 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle created https://github.com/llvm/llvm-project/pull/118005 Right now field with macro declarations break the tool: ``` struct Foo { Mutex mu; int x GUARDED_BY(mu); int y; }; ``` reordered by mu,y,x yields: ``` struct Foo { Mutex mu; int y GUARDED_BY(mu

[clang-tools-extra] [clang-reorder-fields] Handle macros fields declarations. (PR #118005)

2024-11-28 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle edited https://github.com/llvm/llvm-project/pull/118005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTVisitor] Visit `HoldingVar` from `BindingDecl`. (PR #117858)

2024-11-27 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle created https://github.com/llvm/llvm-project/pull/117858 Tuple-like types introduce `VarDecl`s in the AST for their "holding vars", but AST visitors do not visit those. As a result the `VarDecl` for the holding var is orphaned when trying to retreive its parents

[clang] [clang][ASTVisitor] Visit `HoldingVar` from `BindingDecl`. (PR #117858)

2024-12-12 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/117858 >From f388f19e26bdd7e45e874e4574e7d9196c2eaf0b Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Mon, 25 Nov 2024 15:52:18 + Subject: [PATCH 1/3] [clang][ASTVisitor] Visit `HoldingVar` from `Binding

[clang] [clang][ASTVisitor] Visit `HoldingVar` from `BindingDecl`. (PR #117858)

2024-12-12 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle closed https://github.com/llvm/llvm-project/pull/117858 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTVisitor] Visit `HoldingVar` from `BindingDecl`. (PR #117858)

2024-12-12 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/117858 >From f388f19e26bdd7e45e874e4574e7d9196c2eaf0b Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Mon, 25 Nov 2024 15:52:18 + Subject: [PATCH 1/4] [clang][ASTVisitor] Visit `HoldingVar` from `Binding

[clang] [clang][ASTVisitor] Visit `HoldingVar` from `BindingDecl`. (PR #117858)

2024-12-12 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/117858 >From f388f19e26bdd7e45e874e4574e7d9196c2eaf0b Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Mon, 25 Nov 2024 15:52:18 + Subject: [PATCH] [clang][ASTVisitor] Visit `HoldingVar` from `BindingDecl`

[clang] [clang][ASTVisitor] Visit `HoldingVar` from `BindingDecl`. (PR #117858)

2024-12-12 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/117858 >From f388f19e26bdd7e45e874e4574e7d9196c2eaf0b Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Mon, 25 Nov 2024 15:52:18 + Subject: [PATCH 1/2] [clang][ASTVisitor] Visit `HoldingVar` from `Binding

[clang] [clang][ASTVisitor] Visit `HoldingVar` from `BindingDecl`. (PR #117858)

2024-12-12 Thread Clement Courbet via cfe-commits
@@ -143,6 +143,15 @@ const Formula &getFormula(const ValueDecl &D, const Environment &Env) { return cast(Env.getValue(D))->formula(); } +const BindingDecl *findBindingDecl(const char *Name, ASTContext &ASTCtx) { legrosbuffle wrote: Not quite sure why I did

[clang] [clang][ASTVisitor] Visit `HoldingVar` from `BindingDecl`. (PR #117858)

2024-12-12 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/117858 >From f388f19e26bdd7e45e874e4574e7d9196c2eaf0b Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Mon, 25 Nov 2024 15:52:18 + Subject: [PATCH 1/2] [clang][ASTVisitor] Visit `HoldingVar` from `Binding

[clang] [clang-tools-extra] [clang-reorder-fields] Reorder leading comments (PR #123740)

2025-01-22 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle closed https://github.com/llvm/llvm-project/pull/123740 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang-reorder-fields] Reorder leading comments (PR #123740)

2025-01-21 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle created https://github.com/llvm/llvm-project/pull/123740 Similarly to https://github.com/llvm/llvm-project/pull/122918, leading comments are currently not being moved. ``` struct Foo { // This one is the cool field. int a; int b; }; ``` becomes: ``` struc

[clang-tools-extra] [clang-reorder-fields] Do not reorder macro expansions. (PR #122877)

2025-01-14 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle created https://github.com/llvm/llvm-project/pull/122877 When a field definition comes from a macro expansion, reordering completely messes up the file. There is no good way to fix this, since we can't modify the macro itself. Emit a warning instead. >From 54df

[clang-tools-extra] [clang-reorder-fields] Move trailing comments. (PR #122918)

2025-01-14 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle created https://github.com/llvm/llvm-project/pull/122918 Currently, trailing comments get mixed up: ``` struct Foo { int a; // This one is the cool field // within the struct. int b; }; ``` becomes: ``` struct Foo { int b; // This one is the cool

[clang-tools-extra] [clang-reorder-fields] Move trailing comments. (PR #122918)

2025-01-14 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/122918 >From 86e4fb91c31a38fb133e86ac64034d1386d6bd39 Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Tue, 14 Jan 2025 13:38:00 + Subject: [PATCH] [clang-reorder-fields] Move trailing comments. Currently

[clang-tools-extra] [clang-reorder-fields] Move trailing comments. (PR #122918)

2025-01-15 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle closed https://github.com/llvm/llvm-project/pull/122918 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang][refactor] Refactor `findNextTokenIncludingComments` (PR #123060)

2025-01-15 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle created https://github.com/llvm/llvm-project/pull/123060 We have two copies of the same code in clang-tidy and clang-reorder-fields, and those are extremenly similar to `Lexer::findNextToken`, so just add an extra agument to the latter. >From cb9d5e978474b0a5ca

[clang] [clang-tools-extra] [clang][refactor] Refactor `findNextTokenIncludingComments` (PR #123060)

2025-01-16 Thread Clement Courbet via cfe-commits
@@ -118,47 +118,19 @@ findMembersUsedInInitExpr(const CXXCtorInitializer *Initializer, return Results; } -/// Returns the next token after `Loc` (including comment tokens). -static std::optional getTokenAfter(SourceLocation Loc, - co

[clang] [clang-tools-extra] [clang][refactor] Refactor `findNextTokenIncludingComments` (PR #123060)

2025-01-16 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/123060 >From 005a730b72be1305c67f886d9a473273d7318d99 Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Wed, 15 Jan 2025 12:19:58 + Subject: [PATCH 1/4] [clang][refactor] Refactor `findNextTokenIncludingCo

[clang] [clang-tools-extra] [clang][refactor] Refactor `findNextTokenIncludingComments` (PR #123060)

2025-01-16 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/123060 >From 005a730b72be1305c67f886d9a473273d7318d99 Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Wed, 15 Jan 2025 12:19:58 + Subject: [PATCH 1/5] [clang][refactor] Refactor `findNextTokenIncludingCo

[clang] [clang-tools-extra] [clang][refactor] Refactor `findNextTokenIncludingComments` (PR #123060)

2025-01-15 Thread Clement Courbet via cfe-commits
legrosbuffle wrote: Thanks, and sorry I had to force-push because github would not refresh the PR (https://github.com/orgs/community/discussions/78775) https://github.com/llvm/llvm-project/pull/123060 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang] [clang-tools-extra] [clang][refactor] Refactor `findNextTokenIncludingComments` (PR #123060)

2025-01-15 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/123060 >From 005a730b72be1305c67f886d9a473273d7318d99 Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Wed, 15 Jan 2025 12:19:58 + Subject: [PATCH 1/2] [clang][refactor] Refactor `findNextTokenIncludingCo

[clang] [clang-tools-extra] [clang][refactor] Refactor `findNextTokenIncludingComments` (PR #123060)

2025-01-15 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/123060 >From 005a730b72be1305c67f886d9a473273d7318d99 Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Wed, 15 Jan 2025 12:19:58 + Subject: [PATCH 1/3] [clang][refactor] Refactor `findNextTokenIncludingCo

[clang] [clang-tools-extra] [clang][refactor] Refactor `findNextTokenIncludingComments` (PR #123060)

2025-01-16 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle closed https://github.com/llvm/llvm-project/pull/123060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang][refactor] Refactor `findNextTokenIncludingComments` (PR #123060)

2025-01-17 Thread Clement Courbet via cfe-commits
legrosbuffle wrote: > `Lexer::findNextToken` has an additional check: > > `if (!Lexer::isAtEndOfMacroExpansion(Loc, SM, LangOpts, &Loc))` > > Does this not change behavior in the case we are replacing? I imagine folks > just copied from `Lexer::findNextToken` and purposely left this out, is th

[clang] [clang-tools-extra] [clang][refactor] Refactor `findNextTokenIncludingComments` (PR #123060)

2025-01-17 Thread Clement Courbet via cfe-commits
@@ -118,47 +118,19 @@ findMembersUsedInInitExpr(const CXXCtorInitializer *Initializer, return Results; } -/// Returns the next token after `Loc` (including comment tokens). -static std::optional getTokenAfter(SourceLocation Loc, legrosbuffle wrote: Yes, th

[clang-tools-extra] [clang-reorder-fields] Move trailing comments. (PR #122918)

2025-01-15 Thread Clement Courbet via cfe-commits
@@ -116,26 +118,78 @@ findMembersUsedInInitExpr(const CXXCtorInitializer *Initializer, return Results; } -/// Returns the full source range for the field declaration up to (not -/// including) the trailing semicolumn, including potential macro invocations, -/// e.g. `int a

[clang-tools-extra] [clang-reorder-fields] Move trailing comments. (PR #122918)

2025-01-15 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/122918 >From 5180e6ee06531623adc35ac418d2dddbe58586c3 Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Tue, 14 Jan 2025 13:38:00 + Subject: [PATCH] [clang-reorder-fields] Move trailing comments. Currently

[clang-tools-extra] [clang-tidy] ExprSequence: Handle ternary operators. (PR #132913)

2025-03-25 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle created https://github.com/llvm/llvm-project/pull/132913 The first operand in the conditional operator `?:` is sequenced before the second or third operand. This was probably not implemented because it did not fit in the "single successor" model of `getSuccesso

[clang-tools-extra] [clang-tidy] ExprSequence: Handle ternary operators. (PR #132913)

2025-03-25 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/132913 >From dcb97b74e78148e03f7749f436f01d5488c11ae1 Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Tue, 25 Mar 2025 09:42:53 + Subject: [PATCH] [clang-tidy] ExprSequence: Handle ternary operators. The

[clang-tools-extra] [clang-tidy] ExprSequence: Handle ternary operators. (PR #132913)

2025-04-08 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/132913 >From dcb97b74e78148e03f7749f436f01d5488c11ae1 Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Tue, 25 Mar 2025 09:42:53 + Subject: [PATCH 1/3] [clang-tidy] ExprSequence: Handle ternary operators.

[clang-tools-extra] [clang-tidy] ExprSequence: Handle ternary operators. (PR #132913)

2025-04-08 Thread Clement Courbet via cfe-commits
legrosbuffle wrote: ping https://github.com/llvm/llvm-project/pull/132913 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    1   2   3