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
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
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();
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)
+
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:
>
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
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
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
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
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
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
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:
12 matches
Mail list logo