Re: [PATCH] D12530: Fix several corner cases for loop-convert check.

2015-09-01 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 33690. angelgarcia added a comment. Renamed Usage::E, moved some tests and other fixes. http://reviews.llvm.org/D12530 Files: clang-tidy/modernize/LoopConvertCheck.cpp clang-tidy/modernize/LoopConvertUtils.cpp clang-tidy/modernize/LoopConvertUtils

[PATCH] D12551: Fix use-auto-check.

2015-09-02 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: alexfh. angelgarcia added subscribers: klimek, cfe-commits. Fix a bug where use-auto check would crash when the definition of a type is in the same statement than its instantiation with new. http://reviews.llvm.org/D12551 Files:

[PATCH] D12555: Fix loop-convert crash.

2015-09-02 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: alexfh. angelgarcia added subscribers: klimek, cfe-commits. loop-convert no longer crashes when calling a member function using a member pointer which is a member of another record. http://reviews.llvm.org/D12555 Files: clang-ti

[PATCH] D12597: Two more fixes to loop convert.

2015-09-03 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: cfe-commits, alexfh. Ensure that the alias has the same type than the loop variable. Now it works with lambda captures. http://reviews.llvm.org/D12597 Files: clang-tidy/modernize/LoopConver

Re: [PATCH] D12597: Two more fixes to loop convert.

2015-09-03 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 33936. angelgarcia added a comment. Remove unused include. http://reviews.llvm.org/D12597 Files: clang-tidy/modernize/LoopConvertUtils.cpp clang-tidy/modernize/LoopConvertUtils.h test/clang-tidy/modernize-loop-convert-extra.cpp Index: test/clang-

[PATCH] D12631: Avoid repeated replacements on loop-convert check.

2015-09-04 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: alexfh, cfe-commits. The InitListExpr subtree is visited twice, this caused the check to do multiple replacements. Added a set to avoid it. http://reviews.llvm.org/D12631 Files: clang-tidy/

Re: [PATCH] D12631: Avoid repeated replacements on loop-convert check.

2015-09-04 Thread Angel Garcia via cfe-commits
angelgarcia added a comment. Anyway, I just found that this needs a few more changes (it still does duplicated replacementes inside some macros, and I have to find out why), so don't bother with this for now. Comment at: clang-tidy/modernize/LoopConvertUtils.cpp:465 @@ +464,3

Re: [PATCH] D12631: Avoid repeated replacements on loop-convert check.

2015-09-04 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 34035. angelgarcia added a comment. I think this solves the duplication problem. And I think is clearer and cheaper than what I was trying to do before. http://reviews.llvm.org/D12631 Files: clang-tidy/modernize/LoopConvertUtils.cpp clang-tidy/mode

Re: [PATCH] D12631: Avoid repeated replacements on loop-convert check.

2015-09-04 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 34039. angelgarcia marked 2 inline comments as done. angelgarcia added a comment. Ok! I wasn't sure, and a while would be correct in both cases :) http://reviews.llvm.org/D12631 Files: clang-tidy/modernize/LoopConvertUtils.cpp clang-tidy/modernize/L

Re: [PATCH] D12631: Avoid repeated replacements on loop-convert check.

2015-09-04 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 34054. angelgarcia added a comment. Yes, with SpellingLoc works as well, and it should be better. http://reviews.llvm.org/D12631 Files: clang-tidy/modernize/LoopConvertUtils.cpp clang-tidy/modernize/LoopConvertUtils.h test/clang-tidy/modernize-loo

Re: [PATCH] D12631: Avoid repeated replacements on loop-convert check.

2015-09-04 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 34076. angelgarcia added a comment. Wooops, solved. http://reviews.llvm.org/D12631 Files: clang-tidy/modernize/LoopConvertUtils.cpp clang-tidy/modernize/LoopConvertUtils.h test/clang-tidy/modernize-loop-convert-extra.cpp Index: test/clang-tidy/mo

[PATCH] D12675: Avoid using rvalue references with trivially copyable types.

2015-09-07 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: cfe-commits, alexfh. When the dereference operator returns a value that is trivially copyable (like a pointer), copy it. After this change, modernize-loop-convert check can be applied to the who

Re: [PATCH] D12675: Avoid using rvalue references with trivially copyable types.

2015-09-07 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 34158. angelgarcia added a comment. Add struct with the parameters of the replacement. Also fix a potential source of crashes from a previous patch. http://reviews.llvm.org/D12675 Files: clang-tidy/modernize/LoopConvertCheck.cpp clang-tidy/moderniz

Re: [PATCH] D12675: Avoid using rvalue references with trivially copyable types.

2015-09-07 Thread Angel Garcia via cfe-commits
angelgarcia marked 3 inline comments as done. Comment at: clang-tidy/modernize/LoopConvertCheck.cpp:658-663 @@ -646,7 +657,8 @@ + IsTriviallyCopyable = BeginPointeeType.isTriviallyCopyableType(*Context); } else { // Check for qualified types to avoid conversions f

Re: [PATCH] D12675: Avoid using rvalue references with trivially copyable types.

2015-09-07 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 34160. angelgarcia added a comment. Avoid relying in a single usage for determining if the type is trivially copyable. http://reviews.llvm.org/D12675 Files: clang-tidy/modernize/LoopConvertCheck.cpp clang-tidy/modernize/LoopConvertCheck.h clang-t

Re: [PATCH] D12675: Avoid using rvalue references with trivially copyable types.

2015-09-07 Thread Angel Garcia via cfe-commits
angelgarcia added inline comments. Comment at: clang-tidy/modernize/LoopConvertCheck.cpp:659-664 @@ -646,7 +658,8 @@ + BeginPointeeType.isTriviallyCopyableType(*Context); } else { // Check for qualified types to avoid conversions from non-const to const

Re: [PATCH] D12675: Avoid using rvalue references with trivially copyable types.

2015-09-07 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 34162. angelgarcia added a comment. This is the test case I was worried about. http://reviews.llvm.org/D12675 Files: clang-tidy/modernize/LoopConvertCheck.cpp clang-tidy/modernize/LoopConvertCheck.h clang-tidy/modernize/LoopConvertUtils.cpp test

Re: [PATCH] D12675: Avoid using rvalue references with trivially copyable types.

2015-09-08 Thread Angel Garcia via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL246989: Avoid using rvalue references with trivially copyable types. (authored by angelgarcia). Changed prior to commit: http://reviews.llvm.org/D12675?vs=34162&id=34201#toc Repository: rL LLVM http

[PATCH] D13590: Support every kind of initialization.

2015-10-09 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: alexfh, cfe-commits. modernize-make-unique now correctly supports the different kinds of list initialization. http://reviews.llvm.org/D13590 Files: clang-tidy/modernize/MakeUniqueCheck.cpp

Re: [PATCH] D13590: Support every kind of initialization.

2015-10-14 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 37322. angelgarcia added a comment. Remove \code and \endcode. http://reviews.llvm.org/D13590 Files: clang-tidy/modernize/MakeUniqueCheck.cpp test/clang-tidy/modernize-make-unique.cpp Index: test/clang-tidy/modernize-make-unique.cpp ===

Re: [PATCH] D13516: Fix overlapping replacements in clang-tidy.

2015-10-14 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 37323. angelgarcia added a comment. Fix comments. http://reviews.llvm.org/D13516 Files: clang-tidy/ClangTidyDiagnosticConsumer.cpp clang-tidy/ClangTidyDiagnosticConsumer.h unittests/clang-tidy/OverlappingReplacementsTest.cpp Index: unittests/clan

Re: [PATCH] D13516: Fix overlapping replacements in clang-tidy.

2015-10-14 Thread Angel Garcia via cfe-commits
angelgarcia added a comment. > These need to be documented. Done. > I'd name this Queue instead (reading later I had no idea what this was). Done. > Why are you calling this "Sit"? I didn't even know how to describe this variable without using examples, and naming it is harder. More or les

Re: [PATCH] D13504: Prevent modernize-use-auto from emitting a warning when 'auto' was already being used.

2015-10-14 Thread Angel Garcia via cfe-commits
angelgarcia added a comment. Ping http://reviews.llvm.org/D13504 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D13720: Use __SIZE_TYPE__ to fix buildbot failures.

2015-10-14 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added a subscriber: cfe-commits. Use __SIZE_TYPE__ to fix buildbot failures. http://reviews.llvm.org/D13720 Files: test/clang-tidy/modernize-make-unique.cpp Index: test/clang-tidy/modernize-make-unique.cpp ==

Re: [PATCH] D13516: Fix overlapping replacements in clang-tidy.

2015-10-14 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 37334. angelgarcia added a comment. Add an enum and rename "Sit" to "Coverage" to improve readability. http://reviews.llvm.org/D13516 Files: clang-tidy/ClangTidyDiagnosticConsumer.cpp clang-tidy/ClangTidyDiagnosticConsumer.h unittests/clang-tidy/O

Re: [PATCH] D13516: Fix overlapping replacements in clang-tidy.

2015-10-14 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 37336. angelgarcia added a comment. Done. http://reviews.llvm.org/D13516 Files: clang-tidy/ClangTidyDiagnosticConsumer.cpp clang-tidy/ClangTidyDiagnosticConsumer.h unittests/clang-tidy/OverlappingReplacementsTest.cpp Index: unittests/clang-tidy/O

Re: [PATCH] D13516: Fix overlapping replacements in clang-tidy.

2015-10-14 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 37344. angelgarcia added a comment. Use bounding boxes to reduce complexity. http://reviews.llvm.org/D13516 Files: clang-tidy/ClangTidyDiagnosticConsumer.cpp clang-tidy/ClangTidyDiagnosticConsumer.h unittests/clang-tidy/OverlappingReplacementsTest

Re: [PATCH] D13516: Fix overlapping replacements in clang-tidy.

2015-10-14 Thread Angel Garcia via cfe-commits
angelgarcia added a comment. I've done a couple of runs for each version, and these are the results (I have clang-tidy compiled with the option "RelWithDebInfo"): $ time clang-tidy -checks=* test.cpp -- -std=c++11 Without looking for overlaps. Suppressed 23463 warnings (23463 in non-user code).

Re: [PATCH] D13516: Fix overlapping replacements in clang-tidy.

2015-10-14 Thread Angel Garcia via cfe-commits
angelgarcia added a comment. That works pretty well (well, identical end points have to be sorted decreasingly, if I understand correctly). I see a couple of problems though, like equal intervals, or consecutive. But the algorithm is way more efficient than what we currently have, I will try to ma

Re: [PATCH] D13516: Fix overlapping replacements in clang-tidy.

2015-10-15 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 37465. angelgarcia added a comment. I did several mutations and the only case were a test didn't break was when I removed the sort, but it turned out that we don't need it. I changed the tests to apply the checks in both orders to ensure that a test will

Re: [PATCH] D13516: Fix overlapping replacements in clang-tidy.

2015-10-15 Thread Angel Garcia via cfe-commits
angelgarcia added a comment. I cannot find a way to make Daniel's idea work with equal intervals: In this case, fix A can be applied because B is completely contained inside it. A: [a, b)[c, d) B: [a, b) This time, we should not apply anyone: A: [a, b) B: [a, b) And here they both have to be di

Re: [PATCH] D13516: Fix overlapping replacements in clang-tidy.

2015-10-15 Thread Angel Garcia via cfe-commits
angelgarcia added a comment. I implemented this, with the following addition: if several errors share the same interval, I can still apply the biggest one that was not discarded during the sweep. This way, the first example would work and in the two other examples it would just apply a random one,

Re: [PATCH] D13516: Fix overlapping replacements in clang-tidy.

2015-10-16 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 37568. angelgarcia added a comment. New algorithm :) http://reviews.llvm.org/D13516 Files: clang-tidy/ClangTidyDiagnosticConsumer.cpp clang-tidy/ClangTidyDiagnosticConsumer.h unittests/clang-tidy/OverlappingReplacementsTest.cpp Index: unittests/c

Re: [PATCH] D13516: Fix overlapping replacements in clang-tidy.

2015-10-16 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 37569. angelgarcia added a comment. Remove unused include, fix typo and rename Count to OpenIntervals. http://reviews.llvm.org/D13516 Files: clang-tidy/ClangTidyDiagnosticConsumer.cpp clang-tidy/ClangTidyDiagnosticConsumer.h unittests/clang-tidy/O

[PATCH] D13810: Replacements in different files do not overlap.

2015-10-16 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: cfe-commits, alexfh. Prevent clang-tidy from discarding fixes that are in different files but happen to have the same file offset. http://reviews.llvm.org/D13810 Files: clang-tidy/ClangTidy

Re: [PATCH] D13810: Replacements in different files do not overlap.

2015-10-16 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 37600. angelgarcia added a comment. Add a test. http://reviews.llvm.org/D13810 Files: clang-tidy/ClangTidyDiagnosticConsumer.cpp test/clang-tidy/Inputs/overlapping/ test/clang-tidy/Inputs/overlapping/o.h test/clang-tidy/overlapping.cpp Index: t

Re: [PATCH] D13810: Replacements in different files do not overlap.

2015-10-16 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 37602. angelgarcia added a comment. Use "not" instead of "!". http://reviews.llvm.org/D13810 Files: clang-tidy/ClangTidyDiagnosticConsumer.cpp test/clang-tidy/Inputs/overlapping/ test/clang-tidy/Inputs/overlapping/o.h test/clang-tidy/overlapping

Re: [PATCH] D13810: Replacements in different files do not overlap.

2015-10-16 Thread Angel Garcia via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL250523: Replacements in different files do not overlap. (authored by angelgarcia). Changed prior to commit: http://reviews.llvm.org/D13810?vs=37603&id=37604#toc Repository: rL LLVM http://reviews.ll

Re: [PATCH] D13810: Replacements in different files do not overlap.

2015-10-16 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 37603. angelgarcia added a comment. In both files. http://reviews.llvm.org/D13810 Files: clang-tidy/ClangTidyDiagnosticConsumer.cpp test/clang-tidy/Inputs/overlapping/ test/clang-tidy/Inputs/overlapping/o.h test/clang-tidy/overlapping.cpp Index

Re: [clang-tools-extra] r250509 - Fix overlapping replacements in clang-tidy.

2015-10-19 Thread Angel Garcia via cfe-commits
Using these as the default comparison operators might not make much sense, as they don't take into account all the fields (they only look at ClangTidyError::Message). But here I just wanted to mimic existing behavior, so honestly I don't know. I implemented equality with !<&&!< to improve maintain

[PATCH] D13871: Add modernize-use-default check to clang-tidy.

2015-10-19 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: cfe-commits, alexfh. Add a check that replaces empty bodies of special member functions with '= default;'. For now, it is only implemented for the default constructor and the destructor, which

Re: [PATCH] D13871: Add modernize-use-default check to clang-tidy.

2015-10-20 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 37833. angelgarcia added a comment. Global variable -> static, and a few other additions. > Will be good idea to add handling of cases where default constructor is empty > and only call base class(es) default constructor/members default constructors I

Re: [PATCH] D13871: Add modernize-use-default check to clang-tidy.

2015-10-20 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 37859. angelgarcia added a comment. Remove the fixme. http://reviews.llvm.org/D13871 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/UseDefaultCheck.cpp clang-tidy/modernize/UseDefault

[PATCH] D13889: Apply modernize-use-default to clang-tools-extra.

2015-10-20 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: cfe-commits, alexfh. Replace empty bodies of default constructors and destructors with '= default'. http://reviews.llvm.org/D13889 Files: clang-modernize/Core/IncludeDirectives.cpp clang-m

[PATCH] D13890: Apply modernize-use-default to clang.

2015-10-20 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: cfe-commits, alexfh. Herald added a subscriber: klimek. Replace empty bodies of default constructors and destructors with '= default'. http://reviews.llvm.org/D13890 Files: include/clang/AST

[PATCH] D13892: Apply modernize-use-default to compiler-rt.

2015-10-20 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: cfe-commits, alexfh. Replace empty bodies of default constructors and destructors with '= default'. http://reviews.llvm.org/D13892 Files: lib/asan/asan_fake_stack.h lib/msan/msan_allocator

Re: [PATCH] D13890: Apply modernize-use-default to clang.

2015-10-20 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 37867. angelgarcia added a comment. Put comment back. http://reviews.llvm.org/D13890 Files: include/clang/AST/ASTConsumer.h include/clang/AST/CanonicalType.h include/clang/AST/DeclFriend.h include/clang/AST/DeclTemplate.h include/clang/AST/Exp

Re: [PATCH] D13892: Apply modernize-use-default to compiler-rt.

2015-10-20 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 37868. angelgarcia added a comment. Put comments back. http://reviews.llvm.org/D13892 Files: lib/asan/asan_fake_stack.h lib/msan/msan_allocator.h lib/sanitizer_common/sanitizer_bitvector.h lib/tsan/rtl/tsan_clock.h lib/tsan/rtl/tsan_mutex.cc

Re: [PATCH] D13892: Apply modernize-use-default to compiler-rt.

2015-10-20 Thread Angel Garcia via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL250823: Apply modernize-use-default to compiler-rt. (authored by angelgarcia). Changed prior to commit: http://reviews.llvm.org/D13892?vs=37868&id=37869#toc Repository: rL LLVM http://reviews.llvm.o

[PATCH] D13893: Roll-back r250822.

2015-10-20 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a subscriber: cfe-commits. Herald added a subscriber: klimek. It breaks the build for the ASTMatchers http://reviews.llvm.org/D13893 Files: include/clang/AST/ASTConsumer.h include/clang/AST/CanonicalType.h include/clang/AST/DeclFriend.h

Re: [PATCH] D13893: Roll-back r250822.

2015-10-20 Thread Angel Garcia via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL250827: Roll-back r250822. (authored by angelgarcia). Changed prior to commit: http://reviews.llvm.org/D13893?vs=37875&id=37878#toc Repository: rL LLVM http://reviews.llvm.org/D13893 Files: cfe/tr

Re: [clang-tools-extra] r250824 - Apply modernize-use-default to clang-tools-extra.

2015-10-20 Thread Angel Garcia via cfe-commits
Sorry, I have just seen all this. Thank you for reverting it, David. On Tue, Oct 20, 2015 at 11:48 PM, David Blaikie wrote: > Reverted in r250862 > > On Tue, Oct 20, 2015 at 2:39 PM, Tobias Grosser wrote: > >> On 10/20/2015 11:37 PM, David Blaikie wrote: >> >>> >>> >>> On Tue, Oct 20, 2015 at 2

[PATCH] D13975: Make string constants in the modernize module static.

2015-10-22 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added a subscriber: cfe-commits. Add static to global variables, if they are not in an anonymous namespace. http://reviews.llvm.org/D13975 Files: clang-tidy/modernize/LoopConvertCheck.cpp clang-tidy/moderniz

[PATCH] D13982: Don't use "auto" on loops over fundamental types in modernize-loop-convert.

2015-10-22 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: cfe-commits, alexfh. using "auto" on a loop that iterates over ints is kind of an overkill. Use the real type name instead. http://reviews.llvm.org/D13982 Files: clang-tidy/modernize/LoopCo

Re: [PATCH] D13982: Don't use "auto" on loops over fundamental types in modernize-loop-convert.

2015-10-22 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 38119. angelgarcia added a comment. Add a guard to check that ElemType is not null. http://reviews.llvm.org/D13982 Files: clang-tidy/modernize/LoopConvertCheck.cpp clang-tidy/modernize/LoopConvertCheck.h test/clang-tidy/modernize-loop-convert-basi

[PATCH] D13983: Correctly print the type in modernize-make-unique.

2015-10-22 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: cfe-commits, alexfh. Take into account the current LangOptions the check has to add back the template argument. http://reviews.llvm.org/D13983 Files: clang-tidy/modernize/MakeUniqueCheck.cp

[PATCH] D14145: modernize-use-default supports copy constructor and copy-assignment operator.

2015-10-28 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: alexfh, cfe-commits. the check will now warn when the user provided definitions of this functions is equivalent to the explicitly defaulted ones. http://reviews.llvm.org/D14145 Files: clang

Re: [PATCH] D14145: modernize-use-default supports copy constructor and copy-assignment operator.

2015-10-28 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 38648. angelgarcia added a comment. Small tweak. http://reviews.llvm.org/D14145 Files: clang-tidy/modernize/UseDefaultCheck.cpp test/clang-tidy/modernize-use-default-copy.cpp test/clang-tidy/modernize-use-default.cpp Index: test/clang-tidy/modern

Re: [PATCH] D14145: modernize-use-default supports copy constructor and copy-assignment operator.

2015-10-28 Thread Angel Garcia via cfe-commits
angelgarcia added a comment. OK, thanks! I will try to refactor some of the parts into AST matchers then. It will probably take some time, though. http://reviews.llvm.org/D14145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.ll

[PATCH] D14152: Add "equalsNode" for types and "isCopyAssignmentOperator" matchers.

2015-10-28 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: cfe-commits, alexfh. Herald added a subscriber: klimek. This matchers are going to be used in modernize-use-default, but are generic enough to be placed in ASTMatchers.h. http://reviews.llvm.o

Re: [PATCH] D14145: modernize-use-default supports copy constructor and copy-assignment operator.

2015-10-28 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 38664. angelgarcia added a comment. Refactor most of the code to use AST matchers. Note that now this change requires http://reviews.llvm.org/D14152 to be applied first. http://reviews.llvm.org/D14145 Files: clang-tidy/modernize/UseDefaultCheck.cpp

Re: [PATCH] D14145: modernize-use-default supports copy constructor and copy-assignment operator.

2015-10-28 Thread Angel Garcia via cfe-commits
angelgarcia added a comment. > In which cases can this be false? (I assume if not all are copied?) This can be false is there is we do anything else than initializing the bases and members. So the previous code is there to ensure that we do that and this is here to ensure that we *only* do that.

Re: [PATCH] D14145: modernize-use-default supports copy constructor and copy-assignment operator.

2015-10-28 Thread Angel Garcia via cfe-commits
angelgarcia added a comment. You can initialize an indirect base if it's virtual. http://reviews.llvm.org/D14145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D14152: Add "equalsNode" for types and "isCopyAssignmentOperator" matchers.

2015-10-29 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 38727. angelgarcia added a comment. Add tests. http://reviews.llvm.org/D14152 Files: include/clang/ASTMatchers/ASTMatchers.h unittests/ASTMatchers/ASTMatchersTest.cpp Index: unittests/ASTMatchers/ASTMatchersTest.cpp

Re: [PATCH] D14145: modernize-use-default supports copy constructor and copy-assignment operator.

2015-10-29 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 38728. angelgarcia added a comment. Put more logic into the matchers. Btw, do you know how can I get the exception specification of a function? http://reviews.llvm.org/D14145 Files: clang-tidy/modernize/UseDefaultCheck.cpp test/clang-tidy/modernize

Re: [PATCH] D14145: modernize-use-default supports copy constructor and copy-assignment operator.

2015-10-29 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 38730. angelgarcia marked an inline comment as done. angelgarcia added a comment. Remove debugging code. http://reviews.llvm.org/D14145 Files: clang-tidy/modernize/UseDefaultCheck.cpp test/clang-tidy/modernize-use-default-copy.cpp test/clang-tidy/

[PATCH] D14176: Only copy small types in modernize-loop-convert.

2015-10-29 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: cfe-commits, alexfh. If the size of the type is above a certain bound, we'll take a const reference. This bound can be set as an option. For now, the default value is 16 bytes. http://reviews.

Re: [PATCH] D14176: Only copy small types in modernize-loop-convert.

2015-10-30 Thread Angel Garcia via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL251694: Only copy small types in modernize-loop-convert. (authored by angelgarcia). Changed prior to commit: http://reviews.llvm.org/D14176?vs=38736&id=38789#toc Repository: rL LLVM http://reviews.l

[PATCH] D14198: Make the modernize-loop-convert's const-detection smarter.

2015-10-30 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: alexfh, cfe-commits. Now, it detects that several kinds of usages are can't modify the elements. Examples: -When an usage is a call to a const member function or operator of the element. -If th

[PATCH] D14204: Fix crash in redundant-void-arg check.

2015-10-30 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added reviewers: klimek, LegalizeAdulthood. angelgarcia added subscribers: alexfh, cfe-commits. When applying this check to the unit tests, it would hit an assertion: llvm/tools/clang/lib/Lex/Lexer.cpp:1056: clang::SourceLocation clang::Lexer::getSou

Re: [PATCH] D14198: Make the modernize-loop-convert's const-detection smarter.

2015-11-02 Thread Angel Garcia via cfe-commits
angelgarcia added a comment. > Reading just this function, it is unclear what the 'container' is. It should be clearer now. > Can't CaptureBuRef be modified? I added a comment with an explanation. > But they are aliases. Shouldn't we then go into the const-ness of the aliases? I wanted to

Re: [PATCH] D14198: Make the modernize-loop-convert's const-detection smarter.

2015-11-02 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 38881. angelgarcia added a comment. Improve comments and add more tests. http://reviews.llvm.org/D14198 Files: clang-tidy/modernize/LoopConvertCheck.cpp test/clang-tidy/modernize-loop-convert-basic.cpp test/clang-tidy/modernize-loop-convert-camelb

[PATCH] D14225: Try to fix buildbots failure.

2015-11-02 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a subscriber: cfe-commits. Add -fexceptions flag to enable exceptions. http://reviews.llvm.org/D14225 Files: test/clang-tidy/modernize-use-default-copy.cpp test/clang-tidy/modernize-use-default.cpp Index: test/clang-tidy/modernize-use-def

Re: [PATCH] D14225: Try to fix buildbots failure.

2015-11-02 Thread Angel Garcia via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL251790: Try to fix buildbots failure. (authored by angelgarcia). Changed prior to commit: http://reviews.llvm.org/D14225?vs=38885&id=38886#toc Repository: rL LLVM http://reviews.llvm.org/D14225 Fil

Re: [PATCH] D14204: Fix crash in redundant-void-arg check.

2015-11-02 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 38887. angelgarcia added a comment. Use Lexer::makeFileCharRange (and a few changes due to clang-format). It seems to work as well. http://reviews.llvm.org/D14204 Files: clang-tidy/modernize/RedundantVoidArgCheck.cpp test/clang-tidy/modernize-redun

Re: [PATCH] D14204: Fix crash in redundant-void-arg check.

2015-11-02 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 38889. angelgarcia added a comment. Sorry, I forgot. That case works just fine. http://reviews.llvm.org/D14204 Files: clang-tidy/modernize/RedundantVoidArgCheck.cpp test/clang-tidy/modernize-redundant-void-arg.cpp Index: test/clang-tidy/modernize-r

Re: [PATCH] D14204: Fix crash in redundant-void-arg check.

2015-11-02 Thread Angel Garcia via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL251792: Fix crash in redundant-void-arg check. (authored by angelgarcia). Changed prior to commit: http://reviews.llvm.org/D14204?vs=38889&id=38890#toc Repository: rL LLVM http://reviews.llvm.org/D1

[PATCH] D14229: Remove unreachable that was reached in modernize-use-nullptr.

2015-11-02 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: alexfh. angelgarcia added subscribers: cfe-commits, klimek. When traversing the parent map, the check assumed that all the nodes would be either Stmt or Decl. After r251101, this is no longer true: there can be TypeLoc and NestedNa

Re: [PATCH] D14229: Remove unreachable that was reached in modernize-use-nullptr.

2015-11-02 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 38918. angelgarcia added a comment. Merge lines. http://reviews.llvm.org/D14229 Files: clang-tidy/modernize/UseNullptrCheck.cpp test/clang-tidy/modernize-use-nullptr.cpp Index: test/clang-tidy/modernize-use-nullptr.cpp =

[PATCH] D14238: Fix another crash in the redundant-void-arg check.

2015-11-02 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: alexfh. angelgarcia added subscribers: cfe-commits, klimek. The check was assuming that a definition of a function always has a body, but a declaration that explicitly defaults or deletes a function is a definition too. http://revi

Re: [PATCH] D14198: Make the modernize-loop-convert's const-detection smarter.

2015-11-02 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 38930. angelgarcia added a comment. OK, is it better now? http://reviews.llvm.org/D14198 Files: clang-tidy/modernize/LoopConvertCheck.cpp test/clang-tidy/modernize-loop-convert-basic.cpp test/clang-tidy/modernize-loop-convert-camelback.cpp test/

[PATCH] D14282: Improve more the const-detection in modernize-loop-convert.

2015-11-03 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: cfe-commits, alexfh. The previous change was focused in detecting when a non-const object was used in a constant way. Looks like I forgot the most important and trivial case: when the object i

[PATCH] D14289: Handle correctly containers that are data members in modernize-loop-convert.

2015-11-03 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: alexfh, cfe-commits. I recently found that the variable naming wasn't working as expected with containers that are data members. The new index always received the name "Elem" (or equivalent) r

Re: [PATCH] D14282: Improve more the const-detection in modernize-loop-convert.

2015-11-03 Thread Angel Garcia via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL251940: Improve more the const-detection in modernize-loop-convert. (authored by angelgarcia). Changed prior to commit: http://reviews.llvm.org/D14282?vs=39052&id=39074#toc Repository: rL LLVM http:

Re: [PATCH] D14289: Handle correctly containers that are data members in modernize-loop-convert.

2015-11-03 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 39075. angelgarcia added a comment. Merge with the latest revision. http://reviews.llvm.org/D14289 Files: clang-tidy/modernize/LoopConvertCheck.cpp clang-tidy/modernize/LoopConvertCheck.h clang-tidy/modernize/LoopConvertUtils.h test/clang-tidy/m

[PATCH] D14291: Improve modernize-make-unique matcher.

2015-11-03 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: cfe-commits, alexfh. "std::unique_ptr" is not the same type as "std::unique_ptr>", unless we insert a "hasCanonicalType" in the middle. Probably it also happens in other cases related to defaul

[PATCH] D14378: Fix another case where loop-convert wasn't handling correctly data members.

2015-11-05 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: alexfh, cfe-commits. If the container expression was obtained from the point where "size" (which usually is a const method) is invoked, then the topmost node in this expression may be an impli

Re: [PATCH] D14378: Fix another case where loop-convert wasn't handling correctly data members.

2015-11-05 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 39350. angelgarcia added a comment. Update the method comment. http://reviews.llvm.org/D14378 Files: clang-tidy/modernize/LoopConvertCheck.cpp test/clang-tidy/modernize-loop-convert-extra.cpp Index: test/clang-tidy/modernize-loop-convert-extra.cpp

[PATCH] D14437: Avoid naming conflicts with the old index in modernize-loop-convert.

2015-11-06 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: alexfh, cfe-commits. The old index declaration is going to be removed anyway, so we can reuse its name if it is the best candidate for the new index. http://reviews.llvm.org/D14437 Files: c

[PATCH] D14438: Use the old index identifier by default, instead of 'elem'.

2015-11-06 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added a subscriber: cfe-commits. Use the old index name in the cases where the check would come up with an invented name. http://reviews.llvm.org/D14438 Files: clang-tidy/modernize/LoopConvertUtils.cpp test

[PATCH] D14442: Allow the alias to be of a different type.

2015-11-06 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: cfe-commits, alexfh. Consider a declaration an alias even if it doesn't have the same unqualified type than the container element, as long as one can be converted to the other using only impli

Re: [PATCH] D14442: Allow the alias to be of a different type.

2015-11-06 Thread Angel Garcia via cfe-commits
angelgarcia added a comment. No. There is a test for that just before the one I added. http://reviews.llvm.org/D14442 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D14442: Allow the alias to be of a different type.

2015-11-06 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 39530. angelgarcia added a comment. The test revealed a (already existing) bug. If we called getName() on a CXXConversionDecl, we would get the following assertion: include/clang/AST/Decl.h:170: llvm::StringRef clang::NamedDecl::getName() const: Asserti

Re: [PATCH] D13893: Roll-back r250822.

2016-02-03 Thread Angel Garcia via cfe-commits
angelgarcia added a subscriber: angelgarcia. angelgarcia added a comment. The compiler complained about creating constant instances of classes without a user provided constructor (which is the case for the ASTMatchers). I gave up this change because it broke the build for a huge amount of people

<    1   2