Re: Preventing several replacements on a macro call.

2015-09-09 Thread Angel Garcia via cfe-commits
+cfe-commits On Tue, Sep 8, 2015 at 6:56 PM, Angel Garcia wrote: > Hi Ted, > > I was working on a clang-tidy check, and today I discovered that it was > unable to do several replacements in different arguments of the same macro > call. At first, I thought it was a bug, and trying to figure out w

[PATCH] D12734: Another patch for modernize-loop-convert.

2015-09-09 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: cfe-commits, alexfh. 1. Avoid converting loops that iterate over the size of a container and don't use its elements, as this would result in an unused-result warning. 2. Never capture the eleme

Re: [PATCH] D12734: Another patch for modernize-loop-convert.

2015-09-10 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 34422. angelgarcia marked 4 inline comments as done. angelgarcia added a comment. Document Usage's fields and other comments. http://reviews.llvm.org/D12734 Files: clang-tidy/modernize/LoopConvertCheck.cpp clang-tidy/modernize/LoopConvertCheck.h c

Re: [PATCH] D12734: Another patch for modernize-loop-convert.

2015-09-10 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 34427. angelgarcia added a comment. Replace the IsArrow field of Usage with an enum. http://reviews.llvm.org/D12734 Files: clang-tidy/modernize/LoopConvertCheck.cpp clang-tidy/modernize/LoopConvertCheck.h clang-tidy/modernize/LoopConvertUtils.cpp

Re: [PATCH] D12734: Another patch for modernize-loop-convert.

2015-09-10 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 34428. angelgarcia added a comment. Comment the enumerators. > Do we need default? I think so. We need to set the cases that do not fall in any of these categories to something, and I think that using one of the other three as the default kind would b

Re: Preventing several replacements on a macro call.

2015-09-10 Thread Angel Garcia via cfe-commits
a ‘knob' to control this behavior. We could > have a field in Commit object that you set to true to indicate that it is > ok to accept a change in a macro argument that expands in multiple places, > and also for convenience add such a knob to EditedSource object for > accepting in

Re: [PATCH] D12734: Another patch for modernize-loop-convert.

2015-09-11 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 34535. angelgarcia added a comment. Add examples of 'default' usages. http://reviews.llvm.org/D12734 Files: clang-tidy/modernize/LoopConvertCheck.cpp clang-tidy/modernize/LoopConvertCheck.h clang-tidy/modernize/LoopConvertUtils.cpp clang-tidy/mo

[PATCH] D12797: Refactor LoopConvertCheck.

2015-09-11 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: alexfh, cfe-commits. Reorder the code in a more logical and understandable way. http://reviews.llvm.org/D12797 Files: clang-tidy/modernize/LoopConvertCheck.cpp clang-tidy/modernize/LoopCon

Re: [PATCH] D12797: Refactor LoopConvertCheck.

2015-09-17 Thread Angel Garcia via cfe-commits
angelgarcia marked 9 inline comments as done. Comment at: clang-tidy/modernize/LoopConvertCheck.cpp:494-495 @@ -493,4 +502,2 @@ } else { - if (Descriptor.DerefByConstRef) -AutoRefType = Context->getConstType(AutoRefType); AutoRefType = Context->getLValueRe

Re: [PATCH] D12797: Refactor LoopConvertCheck.

2015-09-17 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 34985. angelgarcia added a comment. Split a function and several other small changes. http://reviews.llvm.org/D12797 Files: clang-tidy/modernize/LoopConvertCheck.cpp clang-tidy/modernize/LoopConvertCheck.h test/clang-tidy/modernize-loop-convert-ba

[PATCH] D12933: Add a test to modernize-loop-convert.

2015-09-17 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: alexfh. angelgarcia added subscribers: klimek, cfe-commits. Add the test about replacements in several arguments of the same macro call, now that the problem has been fixed. http://reviews.llvm.org/D12933 Files: test/clang-tidy/

Re: [PATCH] D12933: Add a test to modernize-loop-convert.

2015-09-17 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 34993. angelgarcia added a comment. Done. http://reviews.llvm.org/D12933 Files: test/clang-tidy/modernize-loop-convert-extra.cpp Index: test/clang-tidy/modernize-loop-convert-extra.cpp =

[PATCH] D12961: Update clang-tidy documentation.

2015-09-18 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added subscribers: alexfh, klimek, cfe-commits. Update documentation of the modernize module with clang-modernize's documentation. http://reviews.llvm.org/D12961 Files: docs/clang-tidy/checks/modernize-loop-convert.rst docs/clang-tidy/checks/mo

Re: [PATCH] D12961: Update clang-tidy documentation.

2015-09-18 Thread Angel Garcia via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL247987: Update clang-tidy documentation. (authored by angelgarcia). Changed prior to commit: http://reviews.llvm.org/D12961?vs=35080&id=35081#toc Repository: rL LLVM http://reviews.llvm.org/D12961

[PATCH] D13006: Replace references to "transform" with references to "check" where neccessary in the documentation.

2015-09-21 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: alexfh. angelgarcia added subscribers: klimek, cfe-commits. Replace references to "transform" with references to "check" where neccessary in the documentation. http://reviews.llvm.org/D13006 Files: docs/clang-tidy/checks/moderni

Re: [PATCH] D13006: Replace references to "transform" with references to "check" where neccessary in the documentation.

2015-09-21 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 35232. angelgarcia added a comment. Done. http://reviews.llvm.org/D13006 Files: docs/clang-tidy/checks/modernize-loop-convert.rst docs/clang-tidy/checks/modernize-pass-by-value.rst docs/clang-tidy/checks/modernize-replace-auto-ptr.rst docs/clang

Re: [PATCH] D13006: Replace references to "transform" with references to "check" where neccessary in the documentation.

2015-09-21 Thread Angel Garcia via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL248153: Replace references to "transform" with references to "check" where neccessary… (authored by angelgarcia). Changed prior to commit: http://reviews.llvm.org/D13006?vs=35232&id=35238#toc Repositor

[PATCH] D13052: Add NamingStyle option to modernize-loop-convert.

2015-09-22 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: alexfh. angelgarcia added subscribers: klimek, cfe-commits. Add an option to specify wich style must be followed when choosing the new index name. http://reviews.llvm.org/D13052 Files: clang-tidy/modernize/LoopConvertCheck.cpp

Re: [PATCH] D13052: Add NamingStyle option to modernize-loop-convert.

2015-09-22 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 35362. angelgarcia added a comment. Remove related FIXME. http://reviews.llvm.org/D13052 Files: clang-tidy/modernize/LoopConvertCheck.cpp clang-tidy/modernize/LoopConvertCheck.h clang-tidy/modernize/LoopConvertUtils.cpp clang-tidy/modernize/Loop

Re: [PATCH] D13052: Add NamingStyle option to modernize-loop-convert.

2015-09-22 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 35380. angelgarcia marked 10 inline comments as done. angelgarcia added a comment. Use CamelCase on the existing tests and add a test for every other naming convention. http://reviews.llvm.org/D13052 Files: clang-tidy/modernize/LoopConvertCheck.cpp

Re: [PATCH] D13052: Add NamingStyle option to modernize-loop-convert.

2015-09-24 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 35608. angelgarcia added a comment. > No need to check the length. `endswith` handles this itself. I am checking that it is strictly greater than one, because we don't want an empty identifier after removing the "s". http://reviews.llvm.org/D13052 Fi

Re: [Diffusion] rL248418: Fix loop-convert for const references to containers.

2015-09-24 Thread Angel Garcia via cfe-commits
angelgarcia added a comment. I sent a patch with that. Users: klimek (Author) http://reviews.llvm.org/rL248418 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D13129: Solve comment on rL248418.

2015-09-24 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: alexfh. angelgarcia added subscribers: klimek, cfe-commits. Solve comment on rL248418. http://reviews.llvm.org/D13129 Files: clang-tidy/modernize/LoopConvertCheck.cpp Index: clang-tidy/modernize/LoopConvertCheck.cpp

[PATCH] D13133: Remove dangling parenthesis.

2015-09-24 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: alexfh. angelgarcia added subscribers: klimek, cfe-commits. Remove parenthesis surrounding the new loop index. http://reviews.llvm.org/D13133 Files: clang-tidy/modernize/LoopConvertCheck.cpp test/clang-tidy/modernize-loop-conve

Re: [PATCH] D13133: Remove dangling parenthesis.

2015-09-24 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 35626. angelgarcia added a comment. Added a test where the parenthesis must not be removed, and one where they should. http://reviews.llvm.org/D13133 Files: clang-tidy/modernize/LoopConvertCheck.cpp test/clang-tidy/modernize-loop-convert-basic.cpp

Re: [PATCH] D13133: Remove dangling parenthesis.

2015-09-24 Thread Angel Garcia via cfe-commits
angelgarcia added a comment. Usage.Expression can be: -CXXMemberCallExpr: "container.at(i)" -CXXOperatorCallExpr: "*it" or "container[i]" -ArraySubscripExpr: "Arr[i]" -UnaryOperator: "*ptr" -MemberExpr: "it->member" (we only replace "it->" with "elem." in this case). The point is that all of them

Re: [PATCH] D13133: Remove dangling parenthesis.

2015-09-24 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 35629. angelgarcia added a comment. Add comment. http://reviews.llvm.org/D13133 Files: clang-tidy/modernize/LoopConvertCheck.cpp test/clang-tidy/modernize-loop-convert-basic.cpp test/clang-tidy/modernize-loop-convert-extra.cpp Index: test/clang-t

Re: [PATCH] D13052: Add NamingStyle option to modernize-loop-convert.

2015-09-24 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 35630. angelgarcia added a comment. Done! http://reviews.llvm.org/D13052 Files: clang-tidy/modernize/LoopConvertCheck.cpp clang-tidy/modernize/LoopConvertCheck.h clang-tidy/modernize/LoopConvertUtils.cpp clang-tidy/modernize/LoopConvertUtils.h

[PATCH] D13166: Create modernize-make-unique check.

2015-09-25 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: alexfh. angelgarcia added subscribers: klimek, cfe-commits. create a check that replaces 'std::unique_ptr(new type(args...))' with 'std::make_unique(args...)'. It was on the list of "Ideas for new Tools". It needs to be tested more

Re: [PATCH] D13166: Create modernize-make-unique check.

2015-09-28 Thread Angel Garcia via cfe-commits
angelgarcia added inline comments. Comment at: clang-tidy/modernize/MakeUniqueCheck.cpp:25-27 @@ +24,5 @@ + +/// \brief Returns the length of the token that goes since the beggining of the +/// constructor call until the '<' of the template. This token should either be +/// 'uniqu

Re: [PATCH] D13166: Create modernize-make-unique check.

2015-09-28 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 35839. angelgarcia marked an inline comment as done. angelgarcia added a comment. Remove 'hasCanonicalType'. http://reviews.llvm.org/D13166 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/MakeUniqueCheck.cpp clang-tidy/modernize/Ma

Re: [PATCH] D13166: Create modernize-make-unique check.

2015-09-28 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 35841. angelgarcia added a comment. Two tests in which 'getTokenLength' returns 0. http://reviews.llvm.org/D13166 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/MakeUniqueCheck.cpp clang-tidy/modernize/MakeUniqueCheck.h clang-ti

Re: [PATCH] D13166: Create modernize-make-unique check.

2015-09-28 Thread Angel Garcia via cfe-commits
angelgarcia added a comment. How can Lexer::getSourceText give us the range? My problem precisely is that I couldn't find any way to obtain the range of the constructor call without the template arguments. http://reviews.llvm.org/D13166 ___ cfe-comm

Re: [PATCH] D13166: Create modernize-make-unique check.

2015-09-28 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 35864. angelgarcia added a comment. I think this is a bit better than before. http://reviews.llvm.org/D13166 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/MakeUniqueCheck.cpp clang-tidy/modernize/MakeUniqueCheck.h clang-tidy/mo

Re: [PATCH] D13166: Create modernize-make-unique check.

2015-09-28 Thread Angel Garcia via cfe-commits
angelgarcia added a comment. This raises a question. Do we want to do replacements when we use an alias for std::unique_ptr? That fact that something is an unique_ptr might be an implementation detail that should not be exposed, but it could also happen that the alias is there only for brevity. Wh

Re: [PATCH] D13166: Create modernize-make-unique check.

2015-09-28 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 35873. angelgarcia added a comment. Also replace on aliases. http://reviews.llvm.org/D13166 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/MakeUniqueCheck.cpp clang-tidy/modernize/MakeUniqueCheck.h clang-tidy/modernize/Modernize

Re: [PATCH] D13166: Create modernize-make-unique check.

2015-09-29 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 35949. angelgarcia added a comment. Add a comment. http://reviews.llvm.org/D13166 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/MakeUniqueCheck.cpp clang-tidy/modernize/MakeUniqueCheck.h clang-tidy/modernize/ModernizeTidyModule

[PATCH] D13246: Fix bug in modernize-use-nullptr.

2015-09-29 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: alexfh, cfe-commits. https://llvm.org/bugs/show_bug.cgi?id=24960 modernize-use-nullptr would hit an assertion in some cases involving macros and initializer lists, due to finding a node with m

[PATCH] D13249: Divide TraverseInitListExpr to a different function for each form.

2015-09-29 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: alexfh, cfe-commits. create TraverseSyntacticInitListExpr and TraverseSemanticInitListExpr. http://reviews.llvm.org/D13249 Files: include/clang/AST/RecursiveASTVisitor.h Index: include/clan

Re: [PATCH] D13249: Divide TraverseInitListExpr to a different function for each form.

2015-09-29 Thread Angel Garcia via cfe-commits
angelgarcia added a comment. Yes, it breaks a few tests: FAIL: Clang :: Analysis/operator-calls.cpp (598 of 8596) FAIL: Clang :: Analysis/misc-ps-region-store.cpp (599 of 8596) FAIL: Clang :: Analysis/array-struct-region.c (602 of 8596) http://reviews.llvm.org/D13249 __

Re: [PATCH] D13249: Divide TraverseInitListExpr to a different function for each form.

2015-09-30 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 36099. angelgarcia added a comment. Add some comments. http://reviews.llvm.org/D13249 Files: include/clang/AST/RecursiveASTVisitor.h Index: include/clang/AST/RecursiveASTVisitor.h === --

Re: [PATCH] D13249: Divide TraverseInitListExpr to a different function for each form.

2015-09-30 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 36106. angelgarcia added a comment. Use only one function. I find somewhat frustating that getSemanticForm() returns nullptr if the object is already in its semantic form (and the same for isSyntacticForm()). Something like QualType::getNonReferenceType

[PATCH] D13292: Add support for 'cbegin()' and 'cend()' on modernize-loop-convert.

2015-09-30 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: cfe-commits, alexfh. This fixes https://llvm.org/bugs/show_bug.cgi?id=22196 . Also add a non-trivially copyable type to fix some tests that were meant to be about using const-refs, but were ch

Re: [PATCH] D13292: Add support for 'cbegin()' and 'cend()' on modernize-loop-convert.

2015-10-01 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 36198. angelgarcia added a comment. Yes, right now it is pretty hard to figure out what some of the tests are for, they are a bit messy. I plan to do something about it, but for now I added a comment on that test. http://reviews.llvm.org/D13292 Files:

Re: [PATCH] D13292: Add support for 'cbegin()' and 'cend()' on modernize-loop-convert.

2015-10-01 Thread Angel Garcia via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL248994: Add support for 'cbegin()' and 'cend()' on modernize-loop-convert. (authored by angelgarcia). Changed prior to commit: http://reviews.llvm.org/D13292?vs=36198&id=36200#toc Repository: rL LLVM

[PATCH] D13342: Prevent loop-convert from leaving empty lines after removing an alias declaration.

2015-10-01 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: alexfh, cfe-commits. This fixes https://llvm.org/bugs/show_bug.cgi?id=17716. http://reviews.llvm.org/D13342 Files: clang-tidy/modernize/LoopConvertCheck.cpp clang-tidy/modernize/LoopConver

Re: [PATCH] D13342: Prevent loop-convert from leaving empty lines after removing an alias declaration.

2015-10-01 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 36234. angelgarcia added a comment. Change a comment. http://reviews.llvm.org/D13342 Files: clang-tidy/modernize/LoopConvertCheck.cpp clang-tidy/modernize/LoopConvertCheck.h test/clang-tidy/modernize-loop-convert-extra.cpp Index: test/clang-tidy/

[PATCH] D13346: Update clang-tidy documentation.

2015-10-01 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: alexfh, cfe-commits. Improve modernize-use-auto documentation (https://llvm.org/bugs/show_bug.cgi?id=24962). Add documentation for modernize-make-unique. http://reviews.llvm.org/D13346 Files:

[PATCH] D13381: Handle trailing underscores on modernize-loop-convert variable namer.

2015-10-02 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: alexfh, cfe-commits. https://llvm.org/bugs/show_bug.cgi?id=24961. http://reviews.llvm.org/D13381 Files: clang-tidy/modernize/LoopConvertUtils.cpp test/clang-tidy/modernize-loop-convert-low

Re: [PATCH] D13381: Handle trailing underscores on modernize-loop-convert variable namer.

2015-10-02 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 36358. angelgarcia added a comment. I forgot one. http://reviews.llvm.org/D13381 Files: clang-tidy/modernize/LoopConvertUtils.cpp test/clang-tidy/modernize-loop-convert-lowercase.cpp test/clang-tidy/modernize-loop-convert-uppercase.cpp Index: tes

Re: [PATCH] D13381: Handle trailing underscores on modernize-loop-convert variable namer.

2015-10-02 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 36357. angelgarcia added a comment. Yes! Sorry. http://reviews.llvm.org/D13381 Files: clang-tidy/modernize/LoopConvertUtils.cpp test/clang-tidy/modernize-loop-convert-lowercase.cpp test/clang-tidy/modernize-loop-convert-uppercase.cpp Index: test/

Re: [PATCH] D13246: Fix bug in modernize-use-nullptr.

2015-10-02 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 36359. angelgarcia added a comment. Update this patch to the change in RecursiveASTVisitor. http://reviews.llvm.org/D13246 Files: clang-tidy/modernize/UseNullptrCheck.cpp test/clang-tidy/modernize-use-nullptr.cpp Index: test/clang-tidy/modernize-us

[PATCH] D13431: Document a bug in loop-convert and fix one of its subcases.

2015-10-05 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: cfe-commits, alexfh. Now that we prioritize copying trivial types over using const-references where possible, I found some cases where, after the transformation, the loop was using the address

Re: [PATCH] D13431: Document a bug in loop-convert and fix one of its subcases.

2015-10-05 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 36500. angelgarcia added a comment. Use "UOP". http://reviews.llvm.org/D13431 Files: clang-tidy/modernize/LoopConvertCheck.cpp test/clang-tidy/modernize-loop-convert-basic.cpp Index: test/clang-tidy/modernize-loop-convert-basic.cpp

Re: [PATCH] D13431: Document a bug in loop-convert and fix one of its subcases.

2015-10-05 Thread Angel Garcia via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL249300: Document a bug in loop-convert and fix one of its subcases. (authored by angelgarcia). Changed prior to commit: http://reviews.llvm.org/D13431?vs=36500&id=36501#toc http://reviews.llvm.org/D134

[PATCH] D13433: Use better mocks in modernize-make-unique, and fix matcher.

2015-10-05 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: cfe-commits, alexfh. Add the second template argument to the unique_ptr mock, and update the matcher so that it only matches against cases where the second argument is the default. http://revi

[PATCH] D13469: Create interfaces and tests for the overlapping replacements fix in clang-tidy.

2015-10-06 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: klimek. angelgarcia added subscribers: cfe-commits, alexfh. No changes in clang-tidy yet. http://reviews.llvm.org/D13469 Files: unittests/clang-tidy/CMakeLists.txt unittests/clang-tidy/ClangTidyTest.h unittests/clang-tidy/Ove

Re: [PATCH] D13469: Create interfaces and tests for the overlapping replacements fix in clang-tidy.

2015-10-06 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 36615. angelgarcia added a comment. This test was intended to ensure that we don't have a bug in the mock checks. I've split it up into one test for each mock check, I hope it is more descriptive now. http://reviews.llvm.org/D13469 Files: unittests/

Re: [PATCH] D13469: Create interfaces and tests for the overlapping replacements fix in clang-tidy.

2015-10-06 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 36620. angelgarcia added a comment. Explain why we have defined these mocks. http://reviews.llvm.org/D13469 Files: unittests/clang-tidy/CMakeLists.txt unittests/clang-tidy/ClangTidyTest.h unittests/clang-tidy/OverlappingReplacementsTest.cpp unit

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

2015-10-07 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added reviewers: klimek, bkramer. angelgarcia added subscribers: alexfh, cfe-commits. This fixes https://llvm.org/bugs/show_bug.cgi?id=25082 . http://reviews.llvm.org/D13504 Files: clang-tidy/modernize/UseAutoCheck.cpp test/clang-tidy/modernize-

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

2015-10-07 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 36724. angelgarcia added a comment. Good point. Solved. http://reviews.llvm.org/D13504 Files: clang-tidy/modernize/UseAutoCheck.cpp test/clang-tidy/modernize-use-auto-new.cpp Index: test/clang-tidy/modernize-use-auto-new.cpp ===

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

2015-10-07 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added reviewers: klimek, bkramer. angelgarcia added subscribers: alexfh, cfe-commits. Prevent clang-tidy from applying fixes to errors that overlap with other errors' fixes, with one exception: if one fix is completely contained inside another one,

[PATCH] D11946: Create clang-tidy module modernize. Add pass-by-value check.

2015-08-11 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: alexfh. angelgarcia added a subscriber: cfe-commits. angelgarcia changed the visibility of this Differential Revision from "Public (No Login Required)" to "All Users". This is the first step for migrating cppmodernize to clang-tidy.

Re: [PATCH] D11946: Create clang-tidy module modernize. Add pass-by-value check.

2015-08-12 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 31911. angelgarcia added a comment. Run clang-format and minor fixes. http://reviews.llvm.org/D11946 Files: CMakeLists.txt Makefile ModernizeTidyModule.cpp PassByValueCheck.cpp PassByValueCheck.h clang-tidy/CMakeLists.txt clang-tidy/Makefi

Re: [PATCH] D11946: Create clang-tidy module modernize. Add pass-by-value check.

2015-08-12 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 31948. angelgarcia marked 20 inline comments as done. angelgarcia added a comment. Fix tests and minor issues (auto, punctuation, etc). http://reviews.llvm.org/D11946 Files: clang-tidy/CMakeLists.txt clang-tidy/Makefile clang-tidy/modernize/CMakeL

Re: [PATCH] D11946: Create clang-tidy module modernize. Add pass-by-value check.

2015-08-13 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 32036. angelgarcia marked 4 inline comments as done. angelgarcia added a comment. Set IncludeStyle as an option. Fix comments. http://reviews.llvm.org/D11946 Files: clang-tidy/CMakeLists.txt clang-tidy/Makefile clang-tidy/modernize/CMakeLists.txt

Re: [PATCH] D11946: Create clang-tidy module modernize. Add pass-by-value check.

2015-08-13 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 32055. angelgarcia marked 3 inline comments as done. angelgarcia added a comment. Make IncludeStyle constant, initialize it with StringSwitch. Fix indentation. http://reviews.llvm.org/D11946 Files: clang-tidy/CMakeLists.txt clang-tidy/Makefile cla

Re: [PATCH] D11946: Create clang-tidy module modernize. Add pass-by-value check.

2015-08-13 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 32059. angelgarcia added a comment. Remove StringSwitch. http://reviews.llvm.org/D11946 Files: clang-tidy/CMakeLists.txt clang-tidy/Makefile clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/Makefile clang-tidy/modernize/ModernizeTidyMo

Re: [PATCH] D11946: Create clang-tidy module modernize. Add pass-by-value check.

2015-08-13 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 32061. angelgarcia added a comment. Remove StringSwitch. http://reviews.llvm.org/D11946 Files: clang-tidy/CMakeLists.txt clang-tidy/Makefile clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/Makefile clang-tidy/modernize/ModernizeTidyMo

[PATCH] D12017: Fix IncludeInserter/IncludeSorter bug.

2015-08-13 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: alexfh. angelgarcia added subscribers: cfe-commits, klimek. angelgarcia changed the visibility of this Differential Revision from "Public (No Login Required)" to "All Users". If there weren't any includes in the file, or all of them

Re: [PATCH] D12017: Fix IncludeInserter/IncludeSorter bug.

2015-08-14 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 32143. angelgarcia added a comment. Update tests. http://reviews.llvm.org/D12017 Files: clang-tidy/IncludeInserter.cpp clang-tidy/IncludeSorter.cpp clang-tidy/IncludeSorter.h unittests/clang-tidy/IncludeInserterTest.cpp Index: unittests/clang-t

Re: [PATCH] D12017: Fix IncludeInserter/IncludeSorter bug.

2015-08-14 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 32146. angelgarcia added a comment. Add comments. http://reviews.llvm.org/D12017 Files: clang-tidy/IncludeInserter.cpp clang-tidy/IncludeSorter.cpp clang-tidy/IncludeSorter.h unittests/clang-tidy/IncludeInserterTest.cpp Index: unittests/clang-t

[PATCH] D12081: Add use-nullptr check to clang-tidy.

2015-08-17 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: alexfh. angelgarcia added subscribers: klimek, cfe-commits. angelgarcia changed the visibility of this Differential Revision from "Public (No Login Required)" to "All Users". Move UseNullptr from clang-modernize to modernize module

Re: [PATCH] D12081: Add use-nullptr check to clang-tidy.

2015-08-17 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 32303. angelgarcia added a comment. Previous diff was not the newest one. http://reviews.llvm.org/D12081 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/UseNullptrCheck.cpp clang-tidy/

Re: [PATCH] D12081: Add use-nullptr check to clang-tidy.

2015-08-17 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 32311. angelgarcia marked 9 inline comments as done. angelgarcia added a comment. Comments fixed. http://reviews.llvm.org/D12081 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/UseNullpt

Re: [PATCH] D12081: Add use-nullptr check to clang-tidy.

2015-08-19 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 32539. angelgarcia marked 13 inline comments as done. angelgarcia added a comment. Fix comments. http://reviews.llvm.org/D12081 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/UseNullptr

Re: [PATCH] D12081: Add use-nullptr check to clang-tidy.

2015-08-19 Thread Angel Garcia via cfe-commits
angelgarcia added a comment. Ok, thanks! :) http://reviews.llvm.org/D12081 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D12157: Fix LoopConvertCheck bug.

2015-08-19 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: alexfh. angelgarcia added subscribers: klimek, cfe-commits. angelgarcia changed the visibility of this Differential Revision from "Public (No Login Required)" to "All Users". Fix LoopConvertCheck bug: StringRef to temporaries. http

[PATCH] D12162: Remove reference.

2015-08-19 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: alexfh. angelgarcia added subscribers: cfe-commits, klimek. angelgarcia changed the visibility of this Differential Revision from "Public (No Login Required)" to "All Users". Remove a reference where a value was intended (its being

Re: [PATCH] D12162: Remove reference.

2015-08-19 Thread Angel Garcia via cfe-commits
angelgarcia changed the visibility of this Differential Revision from "All Users" to "Public (No Login Required)". angelgarcia updated this revision to Diff 32576. angelgarcia added a comment. Use ArrayRef. http://reviews.llvm.org/D12162 Files: clang-tidy/modernize/UseNullptrCheck.cpp Index

[PATCH] D12186: Fix bug in modernize-loop-convert check.

2015-08-20 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: alexfh. angelgarcia added a subscriber: cfe-commits. angelgarcia changed the visibility of this Differential Revision from "Public (No Login Required)" to "All Users". Remove implicit conversion from nullptr to StringRef. http://re

Re: [PATCH] D12186: Fix bug in modernize-loop-convert check.

2015-08-20 Thread Angel Garcia via cfe-commits
angelgarcia added a comment. It is allowed as long as you specify that the length is 0. assert https://cs.corp.google.com/#piper///depot/google3/third_party/grte/v4_x86/release/usr/grte/v4/include/assert.h&l=85&ct=xref_jump_to_def&cl=GROK&gsn=assert((data https://cs.corp.google.com/#piper///depo

Re: [PATCH] D12186: Fix bug in modernize-loop-convert check.

2015-08-20 Thread Angel Garcia via cfe-commits
angelgarcia added a comment. Oooops, copy pasting there was not a good idea. Sorry :( http://reviews.llvm.org/D12186 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D12186: Fix bug in modernize-loop-convert check.

2015-08-20 Thread Angel Garcia via cfe-commits
angelgarcia added a comment. In http://reviews.llvm.org/D12186#228704, @bkramer wrote: > I meant the code before your change, which calls `StringRef(const char *Str)` > and completely disallows nullptr. In other words: this change is missing a > regression test. You are right, the current tes

Re: [PATCH] D12186: Fix bug in modernize-loop-convert check.

2015-08-20 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 32688. angelgarcia added a comment. Add a test. http://reviews.llvm.org/D12186 Files: clang-tidy/modernize/LoopConvertCheck.cpp test/clang-tidy/Inputs/modernize-loop-convert/structures.h test/clang-tidy/modernize-loop-convert-extra.cpp Index: tes

[PATCH] D12231: Add use-auto check to modernize module.

2015-08-21 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: alexfh. angelgarcia added subscribers: cfe-commits, klimek. angelgarcia changed the visibility of this Differential Revision from "Public (No Login Required)" to "All Users". Migrate UseAuto from clang-modernize to clang-tidy. http

Re: [PATCH] D12231: Add use-auto check to modernize module.

2015-08-21 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 32815. angelgarcia marked 10 inline comments as done. angelgarcia added a comment. Fix comments. I did not include the 'hasDeclaration()" call in the 'standardIterator' function because its return type is internal::PolymorphicMatcherWithParam1< internal:

Re: [PATCH] D12231: Add use-auto check to modernize module.

2015-08-21 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 32816. angelgarcia added a comment. Apply clang-format to the code. http://reviews.llvm.org/D12231 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/UseAutoCheck.cpp clang-tidy/modernize

Re: [PATCH] D12231: Add use-auto check to modernize module.

2015-08-21 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 32818. angelgarcia added a comment. Fix comments: change warning message and minor fixes. http://reviews.llvm.org/D12231 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/UseAutoCheck.cpp

Re: [PATCH] D12231: Add use-auto check to modernize module.

2015-08-21 Thread Angel Garcia via cfe-commits
angelgarcia closed this revision. angelgarcia added a comment. Committed revision 245703. http://reviews.llvm.org/D12231 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D12281: Tests no longer need the 'REQUIRES: SHELL' line.

2015-08-24 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: alexfh. angelgarcia added subscribers: cfe-commits, klimek. Update python script, so that it doesn't print that line in new tests. http://reviews.llvm.org/D12281 Files: clang-tidy/add_new_check.py Index: clang-tidy/add_new_check

[PATCH] D12287: Add replace-auto_ptr check.

2015-08-24 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: alexfh. angelgarcia added subscribers: cfe-commits, klimek. Migrate replace-auto_ptr check from clang-modernize to modernize module in clang-tidy. http://reviews.llvm.org/D12287 Files: clang-tidy/modernize/CMakeLists.txt clang

Re: [PATCH] D12287: Add replace-auto_ptr check.

2015-08-25 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 33055. angelgarcia added a comment. Add check description. http://reviews.llvm.org/D12287 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/ReplaceAutoPtrCheck.cpp clang-tidy/modernize/R

Re: [PATCH] D12287: Add replace-auto_ptr check.

2015-08-25 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 33066. angelgarcia added a comment. Use the full message once in the test, and truncate all the other patterns. http://reviews.llvm.org/D12287 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/moder

[PATCH] D12321: Avoid LoopConvertCheck replacements in template instantiations.

2015-08-25 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: alexfh. angelgarcia added subscribers: cfe-commits, klimek. Prevent LoopConvertCheck from doing replacements in template instantiations, and add a test. http://reviews.llvm.org/D12321 Files: clang-tidy/modernize/LoopConvertCheck

Re: [PATCH] D12321: Avoid LoopConvertCheck replacements in template instantiations.

2015-08-25 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 33081. angelgarcia added a comment. Add test. http://reviews.llvm.org/D12321 Files: clang-tidy/modernize/LoopConvertCheck.cpp test/clang-tidy/modernize-loop-convert-extra.cpp Index: test/clang-tidy/modernize-loop-convert-extra.cpp =

[PATCH] D12361: LoopConvert no longer take as alias references to other containers.

2015-08-26 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: alexfh. angelgarcia added subscribers: cfe-commits, klimek. Fix a bug where modernize-loop-convert check would take as alias a reference to other containers. Add the pertinent test. http://reviews.llvm.org/D12361 Files: clang-ti

[PATCH] D12370: Fix another LoopConvert fail.

2015-08-26 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: alexfh. angelgarcia added subscribers: cfe-commits, klimek. Prevent LoopConvert from taking as alias anything that comes from a random member function call. http://reviews.llvm.org/D12370 Files: clang-tidy/modernize/LoopConvertU

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

2015-09-01 Thread Angel Garcia via cfe-commits
angelgarcia created this revision. angelgarcia added a reviewer: alexfh. angelgarcia added subscribers: klimek, cfe-commits. Reduced the amount of wrong conversions of this check. http://reviews.llvm.org/D12530 Files: clang-tidy/modernize/LoopConvertCheck.cpp clang-tidy/modernize/LoopConvert

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

2015-09-01 Thread Angel Garcia via cfe-commits
angelgarcia marked 2 inline comments as done. Comment at: test/clang-tidy/modernize-loop-convert-basic.cpp:448 @@ +447,3 @@ +ret = it; + } +} klimek wrote: > This test seems to be missing the it.insert(0) case that was removed from the > "unsupported" comme

  1   2   >