[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-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(), construc

[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(), construc

[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] [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] [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] : V

[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] [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? https://github.com/llvm/llvm-project/pul

[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] 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] [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-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] 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] 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] 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] 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] 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] 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] 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] 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&view=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

[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&view=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 Subscr

[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&view=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 templa

[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&view=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

[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 pa

[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 compila

[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 t

[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] 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 test/cla

[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 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 PositiveConstDecl

[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 h

[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 PositiveConstDecl

[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 th

[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: test/clang-tidy/performance-unnecessa

[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] 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] 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 h

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

2016-11-04 Thread Felix Berger via cfe-commits
flx updated this revision to Diff 76934. 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

[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&view=rev Log: [clang-tidy] Ignore incomplete types when determining whether they are expensive to copy Summary: IsExpensiveToCopy can return false positives for incomplete types, s

[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&id=76935#toc Repository: rL LLVM

[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&view=rev Log: [ClangTidy - performance-unnecessary-value-param] Only add "const" when current parameter is not already const qualified Reviewers: alexfh, sbenza, aaron.ballman Sub

[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&id=76940#toc Repository:

[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 https://reviews.llvm.org/D2636

[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 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: test/clang-tidy/per

[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); --

[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&view=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
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&id=77095#toc Repository: rL LLVM https://r

[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: test/clang-tidy/performance-unnecessa

[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] 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 th

[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&view=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 u

[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&id=77430#toc Repository: rL LL

[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 maili

[PATCH] D12839: Extend MoveConstructorInitCheck to also flag constructor arguments passed by value and can be moved assigned to fields.

2015-09-14 Thread Felix Berger via cfe-commits
flx created this revision. flx added reviewers: alexfh, sbenza, aaron.ballman. flx added a subscriber: cfe-commits. Add matcher that identifies arguments that are passed by value, are copy assigned to a class field and have a non-deleted move constructor. If the type is also expensive to copy is

Re: [PATCH] D12839: Extend MoveConstructorInitCheck to also flag constructor arguments passed by value and can be moved assigned to fields.

2015-09-20 Thread Felix Berger via cfe-commits
flx updated this revision to Diff 35204. flx marked 10 inline comments as done. http://reviews.llvm.org/D12839 Files: clang-tidy/misc/MoveConstructorInitCheck.cpp clang-tidy/misc/MoveConstructorInitCheck.h clang-tidy/utils/CMakeLists.txt clang-tidy/utils/Matchers.h clang-tidy/utils/Type

Re: [PATCH] D12839: Extend MoveConstructorInitCheck to also flag constructor arguments passed by value and can be moved assigned to fields.

2015-09-20 Thread Felix Berger via cfe-commits
flx added inline comments. Comment at: clang-tidy/misc/MoveConstructorInitCheck.cpp:38 @@ +37,3 @@ + Node.isTriviallyCopyableType(Finder->getASTContext()) || + classHasTrivialCopyAndDestroy(Node)) { +return false; aaron.ballman wrote: > Why do you ne

Re: [PATCH] D12839: Extend MoveConstructorInitCheck to also flag constructor arguments passed by value and can be moved assigned to fields.

2015-09-27 Thread Felix Berger via cfe-commits
flx updated this revision to Diff 35826. flx marked 7 inline comments as done. flx added a comment. I changed the check to also produce a fix that wraps the argument in std::move(). When I modified the test include -isystem %S/Inputs/Headers it broke and only produces warnings but no fixes anym

Re: [PATCH] D12839: Extend MoveConstructorInitCheck to also flag constructor arguments passed by value and can be moved assigned to fields.

2015-09-29 Thread Felix Berger via cfe-commits
flx updated this revision to Diff 36049. flx marked 3 inline comments as done. flx added a comment. I had to convert the line endings of mis-move-constructor-init.cpp to unix style otherwise the test would not correctly work. This took a long time to debug since the checks failed complaining tha

Re: [PATCH] D12839: Extend MoveConstructorInitCheck to also flag constructor arguments passed by value and can be moved assigned to fields.

2015-09-30 Thread Felix Berger via cfe-commits
flx updated this revision to Diff 36151. flx marked an inline comment as done. flx added a comment. Thanks for catching the last issues, Alex. I rebuilt and ran all tests using llvm-lit -v . for clang-tidy and they pass. http://reviews.llvm.org/D12839 Files: clang-tidy/misc/MoveConstructorIn

Re: [PATCH] D12839: Extend MoveConstructorInitCheck to also flag constructor arguments passed by value and can be moved assigned to fields.

2015-10-03 Thread Felix Berger via cfe-commits
flx updated this revision to Diff 36433. flx added a comment. Updated patch to new cxx* matcher variants. http://reviews.llvm.org/D12839 Files: clang-tidy/misc/MoveConstructorInitCheck.cpp clang-tidy/misc/MoveConstructorInitCheck.h clang-tidy/modernize/PassByValueCheck.cpp clang-tidy/mo

Re: [PATCH] D12839: Extend MoveConstructorInitCheck to also flag constructor arguments passed by value and can be moved assigned to fields.

2015-10-06 Thread Felix Berger via cfe-commits
flx added a comment. I don't have access, so that'd be great if you or Alex could submit the patch, thanks! Comment at: clang-tidy/misc/MoveConstructorInitCheck.cpp:11 @@ -10,2 +10,3 @@ #include "MoveConstructorInitCheck.h" +#include "../utils/Matchers.h" #include "clang/AST/

Re: [PATCH] D16517: ClangTidy check to flag uninitialized builtin and pointer fields.

2016-02-04 Thread Felix Berger via cfe-commits
flx added a comment. Hi Alex, could you take a look at the questions I posted in my last comment. Maybe there is some renaming work I can tackle while you review the change in more detail. http://reviews.llvm.org/D16517 ___ cfe-commits mailing lis

Re: [PATCH] D16517: ClangTidy check to flag uninitialized builtin and pointer fields.

2016-02-07 Thread Felix Berger via cfe-commits
flx updated this revision to Diff 47159. flx marked 12 inline comments as done. flx added a comment. Thanks for the review, Alex! This is an intermediate updated patch that addresses your detailed comments. I'll rename the whole check in the next couple of days and will re-upload again. http:/

Re: [PATCH] D16517: ClangTidy check to flag uninitialized builtin and pointer fields.

2016-02-08 Thread Felix Berger via cfe-commits
flx added inline comments. Comment at: clang-tidy/misc/UninitializedFieldCheck.cpp:178 @@ +177,3 @@ + + SmallPtrSet FieldsToInit; + fieldsRequiringInit(MemberFields, FieldsToInit); alexfh wrote: > What about this? (relates to line 184 now) My comment on this was

Re: [PATCH] D16517: ClangTidy check to flag uninitialized builtin and pointer fields.

2016-02-08 Thread Felix Berger via cfe-commits
flx updated this revision to Diff 47280. flx added a comment. Renamed the check to: cppcoreguidelines-pro-type-member-init, note the extra dash between member and init to be consistent with the camelcase notation of the class name ProTypeMemberInitCheck. http://reviews.llvm.org/D16517 Files:

[PATCH] D17064: Only invoke ForRangeCopyCheck on expensive-to-copy types.

2016-02-09 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. Fix oversight not checking the value of the Optional returned by isExpensiveToCopy(). Repository: rL LLVM http://reviews.llvm.org/D17064 Files:

Re: [PATCH] D16517: ClangTidy check to flag uninitialized builtin and pointer fields.

2016-02-10 Thread Felix Berger via cfe-commits
flx added inline comments. Comment at: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp:205 @@ +204,3 @@ + Diag << FixItHint::CreateInsertion( + Field->getSourceRange().getEnd().getLocWithOffset( + Field->getName().size()), alexfh

Re: [PATCH] D16517: ClangTidy check to flag uninitialized builtin and pointer fields.

2016-02-10 Thread Felix Berger via cfe-commits
flx updated this revision to Diff 47590. flx marked 3 inline comments as done. http://reviews.llvm.org/D16517 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp clang-tidy/

Re: [PATCH] D16517: ClangTidy check to flag uninitialized builtin and pointer fields.

2016-02-10 Thread Felix Berger via cfe-commits
flx updated this revision to Diff 47594. flx added a comment. Added comment that we're returning early if this constructor simply delegates to another constructor. http://reviews.llvm.org/D16517 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelin

Re: [PATCH] D16517: ClangTidy check to flag uninitialized builtin and pointer fields.

2016-02-11 Thread Felix Berger via cfe-commits
flx updated this revision to Diff 47757. flx marked 2 inline comments as done. http://reviews.llvm.org/D16517 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp clang-tidy/

Re: [PATCH] D16517: ClangTidy check to flag uninitialized builtin and pointer fields.

2016-02-11 Thread Felix Berger via cfe-commits
flx added inline comments. Comment at: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp:206 @@ +205,3 @@ + // Do not propose fixes in macros since we cannot place them correctly. + if (Ctor->getLocStart().isMacroID()) +return; alexfh wrote: > IIUC wha

[clang-tools-extra] r260869 - Improve documentation

2016-02-14 Thread Felix Berger via cfe-commits
Author: flx Date: Sun Feb 14 21:27:54 2016 New Revision: 260869 URL: http://llvm.org/viewvc/llvm-project?rev=260869&view=rev Log: Improve documentation Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/performance-for-range-copy.rst Modified: clang-tools-extra/trunk/docs/clang-tidy/

[clang-tools-extra] r260870 - [clang-tidy] Only invoke ForRangeCopyCheck on expensive-to-copy types.

2016-02-14 Thread Felix Berger via cfe-commits
Author: flx Date: Sun Feb 14 21:36:23 2016 New Revision: 260870 URL: http://llvm.org/viewvc/llvm-project?rev=260870&view=rev Log: [clang-tidy] Only invoke ForRangeCopyCheck on expensive-to-copy types. Summary: Fix oversight not checking the value of the Optional returned by isExpensiveToCopy().

Re: [PATCH] D17064: Only invoke ForRangeCopyCheck on expensive-to-copy types.

2016-02-14 Thread Felix Berger via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL260870: [clang-tidy] Only invoke ForRangeCopyCheck on expensive-to-copy types. (authored by flx). Changed prior to commit: http://reviews.llvm.org/D17064?vs=47419&id=47940#toc Repository: rL LLVM ht

r260872 - Add isAnyPointer() matchers. Register missing matchers.

2016-02-14 Thread Felix Berger via cfe-commits
Author: flx Date: Sun Feb 14 22:00:39 2016 New Revision: 260872 URL: http://llvm.org/viewvc/llvm-project?rev=260872&view=rev Log: Add isAnyPointer() matchers. Register missing matchers. Summary: The isAnyPointer() matcher is useful for http://reviews.llvm.org/D15623. Reviewers: alexfh, klimek S

Re: [PATCH] D16517: ClangTidy check to flag uninitialized builtin and pointer fields.

2016-02-14 Thread Felix Berger via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL260873: [clang-tidy] ClangTidy check to flag uninitialized builtin and pointer fields. (authored by flx). Changed prior to commit: http://reviews.llvm.org/D16517?vs=47757&id=47942#toc Repository: rL

[clang-tools-extra] r260873 - [clang-tidy] ClangTidy check to flag uninitialized builtin and pointer fields.

2016-02-14 Thread Felix Berger via cfe-commits
Author: flx Date: Sun Feb 14 22:27:56 2016 New Revision: 260873 URL: http://llvm.org/viewvc/llvm-project?rev=260873&view=rev Log: [clang-tidy] ClangTidy check to flag uninitialized builtin and pointer fields. Summary: This patch is a continuation of http://reviews.llvm.org/D10553 by Jonathan B C

Re: r260872 - Add isAnyPointer() matchers. Register missing matchers.

2016-02-20 Thread Felix Berger via cfe-commits
On Mon, Feb 15, 2016 at 8:05 AM, Aaron Ballman wrote: > On Sun, Feb 14, 2016 at 11:00 PM, Felix Berger via cfe-commits > wrote: > > Author: flx > > Date: Sun Feb 14 22:00:39 2016 > > New Revision: 260872 > > > > URL: http://llvm.org/viewvc/llvm-project?

[PATCH] D17488: Extend UnnecessaryCopyInitialization check to trigger on non-const copies that can be safely converted to const references.

2016-02-20 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. Move code shared between UnnecessaryCopyInitialization and ForRangeCopyCheck into utilities files. Add more test cases for UnnecessaryCopyInitializati

[PATCH] D17491: Add performance check to flag function parameters of expensive to copy types that can be safely converted to const references.

2016-02-21 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. The patch uses [[ http://reviews.llvm.org/D17488 | D17488 ]] as diff base. Once D17488 is submitted I'll update the diffbase to head. Repository: r

[clang-tools-extra] r268352 - [clang-tidy] ProTypeMemberInitCheck - check that field decls do not have in-class initializer.

2016-05-02 Thread Felix Berger via cfe-commits
Author: flx Date: Mon May 2 20:41:19 2016 New Revision: 268352 URL: http://llvm.org/viewvc/llvm-project?rev=268352&view=rev Log: [clang-tidy] ProTypeMemberInitCheck - check that field decls do not have in-class initializer. Reviewers: alexfh, JVApen, aaron.ballman Subscribers: flx, aaron.ballm

Re: [PATCH] D18300: [clang-tidy] ProTypeMemberInitCheck - check that field decls do not have in-class initializer

2016-05-02 Thread Felix Berger via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL268352: [clang-tidy] ProTypeMemberInitCheck - check that field decls do not have in… (authored by flx). Changed prior to commit: http://reviews.llvm.org/D18300?vs=51123&id=55934#toc Repository: rL LL

[PATCH] D19849: [clang-tidy] MoveConstructorInitCheck - Add parameter name to check message.

2016-05-02 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. Repository: rL LLVM http://reviews.llvm.org/D19849 Files: clang-tidy/misc/MoveConstructorInitCheck.cpp test/clang-tidy/misc-move-constructor-in

Re: [PATCH] D19849: [clang-tidy] MoveConstructorInitCheck - Add parameter name to check message.

2016-05-03 Thread Felix Berger via cfe-commits
flx removed rL LLVM as the repository for this revision. flx updated this revision to Diff 55975. http://reviews.llvm.org/D19849 Files: clang-tidy/misc/MoveConstructorInitCheck.cpp test/clang-tidy/misc-move-constructor-init.cpp Index: test/clang-tidy/misc-move-constructor-init.cpp ==

Re: [PATCH] D19849: [clang-tidy] MoveConstructorInitCheck - Add parameter name to check message.

2016-05-03 Thread Felix Berger via cfe-commits
flx marked an inline comment as done. flx added a comment. Done. http://reviews.llvm.org/D19849 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D19849: [clang-tidy] MoveConstructorInitCheck - Add parameter name to check message.

2016-05-03 Thread Felix Berger via cfe-commits
flx added a comment. In http://reviews.llvm.org/D19849#419751, @aaron.ballman wrote: > I'm not opposed to showing the name, but I'm not certain I understand under > what circumstances the name would be useful. Since this is triggering on move > constructors, and move constructors can only have

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

2016-05-03 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. This fixes bug: https://llvm.org/bugs/show_bug.cgi?id=27325 Repository: rL LLVM http://reviews.llvm.org/D19865 Files: clang-tidy/performance/Unn

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

2016-05-03 Thread Felix Berger via cfe-commits
flx added a comment. In http://reviews.llvm.org/D19865#419830, @alexfh wrote: > Is it a workaround to avoid breaking the code by incorrect fixes? Yes. We can't simply change the type of DeclStmt when we only look one of the VarDecls and how it is initialized. Repository: rL LLVM http://re

[clang-tools-extra] r268461 - [clang-tidy] MoveConstructorInitCheck - Add parameter name to check message.

2016-05-03 Thread Felix Berger via cfe-commits
Author: flx Date: Tue May 3 18:07:44 2016 New Revision: 268461 URL: http://llvm.org/viewvc/llvm-project?rev=268461&view=rev Log: [clang-tidy] MoveConstructorInitCheck - Add parameter name to check message. Reviewers: alexfh Subscribers: aaron.ballman, cfe-commits Differential Revision: http://

Re: [PATCH] D19849: [clang-tidy] MoveConstructorInitCheck - Add parameter name to check message.

2016-05-03 Thread Felix Berger via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL268461: [clang-tidy] MoveConstructorInitCheck - Add parameter name to check message. (authored by flx). Changed prior to commit: http://reviews.llvm.org/D19849?vs=55975&id=56076#toc Repository: rL LL

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

2016-05-05 Thread Felix Berger via cfe-commits
flx added a comment. In http://reviews.llvm.org/D19865#419905, @flx wrote: > In http://reviews.llvm.org/D19865#419830, @alexfh wrote: > > > Is it a workaround to avoid breaking the code by incorrect fixes? > > > Yes. We can't simply change the type of DeclStmt when we only look one of the > VarD

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

2016-05-05 Thread Felix Berger via cfe-commits
flx created this revision. flx added a subscriber: cfe-commits. flx set the repository for this revision to rL LLVM. Also trigger the check in the following case: void foo() { ExpensiveToCopy Obj; const auto UnnecessaryCopy = Obj.constReference(); Obj.onlyUsedAsConst(); } i.e. when the obj

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

2016-05-09 Thread Felix Berger via cfe-commits
flx added a comment. In http://reviews.llvm.org/D19865#423140, @flx wrote: > In http://reviews.llvm.org/D19865#419905, @flx wrote: > > > In http://reviews.llvm.org/D19865#419830, @alexfh wrote: > > > > > Is it a workaround to avoid breaking the code by incorrect fixes? > > > > > > Yes. We can't s

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

2016-05-09 Thread Felix Berger via cfe-commits
flx removed rL LLVM as the repository for this revision. flx updated this revision to Diff 56573. http://reviews.llvm.org/D19865 Files: clang-tidy/performance/UnnecessaryCopyInitialization.cpp clang-tidy/performance/UnnecessaryCopyInitialization.h test/clang-tidy/performance-unnecessary-cop

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

2016-05-11 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. Repository: rL LLVM http://reviews.llvm.org/D20170 Files: clang-tidy/utils/TypeTraits.cpp test/clang-tidy/performance-unnecessary-value-

  1   2   >