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

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] 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

[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

[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] 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

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] 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

[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

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

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:

[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

[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

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] 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] 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] 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] 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

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
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] 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

[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] 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] 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

[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

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] 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] 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/

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] 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-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] 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 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

[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 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

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

[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

[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

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] 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

[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

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

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

[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] 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

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] 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

[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

[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] 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

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

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

[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: [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

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: [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 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
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

[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] 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

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-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-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 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-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-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 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 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 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

[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] 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

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] 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] 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 ===

[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

[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,

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] 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] 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

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/

[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

[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

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

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

[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] 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

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] 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

[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

[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:

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] 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] 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

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:

[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] 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

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-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 __

[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

  1   2   >