Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-21 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. Thank you Samuel, that it is valuable review! I wanted to add the functionality of specifing stuff by options later. should we revert this patch? It seems that those bugs are not so critical (at least on llvm http://reviews.llvm.org/D21507). Anyway, I will fix it in one

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-21 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: clang-tools-extra/trunk/clang-tidy/modernize/UseEmplaceCheck.cpp:34 @@ +33,3 @@ + hasDeclaration(functionDecl(hasName("push_back"))), + on(hasType(cxxRecordDecl(hasAnyName("std::vector", "llvm::SmallVector", +

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-21 Thread Piotr Padlewski via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL273275: [clang-tidy] Add modernize-use-emplace (authored by Prazek). Changed prior to commit: http://reviews.llvm.org/D20964?vs=61214=61381#toc Repository: rL LLVM http://reviews.llvm.org/D20964

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-20 Thread Haojian Wu via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. Looks almost good now, a few comments. You'd better await for comments from @alexfh or @sbenza before committing. Comment at:

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-19 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. Changes after running http://reviews.llvm.org/D21507 http://reviews.llvm.org/D20964 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-19 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 61214. Prazek added a comment. Changes after running og llvm code base. Adding llvm::SmallVector was a good idea, because it has fired for much more cases and I have found 3 other bugs. Now check doesn't fire when argument of constructor is bitfield or new

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-17 Thread Piotr Padlewski via cfe-commits
Prazek added a reviewer: sbenza. Prazek added a comment. You might be interested. http://reviews.llvm.org/D20964 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-17 Thread Piotr Padlewski via cfe-commits
Prazek marked 8 inline comments as done. Prazek added a comment. http://reviews.llvm.org/D20964 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-17 Thread Piotr Padlewski via cfe-commits
Prazek updated the summary for this revision. Prazek updated this revision to Diff 61143. http://reviews.llvm.org/D20964 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/UseEmplaceCheck.cpp clang-tidy/modernize/UseEmplaceCheck.h

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-17 Thread Piotr Padlewski via cfe-commits
Prazek added inline comments. Comment at: test/clang-tidy/modernize-use-emplace.cpp:2 @@ +1,3 @@ +// RUN: %check_clang_tidy %s modernize-use-emplace %t + +namespace std { hokein wrote: > Could you also add the following case in the test? > ``` > vector

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-17 Thread Haojian Wu via cfe-commits
hokein added a comment. A few comments. Comment at: clang-tidy/modernize/ModernizeTidyModule.cpp:59 @@ -57,2 +58,3 @@ CheckFactories.registerCheck("modernize-use-nullptr"); +CheckFactories.registerCheck("modernize-use-emplace");

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-16 Thread Piotr Padlewski via cfe-commits
Prazek added a reviewer: hokein. Prazek added a subscriber: hokein. Prazek added a comment. @alexfh or @hokein ping http://reviews.llvm.org/D20964 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-14 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 60662. Prazek marked an inline comment as done. Prazek added a comment. Runned on LLVM and bug fixed one thing http://reviews.llvm.org/D20964 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-10 Thread Vedant Kumar via cfe-commits
vsk added inline comments. Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:41 @@ +40,3 @@ + // (and destructed) as in push_back case. + auto isCtorOfSmartPtr = hasDeclaration(cxxConstructorDecl( + ofClass(hasAnyName("std::shared_ptr", "std::unique_ptr",

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-10 Thread Stanisław Barzowski via cfe-commits
sbarzowski added inline comments. Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:41 @@ +40,3 @@ + // (and destructed) as in push_back case. + auto isCtorOfSmartPtr = hasDeclaration(cxxConstructorDecl( + ofClass(hasAnyName("std::shared_ptr", "std::unique_ptr",

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-09 Thread Vedant Kumar via cfe-commits
vsk added inline comments. Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:41 @@ +40,3 @@ + // (and destructed) as in push_back case. + auto isCtorOfSmartPtr = hasDeclaration(cxxConstructorDecl( + ofClass(hasAnyName("std::shared_ptr", "std::unique_ptr",

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-09 Thread Vedant Kumar via cfe-commits
vsk added a subscriber: vsk. vsk added a comment. @Eugene.Zelenko thanks for pointing this out, I had totally missed this patch! Once we get this reviewed I'm willing to abandon my version. Some comments inline -- Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:26 @@

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-09 Thread Eugene Zelenko via cfe-commits
Eugene.Zelenko added a comment. There are alternative implementation in http://reviews.llvm.org/D21185. Will be good idea to how one which take the best from both :-) http://reviews.llvm.org/D20964 ___ cfe-commits mailing list

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-04 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. In http://reviews.llvm.org/D20964#448551, @Eugene.Zelenko wrote: > In http://reviews.llvm.org/D20964#448525, @Prazek wrote: > > > In http://reviews.llvm.org/D20964#448455, @Eugene.Zelenko wrote: > > > > > I think will be good idea to try this check with LLVM STL too. > >

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-03 Thread Eugene Zelenko via cfe-commits
Eugene.Zelenko added a comment. In http://reviews.llvm.org/D20964#448525, @Prazek wrote: > In http://reviews.llvm.org/D20964#448455, @Eugene.Zelenko wrote: > > > I think will be good idea to try this check with LLVM STL too. > > > You mean llvm::SmallVector stuff? No, I meant to build example

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-03 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. In http://reviews.llvm.org/D20964#448455, @Eugene.Zelenko wrote: > I think will be good idea to try this check with LLVM STL too. You mean llvm::SmallVector stuff? http://reviews.llvm.org/D20964 ___ cfe-commits mailing

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-03 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 59580. Prazek marked 4 inline comments as done. Prazek added a comment. - Review fixes http://reviews.llvm.org/D20964 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/UseEmplaceCheck.cpp

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-03 Thread Eugene Zelenko via cfe-commits
Eugene.Zelenko added a subscriber: Eugene.Zelenko. Eugene.Zelenko added a comment. I think will be good idea to try this check with LLVM STL too. Comment at: docs/clang-tidy/checks/modernize-use-emplace.rst:47 @@ +46,3 @@ + +In this case the calls of push_back won't be

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-03 Thread Stanisław Barzowski via cfe-commits
sbarzowski added inline comments. Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:40 @@ +39,3 @@ + // passed pointer because smart pointer won't be constructed + // (and destructed) as in push_back case. + auto isCtorOfSmartPtr = hasDeclaration(cxxConstructorDecl(

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-03 Thread Piotr Padlewski via cfe-commits
Prazek marked 2 inline comments as done. Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:40 @@ +39,3 @@ + // passed pointer because smart pointer won't be constructed + // (and destructed) as in push_back case. + auto isCtorOfSmartPtr = hasDeclaration(cxxConstructorDecl(

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-03 Thread Stanisław Barzowski via cfe-commits
sbarzowski added inline comments. Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:40 @@ +39,3 @@ + // passed pointer because smart pointer won't be constructed + // (and destructed) as in push_back case. + auto isCtorOfSmartPtr = hasDeclaration(cxxConstructorDecl(

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-03 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 59568. Prazek added a comment. - Post review fix http://reviews.llvm.org/D20964 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/UseEmplaceCheck.cpp clang-tidy/modernize/UseEmplaceCheck.h

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-03 Thread Piotr Padlewski via cfe-commits
Prazek added inline comments. Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:31 @@ +30,3 @@ +on(hasType(cxxRecordDecl(hasName(VectorName) + .bind("call"); + ok, std::list works for me. I just don't want to spend much

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-03 Thread Stanisław Barzowski via cfe-commits
sbarzowski added inline comments. Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:30 @@ +29,3 @@ + cxxMemberCallExpr(hasDeclaration(functionDecl(hasName(PushBackName))), +on(hasType(cxxRecordDecl(hasName(VectorName) + .bind("call");

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-03 Thread David Blaikie via cfe-commits
dblaikie added a subscriber: dblaikie. dblaikie added a comment. Could you describe in more detail (ideally in the original patch review summary/description) what this transformation does? Under what conditions does it suggest emplace, etc. http://reviews.llvm.org/D20964

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-03 Thread Piotr Padlewski via cfe-commits
Prazek marked 2 inline comments as done. Prazek added a comment. http://reviews.llvm.org/D20964 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-03 Thread Piotr Padlewski via cfe-commits
Prazek marked 4 inline comments as done. Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:29 @@ +28,3 @@ + auto callPushBack = + cxxMemberCallExpr(hasDeclaration(functionDecl(hasName(PushBackName))), +

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-03 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 59562. Prazek added a comment. Learning how to use arc http://reviews.llvm.org/D20964 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/UseEmplaceCheck.cpp

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-03 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 59561. Prazek marked an inline comment as done. Prazek added a comment. Fixed stuff http://reviews.llvm.org/D20964 Files: clang-tidy/modernize/UseEmplaceCheck.cpp docs/ReleaseNotes.rst docs/clang-tidy/checks/modernize-use-emplace.rst Index:

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-03 Thread Piotr Padlewski via cfe-commits
Prazek marked 4 inline comments as done. Comment at: docs/clang-tidy/checks/modernize-use-emplace.rst:6 @@ +5,3 @@ + +This check would look for cases when inserting new element into an STL +container, but the element is constructed temporarily or is constructed just

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-03 Thread Stanisław Barzowski via cfe-commits
sbarzowski added inline comments. Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:28 @@ +27,3 @@ + + auto callPushBack = + cxxMemberCallExpr(hasDeclaration(functionDecl(hasName(PushBackName))), Shouldn't it start with an uppercase letter?

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-03 Thread Stanisław Barzowski via cfe-commits
sbarzowski added inline comments. Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:57 @@ +56,3 @@ + + auto functionNameSourceRange = CharSourceRange::getCharRange( + PushBackExpr->getExprLoc(), Call->getArg(0)->getExprLoc()); capital letter?

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-03 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 59558. Prazek added a comment. - Fix http://reviews.llvm.org/D20964 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/UseEmplaceCheck.cpp clang-tidy/modernize/UseEmplaceCheck.h