[PATCH] D52315: [clang-tidy] Fix for performance-unnecessary-value-param, performance-unnecessary-copy-initialization and performance-for-range-copy

2018-09-20 Thread Felix Berger via Phabricator via cfe-commits
flx added inline comments. Comment at: clang-tidy/utils/TypeTraits.cpp:49 + if (Context.getTypeSize(Type) <= Context.getTypeSize(Context.VoidPtrTy)) +return false; + This early return now ignores the fact that the type has non-trivial copy constructors, vir

[PATCH] D52360: [clang-tidy] Fix for performance-unnecessary-value-param, performance-unnecessary-copy-initialization and performance-for-range-copy

2018-09-26 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. In https://reviews.llvm.org/D52360#1246472, @baloghadamsoftware wrote: > In https://reviews.llvm.org/D52360#1246443, @danilaml wrote: > > > Would that also skip checks for something like `shared_ptr`? > > > Yes, everything ending on `pointer`, `ptr`, `reference` or `ref`, fir

[PATCH] D79440: Fix ForRangeCopyCheck not triggering on iterators returning elements by value in C++17.

2020-05-05 Thread Felix Berger via Phabricator via cfe-commits
flx created this revision. flx added a reviewer: gribozavr2. Herald added a project: clang. Herald added a subscriber: cfe-commits. The AST is different in C++17 in that there is no MaterializeTemporaryExpr for in the AST for a loop variable that is initialized from an iterator that returns its

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

2021-07-16 Thread Felix Berger via Phabricator via cfe-commits
flx created this revision. flx added reviewers: aaron.ballman, ymandel, gribozavr2. Herald added a subscriber: xazax.hun. flx requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Add string list option of type names analagous to `All

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

2021-07-22 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 360865. flx added a comment. Add test file for the new option. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106173/new/ https://reviews.llvm.org/D106173 Files: clang-tools-extra/clang-tidy/performance/Unnecessa

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

2021-07-22 Thread Felix Berger via Phabricator via cfe-commits
flx marked an inline comment as done. flx added a comment. I also added a file testing the new option. Comment at: clang-tools-extra/docs/clang-tidy/checks/performance-unnecessary-copy-initialization.rst:53 + + A semicolon-separated list of names of types whose methods are n

[PATCH] D106011: [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 Phabricator via cfe-commits
flx updated this revision to Diff 360868. flx added a comment. Addressed review feedback. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106011/new/ https://reviews.llvm.org/D106011 Files: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyI

[PATCH] D106011: [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 Phabricator via cfe-commits
flx added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp:178-183 + if (VarTmplType->getReplacedParameter()->desugar().getCanonicalType() != + InitializerTmplType->getReplacedParameter() + ->desug

[PATCH] D106011: [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 Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG00edae9203c9: [clang-tidy] performance-unnecessary-copy-initialization: Disable check when… (authored by flx). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/

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

2021-07-22 Thread Felix Berger via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. flx marked an inline comment as done. Closed by commit rGcb4c12b6117a: [clang-tidy] performance-unnecessary-copy-initialization: Create option to… (authored by flx). Changed prior to commit: https://reviews.llvm.org/D106

[PATCH] D116593: Fix `performance-unnecessary-value-param` for template specialization

2022-05-20 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. I don't have access to Windows, perhaps rebase and try again? It looks like the template specialization related tests are failing there though. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116593/new/ https://reviews.llvm.org/D116593 _

[PATCH] D87455: [clang-tidy] performance-unnecessary-copy-initialization: Restrict UnnecessaryCopyInitialization check to variables initialized from free functions without arguments

2020-09-14 Thread Felix Berger via Phabricator via cfe-commits
flx added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp:126 if (OldVar == nullptr) { +// Only allow initialization of a const reference from a free function if it +// has no arguments or only default arguments

[PATCH] D87455: [clang-tidy] performance-unnecessary-copy-initialization: Restrict UnnecessaryCopyInitialization check to variables initialized from free functions without arguments

2020-09-14 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 291584. flx edited the summary of this revision. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87455/new/ https://reviews.llvm.org/D87455 Files: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp clang-tools-extra/test/clang-

[PATCH] D87455: [clang-tidy] performance-unnecessary-copy-initialization: Restrict UnnecessaryCopyInitialization check to variables initialized from free functions without arguments

2020-09-14 Thread Felix Berger via Phabricator via cfe-commits
flx added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp:126 if (OldVar == nullptr) { +// Only allow initialization of a const reference from a free function if it +// has no arguments or only default arguments

[PATCH] D87455: [clang-tidy] performance-unnecessary-copy-initialization: Restrict UnnecessaryCopyInitialization check to variables initialized from free functions without arguments

2020-09-14 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 291610. flx marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87455/new/ https://reviews.llvm.org/D87455 Files: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp clang-tools-extra/test/clang-tid

[PATCH] D87455: [clang-tidy] performance-unnecessary-copy-initialization: Restrict UnnecessaryCopyInitialization check to variables initialized from free functions without arguments

2020-09-14 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. Thank you for the review, Aaron! I don't have have commit access. Would you mind submitting it? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87455/new/ https://reviews.llvm.org/D87455 ___ cfe-commits mailing list cfe-co

[PATCH] D87455: Restrict UnnecessaryCopyInitialization check to variables initialized from methods/functions without arguments

2020-09-10 Thread Felix Berger via Phabricator via cfe-commits
flx created this revision. flx added reviewers: alexfh, sbenza. Herald added a project: clang. Herald added a subscriber: cfe-commits. flx requested review of this revision. This restriction avoids cases where an alias is returned to an argument and which could lead to to a false positive change.

[PATCH] D87455: [clang-tidy] performance-unnecessary-copy-initialization: Restrict UnnecessaryCopyInitialization check to variables initialized from methods/functions without arguments

2020-09-10 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. The motivating false positive was the free functions `std::min`. To not limit the usefulness of the check I'll only disable arguments for free functions for now. Updated change coming. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.

[PATCH] D87455: [clang-tidy] performance-unnecessary-copy-initialization: Restrict UnnecessaryCopyInitialization check to variables initialized from free functions without arguments

2020-09-10 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 291030. flx retitled this revision from "[clang-tidy] performance-unnecessary-copy-initialization: Restrict UnnecessaryCopyInitialization check to variables initialized from methods/functions without arguments " to "[clang-tidy] performance-unnecessary-copy-ini

[PATCH] D91893: [clang-tidy] performance-unnecessary-copy-initialization: Prevent false positives when dependent variable is modified.

2020-12-08 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 310285. flx marked 5 inline comments as done. flx added a comment. Address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91893/new/ https://reviews.llvm.org/D91893 Files: clang-tools-extra/clang

[PATCH] D91893: [clang-tidy] performance-unnecessary-copy-initialization: Prevent false positives when dependent variable is modified.

2020-12-08 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. Thanks for the review, Aaron! I appreciate it. Please let me know if you have any questions about the test cases. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91893/new/ https://reviews.llvm.org/D91893 __

[PATCH] D91893: [clang-tidy] performance-unnecessary-copy-initialization: Prevent false positives when dependent variable is modified.

2020-12-10 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 310888. flx added a comment. Added positive variants of new tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91893/new/ https://reviews.llvm.org/D91893 Files: clang-tools-extra/clang-tidy/performance/Unneces

[PATCH] D91893: [clang-tidy] performance-unnecessary-copy-initialization: Prevent false positives when dependent variable is modified.

2020-12-10 Thread Felix Berger via Phabricator via cfe-commits
flx marked an inline comment as done. flx added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/performance-unnecessary-copy-initialization.cpp:492 + Orig.nonConstMethod(); +} aaron.ballman wrote: > Making sure I understand properly, if

[PATCH] D91893: [clang-tidy] performance-unnecessary-copy-initialization: Prevent false positives when dependent variable is modified.

2020-12-10 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 310997. flx marked an inline comment as done. flx added a comment. Shortened isa<> expression. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91893/new/ https://reviews.llvm.org/D91893 Files: clang-tools-extra/cl

[PATCH] D91893: [clang-tidy] performance-unnecessary-copy-initialization: Prevent false positives when dependent variable is modified.

2020-12-10 Thread Felix Berger via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG671ad580610a: [clang-tidy] performance-unnecessary-copy-initialization: Prevent false… (authored by flx). Repository: rG LLVM Github Monorepo CHA

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

2020-11-11 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. In D90042#2368219 , @aaron.ballman wrote: > In D90042#2360042 , @flx wrote: > >> In D90042#2357078 , @aaron.ballman >> wrote: >> >>> In D90042#2356265

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

2020-11-12 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 304831. flx added a comment. Fixed definition of fake std::function which now makes the bug fixed by this change reproducible. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90042/new/ https://reviews.llvm.org/D900

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

2020-11-12 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 304833. flx added a comment. Remove unnecessary test code that is not needed. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90042/new/ https://reviews.llvm.org/D90042 Files: clang-tools-extra/clang-tidy/utils/De

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

2020-11-12 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. In D90042#2391246 , @aaron.ballman wrote: > In D90042#2390203 , @flx wrote: > >> Thanks for the suggestion, I had never hear of creduce! > > Glad to have introduced you to it -- it's a great to

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

2020-11-12 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 304834. flx added a comment. Updated change description. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90042/new/ https://reviews.llvm.org/D90042 Files: clang-tools-extra/clang-tidy/utils/DeclRefExprUtils.cpp

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

2020-11-16 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. In D90042#2397885 , @aaron.ballman wrote: > LGTM, thank you for the fix! Thanks for helping track down the difference in our definition of std::function :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https:/

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

2020-11-16 Thread Felix Berger via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGace9653c11c6: [clang-tidy] performance-unnecessary-copy-initialization: Check for const… (authored by flx). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D900

[PATCH] D89332: Always allow std::function to be copied.

2020-10-13 Thread Felix Berger via Phabricator via cfe-commits
flx created this revision. flx added a reviewer: aaron.ballman. Herald added a project: clang. flx requested review of this revision. Since its call operator is const but can modify the state of its underlying functor we cannot tell whether the copy is necessary or not. This avoids false positive

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-13 Thread Felix Berger via Phabricator via cfe-commits
flx added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp:52 AllowedTypes( utils::options::parseStringList(Options.get("AllowedTypes", ""))) {} lebedev.ri wrote: > Just put it here? I tr

[PATCH] D91893: [clang-tidy] performance-unnecessary-copy-initialization: Prevent false positives when dependent variable is modified.

2020-11-20 Thread Felix Berger via Phabricator via cfe-commits
flx created this revision. flx added reviewers: aaron.ballman, hokein. Herald added subscribers: cfe-commits, xazax.hun. Herald added a project: clang. flx requested review of this revision. Extend the check to not only look at the variable the unnecessarily copied variable is initialized from, bu

[PATCH] D91893: [clang-tidy] performance-unnecessary-copy-initialization: Prevent false positives when dependent variable is modified.

2020-11-20 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 306773. flx added a comment. Fix formatting and comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91893/new/ https://reviews.llvm.org/D91893 Files: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyI

[PATCH] D91893: [clang-tidy] performance-unnecessary-copy-initialization: Prevent false positives when dependent variable is modified.

2020-12-03 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 309361. flx added a comment. Fixed clang tidy warnings. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91893/new/ https://reviews.llvm.org/D91893 Files: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyIni

[PATCH] D91893: [clang-tidy] performance-unnecessary-copy-initialization: Prevent false positives when dependent variable is modified.

2020-12-07 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. Could someone take a first pass at this change? It would be great progress on this as this is the last currently known case that generates false positives. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91893/new/ https://revie

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-16 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 298745. flx added a comment. Add more complete fake version of std::function. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89332/new/ https://reviews.llvm.org/D89332 Files: clang-tools-extra/clang-tidy/performa

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-16 Thread Felix Berger via Phabricator via cfe-commits
flx added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp:52 AllowedTypes( utils::options::parseStringList(Options.get("AllowedTypes", ""))) {} lebedev.ri wrote: > flx wrote: > > lebedev

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-20 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 299471. flx added a comment. Use hasName matcher on the declaration of the canonical type. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89332/new/ https://reviews.llvm.org/D89332 Files: clang-tools-extra/clang-

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-20 Thread Felix Berger via Phabricator via cfe-commits
flx marked 2 inline comments as done. flx added a comment. Thank you all for the input! In D89332#2336566 , @njames93 wrote: > How does this type alias and typedef, In theory that should also be handled. > > using Functor = std::function<...>; > Funct

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-21 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 299684. flx added a comment. Fix compile errors. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89332/new/ https://reviews.llvm.org/D89332 Files: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitializa

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-21 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 299794. flx added a comment. Add fake std function to ensure it is still matched. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89332/new/ https://reviews.llvm.org/D89332 Files: clang-tools-extra/clang-tidy/perf

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-21 Thread Felix Berger via Phabricator via cfe-commits
flx marked an inline comment as done. flx added a comment. Added a fake std function that still triggers the check. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89332/new/ https://reviews.llvm.org/D89332 __

[PATCH] D89332: [clang-tidy] performance-unnecessary-copy-initialization: Always allow std::function to be copied.

2020-10-21 Thread Felix Berger via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG1c1f794c2b64: Always allow std::function to be copied. (authored by flx). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89332/new/ https://reviews.llvm.org/

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

2020-10-23 Thread Felix Berger via Phabricator via cfe-commits
flx created this revision. flx added reviewers: aaron.ballman, gribozavr2. Herald added subscribers: cfe-commits, xazax.hun. Herald added a project: clang. flx requested review of this revision. This fixes false positive cases where a non-const reference is passed to a std::function but interprete

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

2020-10-23 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 300274. flx added a comment. Remove code comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90042/new/ https://reviews.llvm.org/D90042 Files: clang-tools-extra/clang-tidy/utils/DeclRefExprUtils.cpp clang-

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

2020-10-23 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 300276. flx added a comment. Revert -std=c++17 change. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90042/new/ https://reviews.llvm.org/D90042 Files: clang-tools-extra/clang-tidy/utils/DeclRefExprUtils.cpp c

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

2020-10-23 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. I should note that I was only able to reproduce the false positive with the actual implementation std::function and not our fake version here. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90042/new/ https://reviews.llvm.org/D

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

2020-10-27 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. In D90042#2356180 , @aaron.ballman wrote: > In D90042#2350035 , @flx wrote: > >> I should note that I was only able to reproduce the false positive with the >> actual implementation std::funct

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

2020-10-28 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 301388. flx added a comment. Add instantiated template method. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90042/new/ https://reviews.llvm.org/D90042 Files: clang-tools-extra/clang-tidy/utils/DeclRefExprUtils.

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

2020-10-28 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 301389. flx added a comment. Comment out replaced parameter. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90042/new/ https://reviews.llvm.org/D90042 Files: clang-tools-extra/clang-tidy/utils/DeclRefExprUtils.cp

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

2020-10-28 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. In D90042#2357078 , @aaron.ballman wrote: > In D90042#2356265 , @flx wrote: > >> In D90042#2356180 , @aaron.ballman >> wrote: >> >>> In D90042#2350035

[PATCH] D97567: [clang-tidy] performance-* checks: Also allow allow member expressions to be used in a const manner.

2021-05-12 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. Could someone take a look at this patch? Thank you! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97567/new/ https://reviews.llvm.org/D97567 ___ cfe-commits mailing list cfe-commits@

[PATCH] D102175: [clang-tidy] performance-unnecessary-copy-initialization: Remove the complete statement when the copied variable is unused.

2021-05-14 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. In D102175#2759945 , @ymandel wrote: > Hi Felix, > Can you clarify your concern over the warning? Is it the case that the > warning is not present before the fix and is only triggered after the fix? > I'm concerned that removing th

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

2021-05-24 Thread Felix Berger via Phabricator via cfe-commits
flx created this revision. flx added reviewers: hokein, ymandel, aaron.ballman. Herald added subscribers: jeroen.dobbelaere, xazax.hun. flx requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. This fixes a false positive case where f

[PATCH] D103021: [clang-tidy] performance-unnecessary-copy-initialization: Search whole function body for variable initializations.

2021-05-24 Thread Felix Berger via Phabricator via cfe-commits
flx created this revision. flx added reviewers: hokein, ymandel, aaron.ballman. Herald added a subscriber: xazax.hun. flx requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. This fixes false positive cases where a reference is initi

[PATCH] D103087: [clang-tidy] performances-unnecessary-* checks: Extend isOnlyUsedAsConst to expressions and catch const methods returning non-const references/pointers.

2021-05-25 Thread Felix Berger via Phabricator via cfe-commits
flx created this revision. flx added reviewers: aaron.ballman, hokein, ymandel. Herald added a subscriber: xazax.hun. flx requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. This change extends isOnlyUsedAsConst() to avoid false pos

[PATCH] D102175: [clang-tidy] performance-unnecessary-copy-initialization: Remove the complete statement when the copied variable is unused.

2021-06-09 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. Thank you for the review, Yitzhak! Comment at: clang-tools-extra/test/clang-tidy/checkers/performance-unnecessary-copy-initialization.cpp:541 Orig.constMethod(); + UnnecessaryCopy.constMethod(); } ymandel wrote: > If this line weren't

[PATCH] D102175: [clang-tidy] performance-unnecessary-copy-initialization: Remove the complete statement when the copied variable is unused.

2021-06-09 Thread Felix Berger via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG5dbe3bf4b8db: [clang-tidy] performance-unnecessary-copy-initialization: Remove the complete… (authored by flx). Repository: rG LLVM Github Monore

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

2021-06-09 Thread Felix Berger via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGefa4dbc32ca9: [clang-tidy] performance-unnecessary-copy-initialization: Look at the canonical… (authored by flx). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.o

[PATCH] D103021: [clang-tidy] performance-unnecessary-copy-initialization: Search whole function body for variable initializations.

2021-06-09 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 350994. flx marked 2 inline comments as done. flx added a comment. Addressed first round of comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103021/new/ https://reviews.llvm.org/D103021 Files: clang-tools

[PATCH] D103021: [clang-tidy] performance-unnecessary-copy-initialization: Search whole function body for variable initializations.

2021-06-09 Thread Felix Berger via Phabricator via cfe-commits
flx added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp:98-101 auto Matches = match(findAll(declStmt(has(varDecl(equalsNode(&InitializingVar .bind("declStmt")), +Body, Co

[PATCH] D103021: [clang-tidy] performance-unnecessary-copy-initialization: Search whole function body for variable initializations.

2021-06-11 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 351425. flx marked an inline comment as not done. flx added a comment. Use more efficient method to check for local variable declaration. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103021/new/ https://reviews.ll

[PATCH] D103021: [clang-tidy] performance-unnecessary-copy-initialization: Search whole function body for variable initializations.

2021-06-11 Thread Felix Berger via Phabricator via cfe-commits
flx marked an inline comment as done. flx added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp:98-101 auto Matches = match(findAll(declStmt(has(varDecl(equalsNode(&InitializingVar .bi

[PATCH] D103087: [clang-tidy] performances-unnecessary-* checks: Extend isOnlyUsedAsConst to expressions and catch const methods returning non-const references/pointers.

2021-06-11 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. In D103087#2793673 , @ymandel wrote: > I have some concerns about the cost of this checks as it used matching over > entire contexts quite extensively. At this point, the facilities involved > seem quite close to doing dataflow ana

[PATCH] D103021: [clang-tidy] performance-unnecessary-copy-initialization: Search whole function body for variable initializations.

2021-06-15 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 352233. flx marked an inline comment as done. flx added a comment. Directly examine initializer. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103021/new/ https://reviews.llvm.org/D103021 Files: clang-tools-extr

[PATCH] D103021: [clang-tidy] performance-unnecessary-copy-initialization: Search whole function body for variable initializations.

2021-06-15 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 352236. flx added a comment. Remove now unnecessary FunctionDecl. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103021/new/ https://reviews.llvm.org/D103021 Files: clang-tools-extra/clang-tidy/performance/Unnece

[PATCH] D103021: [clang-tidy] performance-unnecessary-copy-initialization: Search whole function body for variable initializations.

2021-06-15 Thread Felix Berger via Phabricator via cfe-commits
flx marked an inline comment as done. flx added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp:98-101 auto Matches = match(findAll(declStmt(has(varDecl(equalsNode(&InitializingVar .bi

[PATCH] D103021: [clang-tidy] performance-unnecessary-copy-initialization: Search whole function body for variable initializations.

2021-06-18 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 353064. flx marked 2 inline comments as done. flx added a comment. Renamed initializer matcher. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103021/new/ https://reviews.llvm.org/D103021 Files: clang-tools-extra

[PATCH] D103021: [clang-tidy] performance-unnecessary-copy-initialization: Search whole function body for variable initializations.

2021-06-18 Thread Felix Berger via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGbdd5da9dec61: [clang-tidy] performance-unnecessary-copy-initialization: Directly examine the… (authored by flx). Changed prior to commit: https:/

[PATCH] D105727: [clang-tidy] performance-unnecessary-copy-initialization: Disable structured bindings.

2021-07-09 Thread Felix Berger via Phabricator via cfe-commits
flx created this revision. flx added reviewers: aaron.ballman, ymandel, gribozavr2. Herald added a subscriber: xazax.hun. flx requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Structured bindings can currently trigger the check an

[PATCH] D105734: [clang-tidy] performance-unnecessary-copy-initialization: Do not remove comments on new lines.

2021-07-09 Thread Felix Berger via Phabricator via cfe-commits
flx created this revision. flx added reviewers: ymandel, aaron.ballman, hokein. Herald added a subscriber: xazax.hun. flx requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. When deleting the copy assignment statement because copied

[PATCH] D105727: [clang-tidy] performance-unnecessary-copy-initialization: Disable structured bindings.

2021-07-12 Thread Felix Berger via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG187e050b33bb: [clang-tidy] performance-unnecessary-copy-initialization: Disable structured… (authored by flx). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/

[PATCH] D105734: [clang-tidy] performance-unnecessary-copy-initialization: Do not remove comments on new lines.

2021-07-12 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 357993. flx added a comment. Make offset operations safer. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105734/new/ https://reviews.llvm.org/D105734 Files: clang-tools-extra/clang-tidy/performance/UnnecessaryCo

[PATCH] D105734: [clang-tidy] performance-unnecessary-copy-initialization: Do not remove comments on new lines.

2021-07-12 Thread Felix Berger via Phabricator via cfe-commits
flx marked 2 inline comments as done. flx added a comment. Thanks for the review! Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp:51 + if (Tok && !Invalid) { +size_t Offset = std::strcspn(TextAfter, "\n"); +auto PastNewLine = Stm

[PATCH] D105734: [clang-tidy] performance-unnecessary-copy-initialization: Do not remove comments on new lines.

2021-07-12 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 358010. flx marked 2 inline comments as done. flx added a comment. Invert end of string logic. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105734/new/ https://reviews.llvm.org/D105734 Files: clang-tools-extra/

[PATCH] D105734: [clang-tidy] performance-unnecessary-copy-initialization: Do not remove comments on new lines.

2021-07-12 Thread Felix Berger via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG0ec812023b43: [clang-tidy] performance-unnecessary-copy-initialization: Do not remove… (authored by flx). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D10573

[PATCH] D106011: [clang-tidy] performance-unnecessary-copy-initialization: Disable check when variable and initializer have different replaced template param types.

2021-07-14 Thread Felix Berger via Phabricator via cfe-commits
flx created this revision. flx added reviewers: aaron.ballman, ymandel, hokein. Herald added a subscriber: xazax.hun. flx requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. This can happen when a template with two parameter types i

[PATCH] D112722: [clang-tidy]performance-unnecessary-copy-initialization: fix false negative

2021-10-28 Thread Felix Berger via Phabricator via cfe-commits
flx accepted this revision. flx added a comment. This revision is now accepted and ready to land. Thanks for the fix! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112722/new/ https://reviews.llvm.org/D112722 __

[PATCH] D97567: [clang-tidy] performance-* checks: Also allow allow member expressions to be used in a const manner.

2021-02-26 Thread Felix Berger via Phabricator via cfe-commits
flx created this revision. flx added reviewers: aaron.ballman, sbenza. Herald added a subscriber: xazax.hun. flx requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Until now when determining all the const uses of a VarDecl we only considered h

[PATCH] D97577: [clang-tidy] performance-for-range-copy: Don't trigger on implicit type conversions.

2021-02-26 Thread Felix Berger via Phabricator via cfe-commits
flx created this revision. flx added reviewers: aaron.ballman, alexfh, sbenza. Herald added a subscriber: xazax.hun. flx requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This disables the check for false positive cases where implicit type co

[PATCH] D97577: [clang-tidy] performance-for-range-copy: Don't trigger on implicit type conversions.

2021-02-26 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 326792. flx added a comment. Remove include. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97577/new/ https://reviews.llvm.org/D97577 Files: clang-tools-extra/clang-tidy/performance/ForRangeCopyCheck.cpp clang

[PATCH] D97577: [clang-tidy] performance-for-range-copy: Don't trigger on implicit type conversions.

2021-02-26 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 326793. flx added a comment. Remove include. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97577/new/ https://reviews.llvm.org/D97577 Files: clang-tools-extra/clang-tidy/performance/ForRangeCopyCheck.cpp clang

[PATCH] D97567: [clang-tidy] performance-* checks: Also allow allow member expressions to be used in a const manner.

2021-02-26 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 326798. flx added a comment. Add tests for PerformanceUnnecssaryCopyInitialization check which actually uses decl_ref_expr::isOnlyUsedAsConst(). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97567/new/ https://revi

[PATCH] D97577: [clang-tidy] performance-for-range-copy: Don't trigger on implicit type conversions.

2021-02-28 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. In D97577#2592093 , @lebedev.ri wrote: > It is best not to change existing tests, but add new ones. Could elaborate on this, Roman? In this case the tests use special auto convertible types with the intention to test that the check

[PATCH] D97577: [clang-tidy] performance-for-range-copy: Don't trigger on implicit type conversions.

2021-03-02 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. Thank you for the review! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97577/new/ https://reviews.llvm.org/D97577 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[PATCH] D97577: [clang-tidy] performance-for-range-copy: Don't trigger on implicit type conversions.

2021-03-02 Thread Felix Berger via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa189b3b9e8bb: [clang-tidy] performance-for-range-copy: Don't trigger on implicit type… (authored by flx). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97577

[PATCH] D97567: [clang-tidy] performance-* checks: Also allow allow member expressions to be used in a const manner.

2021-03-15 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. Hi, could someone please take a look at this? Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97567/new/ https://reviews.llvm.org/D97567 ___ cfe-commits mailing list cfe-commi

[PATCH] D114212: [clang-tidy] performance-unnecessary-copy-initialization: Correctly match the type name of the thisPointertype.

2021-11-18 Thread Felix Berger via Phabricator via cfe-commits
flx created this revision. flx added reviewers: ymandel, courbet, aaron.ballman. Herald added subscribers: carlosgalvezp, xazax.hun. flx requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. The matching did not work correctly for poi

[PATCH] D114249: [clang-tidy] performance-unnecessary-copy-initialization: Fix false negative.

2021-11-19 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. Thank you for catching and fixing this! Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp:97 + cxxOperatorCallExpr(callee(MethodDecl), hasArgument(0, ReceiverExpr), + hasArgument(0, hasType

[PATCH] D114212: [clang-tidy] performance-unnecessary-copy-initialization: Correctly match the type name of the thisPointertype.

2021-11-20 Thread Felix Berger via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGfefe20b99313: [clang-tidy] performance-unnecessary-copy-initialization: Correctly match the… (authored by flx). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D114249: [clang-tidy] performance-unnecessary-copy-initialization: Fix false negative.

2021-11-23 Thread Felix Berger via Phabricator via cfe-commits
flx accepted this revision. flx added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/test/clang-tidy/checkers/performance-unnecessary-copy-initialization.cpp:228-232 +void PositiveOperatorCallConstValueParam(const Container* C) {

[PATCH] D114539: [clang-tidy] performance-unnecessary-copy-initialization: handle pointer containers.

2021-11-24 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. This looks great, but goes past my knowledge of the AST API :) While the existing and new test coverage provides good confidence, one other reviewer taking look would be good. Comment at: clang-tools-extra/clang-tidy/utils/DeclRefExprUtils.cpp:112 +

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

2021-11-24 Thread Felix Berger via Phabricator via cfe-commits
flx created this revision. flx requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The matcher crashes when a variadic function pointer is invoked because the FunctionProtoType has fewer parameters than arguments. Matching of non-variadic argu

[PATCH] D27187: [clang-tidy] Do not move parameter if only DeclRefExpr occurs inside of a loop

2016-12-15 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 81693. https://reviews.llvm.org/D27187 Files: clang-tidy/performance/UnnecessaryValueParamCheck.cpp test/clang-tidy/performance-unnecessary-value-param.cpp Index: test/clang-tidy/performance-unnecessary-value-param.cpp ==

[PATCH] D27187: [clang-tidy] Do not move parameter if only DeclRefExpr occurs inside of a loop

2016-12-15 Thread Felix Berger via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. flx marked an inline comment as done. Closed by commit rL289912: [clang-tidy] Do not move parameter if only DeclRefExpr occurs inside of a loop (authored by flx). Changed prior to commit: https://reviews.llvm.org/D27187?v

[PATCH] D28899: [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 Phabricator via cfe-commits
flx created this revision. Herald added a subscriber: JDevlieghere. Repository: rL LLVM https://reviews.llvm.org/D28899 Files: clang-tidy/utils/DeclRefExprUtils.cpp test/clang-tidy/performance-unnecessary-value-param.cpp Index: test/clang-tidy/performance-unnecessary-value-param.cpp

[PATCH] D28899: [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 Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL292491: [clang-tidy] Do not trigger move fix for non-copy assignment operators in… (authored by flx). Changed prior to commit: https://reviews.llvm.org/D28899?vs=84960&id=84967#toc Repository: rL LLV

  1   2   >