[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] D116593: Fix `performance-unnecessary-value-param` for template specialization

2022-03-01 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. I'm still seeing build failures. Could you resolve them? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116593/new/ https://reviews.llvm.org/D116593 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2022-01-14 Thread Felix Berger via Phabricator via cfe-commits
flx added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryValueParamCheck.cpp:177-178 const auto = *FunctionDecl->getParamDecl(Index); +if (IsExplicitTemplateSpecialization && Function != FunctionDecl) + continue; Diag <<

[PATCH] D116535: [clang-tidy] Fix false positive in modernize-pass-by-value

2022-01-04 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/clang-tidy/modernize/PassByValueCheck.cpp:108 +/// Returns true the given constructor is part of a lvalue/rvalue reference +/// pair, i.e.

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

2022-01-04 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. Thanks for improving this check! Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryValueParamCheck.cpp:177-178 const auto = *FunctionDecl->getParamDecl(Index); +if (IsExplicitTemplateSpecialization && Function != FunctionDecl) +

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

2021-12-15 Thread Felix Berger via Phabricator via cfe-commits
flx added a comment. In D114559#3195357 , @mubarizafzal wrote: > Hi, this patch is causing a build failure for clang-ppc64le-rhel > , > can this be reverted? Hi, I just

[PATCH] D115809: [ASTMatchers] Make ParamIndex unsigned.

2021-12-15 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 rG54ed30fdd63b: [ASTMatchers] Make ParamIndex unsigned. (authored by flx). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D115809: [ASTMatchers] Make ParamIndex unsigned.

2021-12-15 Thread Felix Berger via Phabricator via cfe-commits
flx created this revision. flx added a reviewer: sammccall. Herald added a subscriber: arphaman. flx requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This fixes a compiler error/warning in

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

2021-12-15 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 rGa1b1c23a3b5f: [clang] ASTMatchers: Fix out-of-bounds access in foreachArgumentWithParamType. (authored by flx). Repository: rG LLVM Github

[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

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

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

[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

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

[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

[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() +

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

[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

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

[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

[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

[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

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

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

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

[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

[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

[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

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

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

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

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

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

[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

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

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

[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( .bind("declStmt")), +Body, Context);

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

[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

[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

[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

[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

[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

[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

[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

[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

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

2021-05-10 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 344149. flx added a comment. Fix test case. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102175/new/ https://reviews.llvm.org/D102175 Files:

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

2021-05-10 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. It is not useful to keep the statement around and can

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

2021-04-06 Thread Felix Berger via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGddebed8e9742: [clang-tidy] performance-* checks: Match AllowedTypes against qualified type… (authored by flx). Changed prior to commit: https://reviews.llvm.org/D98738?vs=335267=335632#toc Repository:

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

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

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

2021-04-05 Thread Felix Berger via Phabricator via cfe-commits
flx marked 2 inline comments as done. flx added a comment. Thanks for the comments, PTAL! Comment at: clang-tools-extra/clang-tidy/utils/Matchers.h:79 +llvm::Regex Regex; +bool MatchQualifiedName = false; + }; ymandel wrote: > Worth a comment i think.

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

2021-04-05 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 335267. flx marked an inline comment as done. flx added a comment. Create a NameMatcher class that handles matching against the best name variant (unqualified, qualified, fully qualified) of the NamedDecl. Repository: rG LLVM Github Monorepo CHANGES SINCE

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

2021-03-19 Thread Felix Berger via Phabricator via cfe-commits
flx marked 6 inline comments as done. flx added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/Matchers.h:52 AST_MATCHER_P(NamedDecl, matchesAnyListedName, std::vector, NameList) { hokein wrote: > worth some comments on this.

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

2021-03-19 Thread Felix Berger via Phabricator via cfe-commits
flx updated this revision to Diff 331941. flx added a comment. Applied changes suggested by ymandel, thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98738/new/ https://reviews.llvm.org/D98738 Files:

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

2021-03-17 Thread Felix Berger via Phabricator via cfe-commits
flx added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/Matchers.h:56 +if (Name.find("::") != std::string::npos) { + return llvm::Regex(Name).match(Node.getQualifiedNameAsString()); +} ymandel wrote: > flx wrote: > > ymandel wrote:

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

2021-03-17 Thread Felix Berger via Phabricator via cfe-commits
flx added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/Matchers.h:56 +if (Name.find("::") != std::string::npos) { + return llvm::Regex(Name).match(Node.getQualifiedNameAsString()); +} ymandel wrote: > nit: while this change is not

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

2021-03-16 Thread Felix Berger via Phabricator via cfe-commits
flx created this revision. flx added reviewers: ymandel, aaron.ballman. Herald added a subscriber: xazax.hun. flx requested review of this revision. Herald added a project: clang-tools-extra. This allows users to be more precise and exclude a type in a specific namespace from triggering the check

[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

[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: Dont trigger on implicit type… (authored by flx). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[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

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

[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

[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

[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

[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

[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

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

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

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

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

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

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

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

[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

[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

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

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

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

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

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

[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

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

[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

[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

[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

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

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

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

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

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

  1   2   >