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

2024-06-07 Thread Felix Berger via cfe-commits
https://github.com/fberger approved this pull request. 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-07 Thread Felix Berger via cfe-commits
fberger wrote: > Thanks for looking into this. > > > So unfortunately this change won't improve > > `performance-unnecessary-value-param`. > > I can have a look at unifying both in a subsequent PR. > > Simply adding comments to the tickets in question, so the information is not > lost to

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

2024-06-05 Thread Felix Berger 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

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

2024-06-05 Thread Felix Berger 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

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

2024-06-05 Thread Felix Berger 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

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

2024-06-05 Thread Felix Berger 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

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

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

[clang-tools-extra] [clang-tidy] `isOnlyUsedAsConst`: Handle static method calls. (PR #84005)

2024-03-06 Thread Felix Berger via cfe-commits
https://github.com/fberger approved this pull request. https://github.com/llvm/llvm-project/pull/84005 ___ 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 support for determining constness of more expressions. (PR #82617)

2024-02-23 Thread Felix Berger via cfe-commits
https://github.com/fberger approved this pull request. 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

[clang] [clang-tools-extra] [clang-tidy] Handle C++ structured bindings in `performance-for-range-copy` (PR #77105)

2024-01-08 Thread Felix Berger via cfe-commits
@@ -234,6 +239,22 @@ void positiveOnlyAccessedFieldAsConst() { } } +void positiveOnlyAccessedFieldAsConstBinding() { fberger wrote: Why `AccessedField` here, it seems to be `JustUsedAsConst` as in other test names?

[clang] [clang-tools-extra] [clang-tidy] Handle C++ structured bindings in `performance-for-range-copy` (PR #77105)

2024-01-08 Thread Felix Berger via cfe-commits
https://github.com/fberger approved this pull request. 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

[clang-tools-extra] [clang] [clang-tidy] Handle C++ structured bindings in `performance-for-range-copy` (PR #77105)

2024-01-08 Thread Felix Berger via cfe-commits
@@ -234,6 +239,22 @@ void positiveOnlyAccessedFieldAsConst() { } } +void positiveOnlyAccessedFieldAsConstBinding() { + for (auto [X, Y] : View>()) { +// CHECK-MESSAGES: [[@LINE-1]]:13: warning: loop variable is copied but +// CHECK-FIXES: for (const auto& [X, Y] :

[clang] [clang-tools-extra] [clang-tidy] Handle C++ structured bindings in `performance-for-range-copy` (PR #77105)

2024-01-08 Thread Felix Berger via cfe-commits
https://github.com/fberger edited 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

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

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

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

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

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

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

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

2023-12-05 Thread Felix Berger via cfe-commits
https://github.com/fberger approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/73921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 54ed30f - [ASTMatchers] Make ParamIndex unsigned.

2021-12-15 Thread Felix Berger via cfe-commits
Author: Felix Berger Date: 2021-12-15T13:47:34-05:00 New Revision: 54ed30fdd63b165efd3d3ce59aa96383fac80712 URL: https://github.com/llvm/llvm-project/commit/54ed30fdd63b165efd3d3ce59aa96383fac80712 DIFF: https://github.com/llvm/llvm-project/commit/54ed30fdd63b165efd3d3ce59aa96383fac80712.diff

[clang] a1b1c23 - [clang] ASTMatchers: Fix out-of-bounds access in foreachArgumentWithParamType.

2021-12-15 Thread Felix Berger via cfe-commits
Author: Felix Berger Date: 2021-12-15T12:35:07-05:00 New Revision: a1b1c23a3b5f2cbe38e90140227bb38a7783e574 URL: https://github.com/llvm/llvm-project/commit/a1b1c23a3b5f2cbe38e90140227bb38a7783e574 DIFF: https://github.com/llvm/llvm-project/commit/a1b1c23a3b5f2cbe38e90140227bb38a7783e574.diff

[clang-tools-extra] fefe20b - [clang-tidy] performance-unnecessary-copy-initialization: Correctly match the type name of the thisPointertype.

2021-11-20 Thread Felix Berger via cfe-commits
Author: Felix Berger Date: 2021-11-20T15:13:41-05:00 New Revision: fefe20b99313d6b0738806d1504652c3b7edb9e0 URL: https://github.com/llvm/llvm-project/commit/fefe20b99313d6b0738806d1504652c3b7edb9e0 DIFF: https://github.com/llvm/llvm-project/commit/fefe20b99313d6b0738806d1504652c3b7edb9e0.diff

[clang-tools-extra] cb4c12b - [clang-tidy] performance-unnecessary-copy-initialization: Create option to exclude container types from triggering the check.

2021-07-22 Thread Felix Berger via cfe-commits
Author: Felix Berger Date: 2021-07-22T16:20:20-04:00 New Revision: cb4c12b6117a6f2989d5745854a94c75cb6a09ba URL: https://github.com/llvm/llvm-project/commit/cb4c12b6117a6f2989d5745854a94c75cb6a09ba DIFF: https://github.com/llvm/llvm-project/commit/cb4c12b6117a6f2989d5745854a94c75cb6a09ba.diff

[clang-tools-extra] 00edae9 - [clang-tidy] performance-unnecessary-copy-initialization: Disable check when variable and initializer have different replaced template param types.

2021-07-22 Thread Felix Berger via cfe-commits
Author: Felix Berger Date: 2021-07-22T15:17:24-04:00 New Revision: 00edae9203c9a4f50da058d4bd25dc2e6a4930c1 URL: https://github.com/llvm/llvm-project/commit/00edae9203c9a4f50da058d4bd25dc2e6a4930c1 DIFF: https://github.com/llvm/llvm-project/commit/00edae9203c9a4f50da058d4bd25dc2e6a4930c1.diff

[clang-tools-extra] 0ec8120 - [clang-tidy] performance-unnecessary-copy-initialization: Do not remove comments on new lines.

2021-07-12 Thread Felix Berger via cfe-commits
Author: Felix Berger Date: 2021-07-12T16:23:04-04:00 New Revision: 0ec812023b43992810499b04222348fdbdb41ef2 URL: https://github.com/llvm/llvm-project/commit/0ec812023b43992810499b04222348fdbdb41ef2 DIFF: https://github.com/llvm/llvm-project/commit/0ec812023b43992810499b04222348fdbdb41ef2.diff

[clang-tools-extra] 187e050 - [clang-tidy] performance-unnecessary-copy-initialization: Disable structured bindings.

2021-07-12 Thread Felix Berger via cfe-commits
Author: Felix Berger Date: 2021-07-12T09:55:27-04:00 New Revision: 187e050b33bbee1ef210c83f5595c283ba671909 URL: https://github.com/llvm/llvm-project/commit/187e050b33bbee1ef210c83f5595c283ba671909 DIFF: https://github.com/llvm/llvm-project/commit/187e050b33bbee1ef210c83f5595c283ba671909.diff

[clang-tools-extra] bdd5da9 - [clang-tidy] performance-unnecessary-copy-initialization: Directly examine the initializing var's initializer.

2021-06-18 Thread Felix Berger via cfe-commits
Author: Felix Berger Date: 2021-06-18T15:25:17-04:00 New Revision: bdd5da9dec61072f693726d9ed2a94c78e431ba2 URL: https://github.com/llvm/llvm-project/commit/bdd5da9dec61072f693726d9ed2a94c78e431ba2 DIFF: https://github.com/llvm/llvm-project/commit/bdd5da9dec61072f693726d9ed2a94c78e431ba2.diff

[clang-tools-extra] efa4dbc - [clang-tidy] performance-unnecessary-copy-initialization: Look at the canonical type when checking for aliases.

2021-06-09 Thread Felix Berger via cfe-commits
Author: Felix Berger Date: 2021-06-09T16:36:53-04:00 New Revision: efa4dbc32ca9b7f3319edbcc6ac502ea962c8f0a URL: https://github.com/llvm/llvm-project/commit/efa4dbc32ca9b7f3319edbcc6ac502ea962c8f0a DIFF: https://github.com/llvm/llvm-project/commit/efa4dbc32ca9b7f3319edbcc6ac502ea962c8f0a.diff

[clang-tools-extra] 5dbe3bf - [clang-tidy] performance-unnecessary-copy-initialization: Remove the complete statement when the copied variable is unused.

2021-06-09 Thread Felix Berger via cfe-commits
Author: Felix Berger Date: 2021-06-09T15:52:48-04:00 New Revision: 5dbe3bf4b8dbb7e67d41c7c1360f15d512dd72a0 URL: https://github.com/llvm/llvm-project/commit/5dbe3bf4b8dbb7e67d41c7c1360f15d512dd72a0 DIFF: https://github.com/llvm/llvm-project/commit/5dbe3bf4b8dbb7e67d41c7c1360f15d512dd72a0.diff

[clang-tools-extra] ddebed8 - [clang-tidy] performance-* checks: Match AllowedTypes against qualified type names when they contain "::".

2021-04-06 Thread Felix Berger via cfe-commits
Author: Felix Berger Date: 2021-04-06T15:41:35-04:00 New Revision: ddebed8e9742add4372d54021cb55e06b655cfd6 URL: https://github.com/llvm/llvm-project/commit/ddebed8e9742add4372d54021cb55e06b655cfd6 DIFF: https://github.com/llvm/llvm-project/commit/ddebed8e9742add4372d54021cb55e06b655cfd6.diff

[clang-tools-extra] a189b3b - [clang-tidy] performance-for-range-copy: Don't trigger on implicit type conversions.

2021-03-02 Thread Felix Berger via cfe-commits
Author: Felix Berger Date: 2021-03-02T20:02:48-05:00 New Revision: a189b3b9e8bb398d9fe8770956f8ad1d58c2a214 URL: https://github.com/llvm/llvm-project/commit/a189b3b9e8bb398d9fe8770956f8ad1d58c2a214 DIFF: https://github.com/llvm/llvm-project/commit/a189b3b9e8bb398d9fe8770956f8ad1d58c2a214.diff

[clang-tools-extra] 671ad58 - [clang-tidy] performance-unnecessary-copy-initialization: Prevent false positives when dependent variable is modified.

2020-12-10 Thread Felix Berger via cfe-commits
Author: Felix Berger Date: 2020-12-10T16:58:17-05:00 New Revision: 671ad580610ad91139358b7786e02ff70433a90e URL: https://github.com/llvm/llvm-project/commit/671ad580610ad91139358b7786e02ff70433a90e DIFF: https://github.com/llvm/llvm-project/commit/671ad580610ad91139358b7786e02ff70433a90e.diff

[clang-tools-extra] ace9653 - [clang-tidy] performance-unnecessary-copy-initialization: Check for const reference arguments that are replaced template parameter type.

2020-11-16 Thread Felix Berger via cfe-commits
Author: Felix Berger Date: 2020-11-16T17:08:18-05:00 New Revision: ace9653c11c6308401dcda2e8b26bf97e6e66e30 URL: https://github.com/llvm/llvm-project/commit/ace9653c11c6308401dcda2e8b26bf97e6e66e30 DIFF: https://github.com/llvm/llvm-project/commit/ace9653c11c6308401dcda2e8b26bf97e6e66e30.diff

[clang-tools-extra] 1c1f794 - Always allow std::function to be copied.

2020-10-21 Thread Felix Berger via cfe-commits
Author: Felix Berger Date: 2020-10-21T17:20:35-04:00 New Revision: 1c1f794c2b645ba33a98f0359bc9d30bbef89920 URL: https://github.com/llvm/llvm-project/commit/1c1f794c2b645ba33a98f0359bc9d30bbef89920 DIFF: https://github.com/llvm/llvm-project/commit/1c1f794c2b645ba33a98f0359bc9d30bbef89920.diff

[clang-tools-extra] r309067 - [clang-tidy] Do not issue fixit for explicit template specializations

2017-07-25 Thread Felix Berger via cfe-commits
Author: flx Date: Tue Jul 25 17:45:41 2017 New Revision: 309067 URL: http://llvm.org/viewvc/llvm-project?rev=309067=rev Log: [clang-tidy] Do not issue fixit for explicit template specializations Summary: Do not issue fixit in UnnecessaryValueParamCheck if the function is an explicit template

[clang-tools-extra] r292491 - [clang-tidy] Do not trigger move fix for non-copy assignment operators in performance-unnecessary-value-param check

2017-01-19 Thread Felix Berger via cfe-commits
Author: flx Date: Thu Jan 19 09:51:10 2017 New Revision: 292491 URL: http://llvm.org/viewvc/llvm-project?rev=292491=rev Log: [clang-tidy] Do not trigger move fix for non-copy assignment operators in performance-unnecessary-value-param check Reviewers: alexfh, sbenza, malcolm.parsons

[clang-tools-extra] r289912 - [clang-tidy] Do not move parameter if only DeclRefExpr occurs inside of a loop

2016-12-15 Thread Felix Berger via cfe-commits
Author: flx Date: Thu Dec 15 20:47:56 2016 New Revision: 289912 URL: http://llvm.org/viewvc/llvm-project?rev=289912=rev Log: [clang-tidy] Do not move parameter if only DeclRefExpr occurs inside of a loop Summary: This fixes a bug where the performance-unnecessary-value-param check suggests a

[clang-tools-extra] r288502 - [clang-tidy] Do not trigger unnecessary-value-param check on methods marked as final

2016-12-02 Thread Felix Berger via cfe-commits
Author: flx Date: Fri Dec 2 08:44:16 2016 New Revision: 288502 URL: http://llvm.org/viewvc/llvm-project?rev=288502=rev Log: [clang-tidy] Do not trigger unnecessary-value-param check on methods marked as final Summary: Virtual method overrides of dependent types cannot be recognized unless they

[PATCH] D26453: [clang-tidy] Remove duplicated check from move-constructor-init

2016-11-11 Thread Felix Berger via cfe-commits
flx added a comment. In https://reviews.llvm.org/D26453#590720, @malcolm.parsons wrote: > Add ValuesOnly option to modernize-pass-by-value. Thanks for doing this. Alex, would this work for us? https://reviews.llvm.org/D26453 ___ cfe-commits

[PATCH] D26203: [ClangTidy - performance-unnecessary-value-param]: Do not issue fix for functions that are referenced outside of callExpr

2016-11-09 Thread Felix Berger via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL286424: [clang-tidy] Do not issue fix for functions that are referenced outside of… (authored by flx). Changed prior to commit: https://reviews.llvm.org/D26203?vs=77343=77430#toc Repository: rL LLVM

[clang-tools-extra] r286424 - [clang-tidy] Do not issue fix for functions that are referenced outside of callExpr

2016-11-09 Thread Felix Berger via cfe-commits
Author: flx Date: Wed Nov 9 19:28:22 2016 New Revision: 286424 URL: http://llvm.org/viewvc/llvm-project?rev=286424=rev Log: [clang-tidy] Do not issue fix for functions that are referenced outside of callExpr Summary: Suppress fixes for functions that are referenced within the compilation unit

[PATCH] D26453: [clang-tidy] Remove duplicated check from move-constructor-init

2016-11-09 Thread Felix Berger via cfe-commits
flx added a comment. Is the modernize-pass-by-value check configurable in a way to only trigger when copied constructor arguments are not moved? I think our use case has been to have move-constructor-init check enabled to catch cases that can be optimized but not trigger on every constructor

[PATCH] D26203: [ClangTidy - performance-unnecessary-value-param]: Do not issue fix for functions that are referenced outside of callExpr

2016-11-09 Thread Felix Berger via cfe-commits
flx marked an inline comment as done. flx added a comment. Thanks for the review! https://reviews.llvm.org/D26203 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D26203: [ClangTidy - performance-unnecessary-value-param]: Do not issue fix for functions that are referenced outside of callExpr

2016-11-09 Thread Felix Berger via cfe-commits
flx removed rL LLVM as the repository for this revision. flx updated this revision to Diff 77343. https://reviews.llvm.org/D26203 Files: clang-tidy/performance/UnnecessaryValueParamCheck.cpp test/clang-tidy/performance-unnecessary-value-param.cpp Index:

[PATCH] D26369: [ClangTidy] Move incomplete type test into separate test file

2016-11-07 Thread Felix Berger via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL286155: [clang-tidy] Move incomplete type test into separate test file (authored by flx). Changed prior to commit: https://reviews.llvm.org/D26369?vs=77094=77095#toc Repository: rL LLVM

[clang-tools-extra] r286155 - [clang-tidy] Move incomplete type test into separate test file

2016-11-07 Thread Felix Berger via cfe-commits
Author: flx Date: Mon Nov 7 15:45:58 2016 New Revision: 286155 URL: http://llvm.org/viewvc/llvm-project?rev=286155=rev Log: [clang-tidy] Move incomplete type test into separate test file Summary: Move in complete type test which does not compile into its own test file. Reviewers: alexfh,

[PATCH] D26369: [ClangTidy] Move incomplete type test into separate test file

2016-11-07 Thread Felix Berger via cfe-commits
flx marked an inline comment as done. flx added inline comments. Comment at: test/clang-tidy/performance-unnecessary-value-param.cpp:257 - -void PositiveNonConstDeclaration(ExpensiveToCopyType A); -// CHECK-FIXES: void PositiveNonConstDeclaration(const ExpensiveToCopyType& A);

[PATCH] D26369: [ClangTidy] Move incomplete type test into separate test file

2016-11-07 Thread Felix Berger via cfe-commits
flx marked an inline comment as done. flx added inline comments. Comment at: test/clang-tidy/performance-unnecessary-value-param.cpp:257 - -void PositiveNonConstDeclaration(ExpensiveToCopyType A); -// CHECK-FIXES: void PositiveNonConstDeclaration(const ExpensiveToCopyType& A);

[PATCH] D26369: [ClangTidy] Move incomplete type test into separate test file

2016-11-07 Thread Felix Berger via cfe-commits
flx removed rL LLVM as the repository for this revision. flx updated this revision to Diff 77094. https://reviews.llvm.org/D26369 Files: test/clang-tidy/performance-unnecessary-value-param-incomplete-type.cpp test/clang-tidy/performance-unnecessary-value-param.cpp Index:

[PATCH] D26195: Ignore incomplete types when determining whether they are expensive to copy

2016-11-07 Thread Felix Berger via cfe-commits
flx added a comment. Comment at: clang-tools-extra/trunk/test/clang-tidy/performance-unnecessary-value-param.cpp:241 + +// Ensure that incomplete types result in an error from the frontend and not a +// clang-tidy diagnostic about IncompleteType being expensive to copy.

[PATCH] D26369: [ClangTidy] Move incomplete type test into separate test file

2016-11-07 Thread Felix Berger via cfe-commits
flx created this revision. flx added reviewers: alexfh, aaron.ballman, sbenza. flx added a subscriber: cfe-commits. flx set the repository for this revision to rL LLVM. Move in complete type test which does not compile into its own test file. Repository: rL LLVM

[PATCH] D26207: [ClangTidy - performance-unnecessary-value-param] Only add "const" when current parameter is not already const qualified

2016-11-04 Thread Felix Berger via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL286010: [ClangTidy - performance-unnecessary-value-param] Only add "const" when current… (authored by flx). Changed prior to commit: https://reviews.llvm.org/D26207?vs=76877=76940#toc Repository: rL

[clang-tools-extra] r286010 - [ClangTidy - performance-unnecessary-value-param] Only add "const" when current parameter is not already const qualified

2016-11-04 Thread Felix Berger via cfe-commits
Author: flx Date: Fri Nov 4 15:51:31 2016 New Revision: 286010 URL: http://llvm.org/viewvc/llvm-project?rev=286010=rev Log: [ClangTidy - performance-unnecessary-value-param] Only add "const" when current parameter is not already const qualified Reviewers: alexfh, sbenza, aaron.ballman

[PATCH] D26195: Ignore incomplete types when determining whether they are expensive to copy

2016-11-04 Thread Felix Berger via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL286008: [clang-tidy] Ignore incomplete types when determining whether they are… (authored by flx). Changed prior to commit: https://reviews.llvm.org/D26195?vs=76934=76935#toc Repository: rL LLVM

[clang-tools-extra] r286008 - [clang-tidy] Ignore incomplete types when determining whether they are expensive to copy

2016-11-04 Thread Felix Berger via cfe-commits
Author: flx Date: Fri Nov 4 15:29:22 2016 New Revision: 286008 URL: http://llvm.org/viewvc/llvm-project?rev=286008=rev Log: [clang-tidy] Ignore incomplete types when determining whether they are expensive to copy Summary: IsExpensiveToCopy can return false positives for incomplete types, so

[PATCH] D26195: Ignore incomplete types when determining whether they are expensive to copy

2016-11-04 Thread Felix Berger via cfe-commits
flx added a comment. In https://reviews.llvm.org/D26195#585917, @aaron.ballman wrote: > In https://reviews.llvm.org/D26195#585198, @flx wrote: > > > In https://reviews.llvm.org/D26195#585091, @aaron.ballman wrote: > > > > > In https://reviews.llvm.org/D26195#584958, @flx wrote: > > > > > > > In

[PATCH] D26195: Ignore incomplete types when determining whether they are expensive to copy

2016-11-04 Thread Felix Berger via cfe-commits
flx removed rL LLVM as the repository for this revision. flx updated this revision to Diff 76928. https://reviews.llvm.org/D26195 Files: clang-tidy/utils/TypeTraits.cpp test/clang-tidy/performance-unnecessary-value-param.cpp Index: test/clang-tidy/performance-unnecessary-value-param.cpp

[PATCH] D26207: [ClangTidy - performance-unnecessary-value-param] Only add "const" when current parameter is not already const qualified

2016-11-04 Thread Felix Berger via cfe-commits
flx added a comment. Aaron, do you have any other comments or does the patch look good to you? https://reviews.llvm.org/D26207 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D26207: [ClangTidy - performance-unnecessary-value-param] Only add "const" when current parameter is not already const qualified

2016-11-03 Thread Felix Berger via cfe-commits
flx removed rL LLVM as the repository for this revision. flx updated this revision to Diff 76877. https://reviews.llvm.org/D26207 Files: clang-tidy/performance/UnnecessaryValueParamCheck.cpp test/clang-tidy/performance-unnecessary-value-param.cpp Index:

[PATCH] D26207: [ClangTidy - performance-unnecessary-value-param] Only add "const" when current parameter is not already const qualified

2016-11-03 Thread Felix Berger via cfe-commits
flx marked an inline comment as done. flx added inline comments. Comment at: test/clang-tidy/performance-unnecessary-value-param.cpp:242 +// Case where parameter in declaration is already const-qualified but not in +// implementation. Make sure a second 'const' is not added to

[PATCH] D26207: [ClangTidy - performance-unnecessary-value-param] Only add "const" when current parameter is not already const qualified

2016-11-02 Thread Felix Berger via cfe-commits
flx added inline comments. Comment at: test/clang-tidy/performance-unnecessary-value-param.cpp:242 +// Case where parameter in declaration is already const-qualified but not in +// implementation. Make sure a second 'const' is not added to the declaration. +void

[PATCH] D26195: Ignore incomplete types when determining whether they are expensive to copy

2016-11-01 Thread Felix Berger via cfe-commits
flx added a comment. In https://reviews.llvm.org/D26195#585091, @aaron.ballman wrote: > In https://reviews.llvm.org/D26195#584958, @flx wrote: > > > In https://reviews.llvm.org/D26195#584730, @aaron.ballman wrote: > > > > > In https://reviews.llvm.org/D26195#584724, @flx wrote: > > > > > > > In

[PATCH] D26207: [ClangTidy - performance-unnecessary-value-param] Only add "const" when current parameter is not already const qualified

2016-11-01 Thread Felix Berger via cfe-commits
flx added inline comments. Comment at: test/clang-tidy/performance-unnecessary-value-param.cpp:242 +// Case where parameter in declaration is already const-qualified but not in +// implementation. Make sure a second 'const' is not added to the declaration. +void

[PATCH] D26207: [ClangTidy - performance-unnecessary-value-param] Only add "const" when current parameter is not already const qualified

2016-11-01 Thread Felix Berger via cfe-commits
flx updated this revision to Diff 76630. Repository: rL LLVM https://reviews.llvm.org/D26207 Files: clang-tidy/performance/UnnecessaryValueParamCheck.cpp test/clang-tidy/performance-unnecessary-value-param.cpp Index: test/clang-tidy/performance-unnecessary-value-param.cpp

[PATCH] D26207: [ClangTidy - performance-unnecessary-value-param] Only add "const" when current parameter is not already const qualified

2016-11-01 Thread Felix Berger via cfe-commits
flx created this revision. flx added reviewers: alexfh, sbenza, aaron.ballman. flx added a subscriber: cfe-commits. flx set the repository for this revision to rL LLVM. Repository: rL LLVM https://reviews.llvm.org/D26207 Files: clang-tidy/performance/UnnecessaryValueParamCheck.cpp

[PATCH] D26195: Ignore incomplete types when determining whether they are expensive to copy

2016-11-01 Thread Felix Berger via cfe-commits
flx added a comment. In https://reviews.llvm.org/D26195#584730, @aaron.ballman wrote: > In https://reviews.llvm.org/D26195#584724, @flx wrote: > > > In https://reviews.llvm.org/D26195#584712, @aaron.ballman wrote: > > > > > Please add a test case with an incomplete type that would exercise this

[PATCH] D26203: [ClangTidy - performance-unnecessary-value-param]: Do not issue fix for functions that are referenced outside of callExpr

2016-11-01 Thread Felix Berger via cfe-commits
flx created this revision. flx added reviewers: alexfh, sbenza. flx added a subscriber: cfe-commits. flx set the repository for this revision to rL LLVM. Suppress fixes for functions that are referenced within the compilation unit outside of a call expression as the signature change could break

[PATCH] D26195: Ignore incomplete types when determining whether they are expensive to copy

2016-11-01 Thread Felix Berger via cfe-commits
flx added a comment. In https://reviews.llvm.org/D26195#584712, @aaron.ballman wrote: > Please add a test case with an incomplete type that would exercise this code > path, otherwise, LGTM. Hi Aaron, do you have any advise on how to add an incomplete type? When debugging this I had a

[PATCH] D26195: Ignore incomplete types when determining whether they are expensive to copy

2016-11-01 Thread Felix Berger via cfe-commits
flx created this revision. flx added a reviewer: alexfh. flx added a subscriber: cfe-commits. flx set the repository for this revision to rL LLVM. IsExpensiveToCopy can return false positives for incomplete types, so ignore them. All existing ClangTidy tests that depend on this function still

Re: [PATCH] D21936: [clang-tidy] UnnecessaryValueParamCheck - only warn for virtual methods

2016-07-05 Thread Felix Berger via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL274552: [clang-tidy] UnnecessaryValueParamCheck - only warn for virtual methods (authored by flx). Changed prior to commit: http://reviews.llvm.org/D21936?vs=62750=62752#toc Repository: rL LLVM

[clang-tools-extra] r274552 - [clang-tidy] UnnecessaryValueParamCheck - only warn for virtual methods

2016-07-05 Thread Felix Berger via cfe-commits
Author: flx Date: Tue Jul 5 09:40:44 2016 New Revision: 274552 URL: http://llvm.org/viewvc/llvm-project?rev=274552=rev Log: [clang-tidy] UnnecessaryValueParamCheck - only warn for virtual methods Summary: As changing virtual methods could break method overrides disable applying the fix and

Re: [PATCH] D21936: [clang-tidy] UnnecessaryValueParamCheck - only warn for virtual methods

2016-07-05 Thread Felix Berger via cfe-commits
flx added inline comments. Comment at: test/clang-tidy/performance-unnecessary-value-param.cpp:234 @@ +233,3 @@ +}; + +struct PositiveNonVirualMethod { alexfh wrote: > Please add a test for an override not explicitly marked "virtual" or > "override". That case

Re: [PATCH] D21936: [clang-tidy] UnnecessaryValueParamCheck - only warn for virtual methods

2016-07-05 Thread Felix Berger via cfe-commits
flx removed rL LLVM as the repository for this revision. flx updated this revision to Diff 62750. http://reviews.llvm.org/D21936 Files: clang-tidy/performance/UnnecessaryValueParamCheck.cpp test/clang-tidy/performance-unnecessary-value-param.cpp Index:

[PATCH] D21936: [clang-tidy] UnnecessaryValueParamCheck - only warn for virtual methods

2016-07-01 Thread Felix Berger via cfe-commits
flx created this revision. flx added reviewers: alexfh, sbenza. flx added a subscriber: cfe-commits. flx set the repository for this revision to rL LLVM. As changing virtual methods could break method overrides disable applying the fix and just warn. Repository: rL LLVM

Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-07-01 Thread Felix Berger via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL274380: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const… (authored by flx). Changed prior to commit: http://reviews.llvm.org/D20277?vs=62524=62530#toc Repository: rL LLVM

[clang-tools-extra] r274380 - [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-07-01 Thread Felix Berger via cfe-commits
Author: flx Date: Fri Jul 1 15:12:15 2016 New Revision: 274380 URL: http://llvm.org/viewvc/llvm-project?rev=274380=rev Log: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved. Summary: Make check more useful in the following two cases: The

Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-07-01 Thread Felix Berger via cfe-commits
flx added inline comments. Comment at: clang-tidy/performance/UnnecessaryValueParamCheck.cpp:34 @@ -29,1 +33,3 @@ +template bool isSetDifferenceEmpty(const S , const S ) { + for (const auto : S1) alexfh wrote: > +1 to `isSubset`. And please add a comment

Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-07-01 Thread Felix Berger via cfe-commits
flx updated this revision to Diff 62524. flx marked 5 inline comments as done. flx added a comment. Thanks for the review. I addressed all remaining comments. http://reviews.llvm.org/D20277 Files: clang-tidy/performance/UnnecessaryValueParamCheck.cpp

Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-05-31 Thread Felix Berger via cfe-commits
flx updated this revision to Diff 59167. http://reviews.llvm.org/D20277 Files: clang-tidy/performance/UnnecessaryValueParamCheck.cpp clang-tidy/performance/UnnecessaryValueParamCheck.h clang-tidy/utils/DeclRefExprUtils.cpp clang-tidy/utils/DeclRefExprUtils.h clang-tidy/utils/Matchers.h

Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-05-31 Thread Felix Berger via cfe-commits
flx updated this revision to Diff 59157. flx marked 2 inline comments as done. http://reviews.llvm.org/D20277 Files: clang-tidy/performance/UnnecessaryValueParamCheck.cpp clang-tidy/performance/UnnecessaryValueParamCheck.h clang-tidy/utils/DeclRefExprUtils.cpp

Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-05-31 Thread Felix Berger via cfe-commits
flx added inline comments. Comment at: clang-tidy/performance/UnnecessaryValueParamCheck.cpp:34 @@ -29,1 +33,3 @@ +template bool isSetDifferenceEmpty(const S , const S ) { + for (const auto : S1) sbenza wrote: > isSubset? In the caller code it seems to me

Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-05-31 Thread Felix Berger via cfe-commits
flx added a comment. In http://reviews.llvm.org/D20277#444023, @Prazek wrote: > In http://reviews.llvm.org/D20277#436725, @flx wrote: > > > In http://reviews.llvm.org/D20277#436717, @Prazek wrote: > > > > > Cool check! Did you think about sugesting std::move for rvalue references > > > if they

Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-05-30 Thread Felix Berger via cfe-commits
flx added a comment. Alex, Sam, could you take another look? It'd be great to get this change in to make the check more useful. http://reviews.llvm.org/D20277 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

Re: [PATCH] D20010: [clang-tidy] UnnecessaryCopyInitialization - Extend to trigger on non-const "this" object argument if it is not modified

2016-05-30 Thread Felix Berger via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL271239: [clang-tidy] UnnecessaryCopyInitialization - Extend to trigger on non-const… (authored by flx). Changed prior to commit: http://reviews.llvm.org/D20010?vs=58181=59010#toc Repository: rL LLVM

[clang-tools-extra] r271239 - [clang-tidy] UnnecessaryCopyInitialization - Extend to trigger on non-const "this" object argument if it is not modified.

2016-05-30 Thread Felix Berger via cfe-commits
Author: flx Date: Mon May 30 19:25:57 2016 New Revision: 271239 URL: http://llvm.org/viewvc/llvm-project?rev=271239=rev Log: [clang-tidy] UnnecessaryCopyInitialization - Extend to trigger on non-const "this" object argument if it is not modified. Summary: Also trigger the check in the

Re: [PATCH] D20010: [clang-tidy] UnnecessaryCopyInitialization - Extend to trigger on non-const "this" object argument if it is not modified

2016-05-26 Thread Felix Berger via cfe-commits
flx added a comment. Friendly ping. http://reviews.llvm.org/D20010 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-05-26 Thread Felix Berger via cfe-commits
flx added a comment. This is ready for review again. http://reviews.llvm.org/D20277 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D20010: [clang-tidy] UnnecessaryCopyInitialization - Extend to trigger on non-const "this" object argument if it is not modified

2016-05-23 Thread Felix Berger via cfe-commits
flx added a comment. In http://reviews.llvm.org/D20010#427510, @alexfh wrote: > How many more (in relative numbers) results does this check generate now? 147% more :) http://reviews.llvm.org/D20010 ___ cfe-commits mailing list

Re: [PATCH] D20010: [clang-tidy] UnnecessaryCopyInitialization - Extend to trigger on non-const "this" object argument if it is not modified

2016-05-23 Thread Felix Berger via cfe-commits
flx removed rL LLVM as the repository for this revision. flx updated this revision to Diff 58181. flx marked an inline comment as done. http://reviews.llvm.org/D20010 Files: clang-tidy/performance/UnnecessaryCopyInitialization.cpp clang-tidy/performance/UnnecessaryCopyInitialization.h

Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-05-23 Thread Felix Berger via cfe-commits
flx added a comment. In http://reviews.llvm.org/D20277#436717, @Prazek wrote: > Cool check! Did you think about sugesting std::move for rvalue references if > they are used once? Thanks! I'm not sure this fits with what a user would expect from a check named "unnecessary-value-param" since

Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-05-23 Thread Felix Berger via cfe-commits
flx updated this revision to Diff 58093. flx added a comment. Upated documentation as well. http://reviews.llvm.org/D20277 Files: clang-tidy/performance/UnnecessaryValueParamCheck.cpp clang-tidy/performance/UnnecessaryValueParamCheck.h clang-tidy/utils/CMakeLists.txt

Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-05-23 Thread Felix Berger via cfe-commits
flx added inline comments. Comment at: clang-tidy/utils/TypeTraits.cpp:131 @@ +130,3 @@ + return Record->hasNonTrivialMoveConstructor(); +} + Done. Shortened this now to just check whether the type has a non-trivial move constructor or assignment operator. For

Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-05-23 Thread Felix Berger via cfe-commits
flx updated this revision to Diff 58090. http://reviews.llvm.org/D20277 Files: clang-tidy/performance/UnnecessaryValueParamCheck.cpp clang-tidy/performance/UnnecessaryValueParamCheck.h clang-tidy/utils/CMakeLists.txt clang-tidy/utils/DeclRefExprUtils.cpp

Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-05-18 Thread Felix Berger via cfe-commits
flx removed rL LLVM as the repository for this revision. flx updated this revision to Diff 57620. http://reviews.llvm.org/D20277 Files: clang-tidy/performance/UnnecessaryValueParamCheck.cpp clang-tidy/performance/UnnecessaryValueParamCheck.h clang-tidy/utils/CMakeLists.txt

Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-05-18 Thread Felix Berger via cfe-commits
flx added inline comments. Comment at: clang-tidy/utils/TypeTraits.cpp:131 @@ +130,3 @@ + for (const auto *Constructor : Record->ctors()) { +if (Constructor->isMoveConstructor() && !Constructor->isDeleted()) + return true; Sorry I missed this. Will

Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-05-18 Thread Felix Berger via cfe-commits
flx marked 4 inline comments as done. flx added a comment. Thanks for the feedback! http://reviews.llvm.org/D20277 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-05-15 Thread Felix Berger via cfe-commits
flx created this revision. flx added reviewers: alexfh, sbenza. flx added a subscriber: cfe-commits. flx set the repository for this revision to rL LLVM. Make check more useful in the following two cases: 1. The parameter is passed by non-const value, has a non-deleted move constructor and is

Re: [PATCH] D20170: [clang-tidy] TypeTraits - Type is not expensive to copy when it has a deleted copy constructor.

2016-05-14 Thread Felix Berger via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL269581: [clang-tidy] TypeTraits - Type is not expensive to copy when it has a deleted… (authored by flx). Changed prior to commit: http://reviews.llvm.org/D20170?vs=57286=57287#toc Repository: rL

[clang-tools-extra] r269581 - [clang-tidy] TypeTraits - Type is not expensive to copy when it has a deleted copy constructor.

2016-05-14 Thread Felix Berger via cfe-commits
Author: flx Date: Sat May 14 17:43:50 2016 New Revision: 269581 URL: http://llvm.org/viewvc/llvm-project?rev=269581=rev Log: [clang-tidy] TypeTraits - Type is not expensive to copy when it has a deleted copy constructor. Reviewers: alexfh, sbenza Subscribers: etienneb, aaron.ballman,

Re: [PATCH] D20170: [clang-tidy] TypeTraits - Type is not expensive to copy when it has a deleted copy constructor.

2016-05-14 Thread Felix Berger via cfe-commits
flx added inline comments. Comment at: clang-tidy/utils/TypeTraits.cpp:42 @@ -27,3 +41,3 @@ llvm::Optional isExpensiveToCopy(QualType Type, ASTContext ) { if (Type->isDependentType()) etienneb wrote: > You're right too. > But, it's possible to fix these

Re: [PATCH] D20170: [clang-tidy] TypeTraits - Type is not expensive to copy when it has a deleted copy constructor.

2016-05-14 Thread Felix Berger via cfe-commits
flx updated this revision to Diff 57286. flx marked 3 inline comments as done. http://reviews.llvm.org/D20170 Files: clang-tidy/utils/TypeTraits.cpp clang-tidy/utils/TypeTraits.h test/clang-tidy/performance-unnecessary-value-param.cpp Index:

Re: [PATCH] D19865: [clang-tidy] - PerformanceUnnecesaryCopyInitialization - only trigger for decl stmts with single VarDecl.

2016-05-12 Thread Felix Berger via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL269389: [clang-tidy] - PerformanceUnnecesaryCopyInitialization - only trigger for… (authored by flx). Changed prior to commit: http://reviews.llvm.org/D19865?vs=56573=57130#toc Repository: rL LLVM

  1   2   >