legrosbuffle wrote:
Note that in the test I wrote I called a ctor for simplicity, but in general I
want to avoid warning on anything that looks like this:
```
template
void Eat(Args&&...);
void NegativeMoved(ExpensiveToCopyType A) {
Eat(std::move(A));
}
```
The move ctor just happens to be
legrosbuffle wrote:
> Shouldn't this case be already covered by
No, this case is different: note that the `std::move` is already present.
With
```
void NegativeMoved(ExpensiveToCopyType A) {
ExpensiveToCopyType Copy = std::move(A);
}
```
If the caller passes an lvalue (case L), there is one
https://github.com/legrosbuffle updated
https://github.com/llvm/llvm-project/pull/145871
>From 8ffb4e7f1c3855917ccc5197bb3ecea7c716ab8a Mon Sep 17 00:00:00 2001
From: Clement Courbet
Date: Thu, 26 Jun 2025 11:22:28 +
Subject: [PATCH 1/3] [clang-tidy] unnecessary-value-param: Allow moving of
https://github.com/legrosbuffle converted_to_draft
https://github.com/llvm/llvm-project/pull/145871
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/legrosbuffle created
https://github.com/llvm/llvm-project/pull/145871
Some functions take an argument by value because it allows efficiently moving
them to a function that takes by value. Do not pessimize that case.
>From 8ffb4e7f1c3855917ccc5197bb3ecea7c716ab8a Mon Sep 17 0
@@ -81,18 +83,52 @@ getNewFieldsOrder(const RecordDecl *Definition,
return NewFieldsOrder;
}
+struct ReorderedStruct {
legrosbuffle wrote:
If you can pull out this refactoring (`ReorderedStruct` + `addRepacement`) to a
separate commit that'd be great.
htt
@@ -0,0 +1,256 @@
+//===-- tools/extra/clang-reorder-fields/utils/Designator.cpp ---*- 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
@@ -289,35 +321,213 @@ static void reorderFieldsInConstructor(
Replacements);
}
+/// Replacement for broken InitListExpr::isExplicit function.
+/// TODO: Remove when InitListExpr::isExplicit is fixed.
legrosbuffle wrote:
s/TODO/FIXME/
If
@@ -0,0 +1,256 @@
+//===-- tools/extra/clang-reorder-fields/utils/Designator.cpp ---*- 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
legrosbuffle wrote:
I would put this in the parent directory, the `utils/` subdir does not bring
that much IMO.
https://github.com/llvm/llvm-project/pull/142150
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -289,35 +321,213 @@ static void reorderFieldsInConstructor(
Replacements);
}
+/// Replacement for broken InitListExpr::isExplicit function.
+/// TODO: Remove when InitListExpr::isExplicit is fixed.
+static bool isImplicitILE(const InitListExpr *ILE, con
https://github.com/legrosbuffle commented:
Nice ! Conceptually this looks good, only stylistic comments.
https://github.com/llvm/llvm-project/pull/142150
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/lis
https://github.com/legrosbuffle edited
https://github.com/llvm/llvm-project/pull/142150
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
legrosbuffle wrote:
Not a big deal, but note for next time: we don't do force push to avoid losing
context
(https://llvm.org/docs/GitHub.html#rebasing-pull-requests-and-force-pushes)
https://github.com/llvm/llvm-project/pull/142149
___
cfe-commits m
@@ -0,0 +1,15 @@
+// RUN: clang-reorder-fields -record-name ::bar::Foo -fields-order y,x %s -- |
FileCheck %s
+
+namespace bar {
+
+#define DEFINE_FIELDS
+
+// This is okay to reorder.
+struct Foo {
+#ifdef DEFINE_FIELDS // CHECK: {{^#ifdef DEFINE_FIELDS}}
+ int y;
https://github.com/legrosbuffle approved this pull request.
https://github.com/llvm/llvm-project/pull/142147
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/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
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.
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
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
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
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
@@ -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
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
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
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
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
@@ -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
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
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
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
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
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
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
@@ -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
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
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
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
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
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
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
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
@@ -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
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
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`
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
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
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
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
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
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,
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
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
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
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
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
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
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
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
@@ -129,15 +129,19 @@ void MissingStdForwardCheck::registerMatchers(MatchFinder
*Finder) {
unless(anyOf(hasAncestor(typeLoc()),
hasAncestor(expr(hasUnevaluatedContext());
+ auto StaticCast = cxxStaticCastExpr(
+ hasSourceExpression(declRefEx
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
@@ -129,15 +129,19 @@ void MissingStdForwardCheck::registerMatchers(MatchFinder
*Finder) {
unless(anyOf(hasAncestor(typeLoc()),
hasAncestor(expr(hasUnevaluatedContext());
+ auto StaticCast = cxxStaticCastExpr(
+ hasSourceExpression(declRefEx
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
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-
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
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
@@ -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
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
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
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`
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
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
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
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
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
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
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
@@ -259,9 +258,9 @@ void
UnnecessaryCopyInitialization::registerMatchers(MatchFinder *Finder) {
.bind("blockStmt");
};
-
Finder->addMatcher(LocalVarCopiedFrom(anyOf(isConstRefReturningFunctionCall(),
- isConstRefReturni
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
@@ -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
@@ -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
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-
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::
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
legrosbuffle wrote:
> LGTM, verify if some release notes shouldn't be updated.
This is very minor, I've only seen a few instances in the Google codebase, but
it was trivial enough to include.
https://github.com/llvm/llvm-project/pull/84005
___
cfe-co
https://github.com/legrosbuffle closed
https://github.com/llvm/llvm-project/pull/82617
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
legrosbuffle wrote:
Thanks all. Comments addressed.
> Overall looking fine, but this check need to be run on bigger code-base to
> verify if there are no false positives or crashes.
Sorry, this was not very clear. By "our codebase" I meant the whole of Google
code :) This also ran on numerous
https://github.com/legrosbuffle updated
https://github.com/llvm/llvm-project/pull/82617
>From 9b93c8bf0614e64352de8e210adf6ff316c0133e Mon Sep 17 00:00:00 2001
From: Clement Courbet
Date: Mon, 19 Feb 2024 14:58:27 +
Subject: [PATCH 1/5] [llvm-exegesis][NFC] Refactor all `ValidationEvent` in
https://github.com/legrosbuffle updated
https://github.com/llvm/llvm-project/pull/82617
>From b2b98e9594b224f471f88924b8b060bee06de483 Mon Sep 17 00:00:00 2001
From: Clement Courbet
Date: Wed, 21 Feb 2024 09:15:22 +
Subject: [PATCH 1/3] [clang-tidy] Add support for determining constness of
https://github.com/legrosbuffle updated
https://github.com/llvm/llvm-project/pull/82617
>From b2b98e9594b224f471f88924b8b060bee06de483 Mon Sep 17 00:00:00 2001
From: Clement Courbet
Date: Wed, 21 Feb 2024 09:15:22 +
Subject: [PATCH 1/2] [clang-tidy] Add support for determining constness of
https://github.com/legrosbuffle updated
https://github.com/llvm/llvm-project/pull/82617
>From b2b98e9594b224f471f88924b8b060bee06de483 Mon Sep 17 00:00:00 2001
From: Clement Courbet
Date: Wed, 21 Feb 2024 09:15:22 +
Subject: [PATCH] [clang-tidy] Add support for determining constness of more
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
https://github.com/legrosbuffle approved this pull request.
https://github.com/llvm/llvm-project/pull/77153
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
legrosbuffle wrote:
> I'm assuming at some point we'll want to deprecate this old option?
It's a single line of code so it probably can stay there for backwards
compatibility :)
https://github.com/llvm/llvm-project/pull/77153
___
cfe-commits mailing
https://github.com/legrosbuffle approved this pull request.
https://github.com/llvm/llvm-project/pull/77020
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/legrosbuffle approved this pull request.
https://github.com/llvm/llvm-project/pull/78588
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -535,92 +472,178 @@ struct FPRep : public
FPRepBase {
// - Quiet Not a Number
// - Unnormal
// This can be reduced to the following logic:
-if (exp_bits() == encode(BiasedExponent::BITS_ALL_ONES()))
+if (exp_bits() == encode(BiasedExp::BITS_ALL_ONES()))
https://github.com/legrosbuffle closed
https://github.com/llvm/llvm-project/pull/77105
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -112,9 +116,11 @@ class Counter {
PerfEvent Event;
int FileDescriptor = -1;
bool IsDummyEvent;
+ std::vector ValidationEvents;
legrosbuffle wrote:
OK, let's rename `Counter` to `CounterGroup`, but let's at least create a
(private) abstraction for an
@@ -234,6 +239,22 @@ void positiveOnlyAccessedFieldAsConst() {
}
}
+void positiveOnlyAccessedFieldAsConstBinding() {
legrosbuffle wrote:
Done.
https://github.com/llvm/llvm-project/pull/77105
___
cfe-commits maili
1 - 100 of 305 matches
Mail list logo