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

2016-03-28 Thread Richard via cfe-commits
LegalizeAdulthood added a subscriber: LegalizeAdulthood. LegalizeAdulthood added a comment. Can you add something to the docs/ReleaseNotes.rst for this new check, please? Repository: rL LLVM http://reviews.llvm.org/D17491 ___ cfe-commits mailing

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

2016-03-28 Thread Felix Berger via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL264694: [clang-tidy] Add performance check to flag function parameters of expensive… (authored by flx). Changed prior to commit: http://reviews.llvm.org/D17491?vs=51385=51869#toc Repository: rL LLVM

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

2016-03-26 Thread Felix Berger via cfe-commits
flx added inline comments. Comment at: clang-tidy/performance/UnnecessaryValueParamCheck.cpp:26 @@ +25,3 @@ + return (Name.empty() ? llvm::Twine('#') + llvm::Twine(Index + 1) + : llvm::Twine('\'') + Name + llvm::Twine('\'')) + .str();

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

2016-03-24 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. Looks good! Thank you! Comment at: clang-tidy/performance/UnnecessaryValueParamCheck.cpp:26 @@ +25,3 @@ + return (Name.empty() ? llvm::Twine('#') + llvm::Twine(Index + 1) +

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

2016-03-22 Thread Felix Berger via cfe-commits
flx added inline comments. Comment at: clang-tidy/performance/UnnecessaryValueParamCheck.cpp:42 @@ +41,3 @@ + decl().bind("param")); + Finder->addMatcher( + functionDecl(isDefinition(), unless(cxxMethodDecl(isOverride())), alexfh wrote: >

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

2016-03-22 Thread Felix Berger via cfe-commits
flx updated the summary for this revision. flx updated this revision to Diff 51385. flx marked 5 inline comments as done. flx added a comment. After testing the check against a large corpus I was able to remove the unnecessary param index check. But I discovered that the check crashed on value

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

2016-03-22 Thread Matt Kulukundis via cfe-commits
fowles added a subscriber: fowles. Comment at: test/clang-tidy/performance-unnecessary-value-param.cpp:8 @@ +7,3 @@ + void nonConstMethod() {} + virtual ~ExpensiveToCopyType() {} +}; you don't actually need to fill in these methods, just declare them

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

2016-03-01 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/performance/UnnecessaryValueParamCheck.cpp:25-32 @@ +24,10 @@ +std::string paramNameOrIndex(StringRef Name, size_t Index) { + std::string Output; + llvm::raw_string_ostream Stream(Output); + if (!Name.empty()) { +Stream

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

2016-02-27 Thread Felix Berger via cfe-commits
flx removed rL LLVM as the repository for this revision. flx updated this revision to Diff 49307. flx marked 6 inline comments as done. http://reviews.llvm.org/D17491 Files: clang-tidy/performance/CMakeLists.txt clang-tidy/performance/PerformanceTidyModule.cpp

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

2016-02-27 Thread Felix Berger via cfe-commits
flx added inline comments. Comment at: clang-tidy/performance/UnnecessaryValueParamCheck.cpp:41 @@ +40,3 @@ + Function->parameters().begin(); + if (Index >= Function->getNumParams()) { +return; alexfh wrote: > Please add a comment about

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

2016-02-22 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/performance/UnnecessaryValueParamCheck.cpp:41 @@ +40,3 @@ + Function->parameters().begin(); + if (Index >= Function->getNumParams()) { +return; Please add a comment about when this

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

2016-02-21 Thread Felix Berger via cfe-commits
flx created this revision. flx added a reviewer: alexfh. flx added a subscriber: cfe-commits. flx set the repository for this revision to rL LLVM. The patch uses [[ http://reviews.llvm.org/D17488 | D17488 ]] as diff base. Once D17488 is submitted I'll update the diffbase to head. Repository: