[PATCH] D19586: Misleading Indentation check

2017-02-14 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG Comment at: clang-tidy/readability/MisleadingIndentationCheck.cpp:79 + Finder->addMatcher( + compoundStmt(anyOf(has(ifStmt()), has(forStmt()), has(whileStmt( +

[PATCH] D19586: Misleading Indentation check

2017-02-14 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Gábor, thank you for picking up this patch and finishing it! https://reviews.llvm.org/D19586 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D28768: [clang-tidy] Add check 'modernize-return-braced-init-list'

2017-02-14 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added a comment. This revision now requires changes to proceed. A few more nits. Comment at: clang-tidy/modernize/ReturnBracedInitListCheck.cpp:66 + auto Diag = diag(Loc, "to avoid repeating the return type from the " +

[PATCH] D29899: [clang-tidy] Add support for NOLINTNEXTLINE.

2017-02-14 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. Awesome! LG with one nit. Comment at: clang-tidy/ClangTidyDiagnosticConsumer.cpp:300 + // Now skip any newlines. + // FIXME: We want to skip over exactly one line, not an a

[PATCH] D29928: [clang-tidy] Improve diagnostic message for misc-definitions-in-header.

2017-02-14 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG. Thank you! https://reviews.llvm.org/D29928 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/list

[PATCH] D29957: [clang-tidy] Ignore instantiated functions and static data members of classes in misc-definitions-in-headers.

2017-02-15 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG https://reviews.llvm.org/D29957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[PATCH] D28768: [clang-tidy] Add check 'modernize-return-braced-init-list'

2017-02-15 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LGTM. Please wait for Aaron as well. Repository: rL LLVM https://reviews.llvm.org/D28768 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[PATCH] D19201: [clang-tidy] misc-throw-with-noexcept

2017-02-15 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/misc/ThrowWithNoexceptCheck.cpp:54 +// FIXME use DiagnosticIDs::Level::Note +diag(NoExceptRange.getBegin(), "in a function declared no-throw here:", DiagnosticIDs::Note) +<< FixItHint::CreateRemoval(NoExceptRan

[PATCH] D30034: [clang-tidy] Fix a false positive for explicit template instantiations in misc-unused-using-decls.

2017-02-16 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. > it may introduce true positives True positives is all we need from clang-tidy checks ;) I guess, you meant "false negatives" (https://en.wikipedia.org/wiki/False_positives_and_false_negatives). The main question here is whether we should extend the AST instead of ha

[PATCH] D30034: [clang-tidy] Fix a false positive for explicit template instantiations in misc-unused-using-decls.

2017-02-16 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Richard, it seems like the AST could be improved here by adding nodes for the explicit instantiation declarations and definitions or using existing nodes, if there are suitable ones. What do you think? https://reviews.llvm.org/D30034 _

[PATCH] D29806: [clang-tidy] Add -path option to clang-tidy-diff.py

2017-02-17 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D29806#673489, @ehsan wrote: > In https://reviews.llvm.org/D29806#673329, @alexfh wrote: > > > What's your use case? Can it be addressed by just forwarding the -p flag to > > clang-tidy? > > > I just need to pass the full path to the compilatio

[PATCH] D30002: [clang-tidy] Fix handling of methods with try-statement as a body in modernize-use-override

2017-02-17 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG https://reviews.llvm.org/D30002 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[PATCH] D29806: [clang-tidy] Add -path option to clang-tidy-diff.py

2017-02-17 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG https://reviews.llvm.org/D29806 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[PATCH] D30191: [clang-tidy] Reword the "code outside header guard" warning.

2017-02-21 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG. Thank you for the fix! https://reviews.llvm.org/D30191 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/

[PATCH] D21815: [clang-tidy] Add 'included from' details to warning message.

2017-02-21 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Ping ;) Do you have time to finish this? https://reviews.llvm.org/D21815 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D30412: [clang-tidy] Fix a false positive on modernize-use-nullptr check.

2017-02-28 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG. Thanks for tracking this down! https://reviews.llvm.org/D30412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/

[PATCH] D30002: [clang-tidy] Fix handling of methods with try-statement as a body in modernize-use-override

2017-03-01 Thread Alexander Kornienko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL296598: [clang-tidy] Fix handling of methods with try-statement as a body in modernize… (authored by alexfh). Changed prior to commit: https://reviews.llvm.org/D30002?vs=88582&id=90136#toc Repository:

[PATCH] D16183: Added CheckName field to YAML report

2017-03-01 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. This patch is superseded by https://reviews.llvm.org/D26137. https://reviews.llvm.org/D16183 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D30034: [clang-tidy] Fix a false positive for explicit template instantiations in misc-unused-using-decls.

2017-03-01 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added a comment. This revision now requires changes to proceed. I think, we decided to extend the AST instead of working around its incompleteness. https://reviews.llvm.org/D30034 ___ cfe-commits ma

[PATCH] D29858: [clang-tidy] Catch trivially true statements like a != 1 || a != 3

2017-03-02 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG unless Etienne has any concerns. https://reviews.llvm.org/D29858 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org

[PATCH] D29858: [clang-tidy] Catch trivially true statements like a != 1 || a != 3

2017-03-02 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Do you need someone to commit the patch for you? https://reviews.llvm.org/D29858 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D30564: [clang-tidy] Format code around applied fixes

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh created this revision. Herald added a subscriber: JDevlieghere. Add -format option (disabled by default for now) to trigger formatting of replacements. https://reviews.llvm.org/D30564 Files: clang-tidy/ClangTidy.cpp clang-tidy/ClangTidy.h clang-tidy/tool/ClangTidyMain.cpp docs/Re

[PATCH] D30564: [clang-tidy] Format code around applied fixes

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh updated this revision to Diff 90442. alexfh added a comment. Pacify llvm::Expected<> debug checks. https://reviews.llvm.org/D30564 Files: clang-tidy/ClangTidy.cpp clang-tidy/ClangTidy.h clang-tidy/tool/ClangTidyMain.cpp docs/ReleaseNotes.rst docs/clang-tidy/index.rst test/cla

[PATCH] D30564: [clang-tidy] Format code around applied fixes

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: test/clang-tidy/readability-braces-around-statements-format.cpp:1 +// RUN: %check_clang_tidy %s readability-braces-around-statements %t -- -format -- + malcolm.parsons wrote: > Will clang-tidy look for a .clang-format fi

[PATCH] D30564: [clang-tidy] Format code around applied fixes

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh marked an inline comment as done. alexfh added inline comments. Comment at: docs/clang-tidy/index.rst:184 -p= - Build path +-quiet - + Run clang-tidy in quiet mode. This suppresses -

[PATCH] D30564: [clang-tidy] Format code around applied fixes

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh updated this revision to Diff 90445. alexfh marked an inline comment as done. alexfh added a comment. Replace the separate -format and -style options with -format-style (default is 'none', which means no formatting). https://reviews.llvm.org/D30564 Files: clang-tidy/ClangTidy.cpp cla

[PATCH] D30564: [clang-tidy] Format code around applied fixes

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh updated this revision to Diff 90447. alexfh added a comment. Expanded -format-style option description. Run cleanup tests with different format styles, just in case. https://reviews.llvm.org/D30564 Files: clang-tidy/ClangTidy.cpp clang-tidy/tool/ClangTidyMain.cpp docs/ReleaseNotes

[PATCH] D30564: [clang-tidy] Format code around applied fixes

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D30564#691446, @malcolm.parsons wrote: > In https://reviews.llvm.org/D30564#691441, @alexfh wrote: > > > Replace the separate -format and -style options with -format-style (default > > is > > 'none', which means no formatting). > > > Is there

[PATCH] D30564: [clang-tidy] Format code around applied fixes

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh updated this revision to Diff 90448. alexfh added a comment. Clarify the 'file' option a bit. https://reviews.llvm.org/D30564 Files: clang-tidy/ClangTidy.cpp clang-tidy/tool/ClangTidyMain.cpp docs/ReleaseNotes.rst docs/clang-tidy/index.rst test/clang-tidy/clean-up-code.cpp te

[PATCH] D30564: [clang-tidy] Format code around applied fixes

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. PTAL https://reviews.llvm.org/D30564 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D30564: [clang-tidy] Format code around applied fixes

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh updated this revision to Diff 90452. alexfh added a comment. Apply changes even when formatting fails. https://reviews.llvm.org/D30564 Files: clang-tidy/ClangTidy.cpp clang-tidy/tool/ClangTidyMain.cpp docs/ReleaseNotes.rst docs/clang-tidy/index.rst test/clang-tidy/clean-up-code

[PATCH] D30564: [clang-tidy] Format code around applied fixes

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL296864: [clang-tidy] Format code around applied fixes (authored by alexfh). Changed prior to commit: https://reviews.llvm.org/D30564?vs=90452&id=90453#toc Repository: rL LLVM https://reviews.llvm.or

[PATCH] D30569: [clang-tidy] misc-use-after-move: Fix failing assertion

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG. Thanks! Comment at: test/clang-tidy/misc-use-after-move.cpp:285 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: 'a' used after it was moved - // CHECK-MESSAGES: [[@LINE-3]

[PATCH] D30567: [clang-tidy] Fix treating non-space whitespaces in checks list.

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. What's the practical use of newlines and tab characters in the glob list? https://reviews.llvm.org/D30567 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D30569: [clang-tidy] misc-use-after-move: Fix failing assertion

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: test/clang-tidy/misc-use-after-move.cpp:285 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: 'a' used after it was moved - // CHECK-MESSAGES: [[@LINE-3]]:6: note: move occurred here + // CHECK-MESSAGES: [[@LINE-3]]:7: note: move occurred h

[PATCH] D30607: Replace re module by regex module in run-clang-tidy script

2017-03-05 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. https://docs.python.org/2/howto/regex.html#introduction says "The regex module was removed completely in Python 2.5.". Why would we want to switch to it? https://reviews.llvm.org/D30607 ___ cfe-commits mailing list cfe-commi

[PATCH] D30607: Replace re module by regex module in run-clang-tidy script

2017-03-05 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Actually, I'm not sure why we need groups in that regex. We can instead try replacing `re.compile('(' + ')|('.join(args.files) + ')')` with `re.compile('|'.join(args.files))`. https://reviews.llvm.org/D30607 ___ cfe-commits

[PATCH] D30639: [clang-tidy] Ignore substituted template types in modernize-use-nullptr check.

2017-03-06 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG https://reviews.llvm.org/D30639 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[PATCH] D30650: [clang-tidy] misc-use-after-move: Fix failing assertion

2017-03-06 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG. So you won the flappy column game? ;) https://reviews.llvm.org/D30650 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.ll

[PATCH] D30639: [clang-tidy] Ignore substituted template types in modernize-use-nullptr check.

2017-03-06 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tools-extra/trunk/test/clang-tidy/modernize-use-nullptr.cpp:254 + + void h(T *default_value = 0) {} + xazax.hun wrote: > Maybe as a separate patch, but I think it might be worth to warn here. WDYT? > (Sorry for t

[PATCH] D30650: [clang-tidy] misc-use-after-move: Fix failing assertion

2017-03-06 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D30650#693165, @Eugene.Zelenko wrote: > I think we should refactor this check as part of Static Analyzer, since it's > path-sensitive. We can think about trying this as a SA checker, but it's irrelevant to this patch. https://reviews.llvm.

[PATCH] D30748: [Lexer] Finding beginning of token with escaped new line

2017-03-09 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added inline comments. This revision now requires changes to proceed. Comment at: lib/Lex/Lexer.cpp:457 +static bool isNewLineEscaped(const char *BufferStart, const char *Str) { + while (Str > BufferStart && isWhitespace(*Str)) +

[PATCH] D30610: [clang-tidy] Added options to cppcoreguidelines-special-member-functions check

2017-03-12 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.cpp:184 + if (!MissingMembers.empty()) +diag(ID.first, "class '%0' defines %1 but does not define %2") +<< ID.second << join(DefinedMembers, " and ") A

[PATCH] D30931: [clang-tidy] added new identifier naming case type for ignoring case style

2017-03-14 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. BTW, next time please add cfe-commits to subscribers when you create the patch to get it sent properly to the mailing list. https://reviews.llvm.org/D30931 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists

[PATCH] D26137: [clang-tidy] Add check name to YAML export

2016-11-28 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. I'll try to get back to this code review soon. Sorry for the delay. Repository: rL LLVM https://reviews.llvm.org/D26137 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo

[PATCH] D27187: [clang-tidy] Do not move parameter if only DeclRefExpr occurs inside of a loop

2016-11-29 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/utils/DeclRefExprUtils.cpp:127 + match(findAll(declRefExpr(equalsNode(&DeclRef), +unless(hasAncestor(stmt(anyOf( +forStmt(), cxxForRangeStmt(), whileStmt(

[PATCH] D27166: [clang-tidy] Enhance modernize-use-auto to templated function casts

2016-11-29 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/modernize/UseAutoCheck.cpp:173-177 +/// Matches the type that was substituted for the template parameter. +AST_MATCHER_P(SubstTemplateTypeParmType, hasReplacementType, + ast_matchers::internal::Matcher, InnerMatche

[PATCH] D27187: [clang-tidy] Do not move parameter if only DeclRefExpr occurs inside of a loop

2016-11-29 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/utils/DeclRefExprUtils.cpp:127 + match(findAll(declRefExpr(equalsNode(&DeclRef), +unless(hasAncestor(stmt(anyOf( +forStmt(), cxxForRangeStmt(), whileStmt(

[PATCH] D27142: [clang-tidy] Make format style customizable

2016-11-30 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG. Thanks! Repository: rL LLVM https://reviews.llvm.org/D27142 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/

[PATCH] D26137: [clang-tidy] Add check name to YAML export

2016-11-30 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added a comment. This revision now requires changes to proceed. Looks mostly good. A few more nits. Comment at: include/clang/Tooling/Core/Diagnostic.h:68-71 + /// A freeform chunk of text to describe the context of the replace

[PATCH] D26137: [clang-tidy] Add check name to YAML export

2016-12-01 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG with a comment. Comment at: include/clang/Tooling/DiagnosticsYaml.h:79 + for (auto &Diagnostic : Doc.Diagnostics) { +if (Diagnostic.Fix.size() > 0) { +

[PATCH] D27284: [ClangTidy] Add new performance-type-promotion-in-math-fn check.

2016-12-01 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added a comment. This revision now requires changes to proceed. Thank you for the new check! A few comments. Comment at: clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.cpp:22 +AST_MATCHER_P(Type, isBuiltinT

[PATCH] D26511: [clang-tidy] Rename modernize-use-default to modernize-use-equals-default

2016-12-01 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/modernize/ModernizeTidyModule.cpp:58 "modernize-use-bool-literals"); -CheckFactories.registerCheck("modernize-use-default"); + CheckFactories.registerCheck("modernize-use-equals-default"); CheckFactories.r

[PATCH] D27210: [clang-tidy] misc-string-compare. Adding a new check to clang-tidy

2016-12-01 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added inline comments. This revision now requires changes to proceed. Comment at: clang-tidy/misc/StringCompareCheck.cpp:29 + + // First and second case: cast str.compare(str) to boolean + Finder->addMatcher( Pl

[PATCH] D26137: [clang-tidy] Add check name to YAML export

2016-12-01 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Do you have commit access? If you need me to commit the patch for you, please rebase it on top of HEAD. Repository: rL LLVM https://reviews.llvm.org/D26137 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://li

[PATCH] D27248: [clang-tidy] Do not trigger unnecessary-value-param check on methods marked as final

2016-12-01 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. LG. Looks like a strict improvement. https://reviews.llvm.org/D27248 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D26418: [clang-tidy] Add '-suppress-checks-filter' option to suppress diagnostics from certain files

2016-12-01 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Sorry for the delay. I'll try to get back to this patch soon. https://reviews.llvm.org/D26418 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D26511: [clang-tidy] Rename modernize-use-default to modernize-use-equals-default

2016-12-01 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/modernize/ModernizeTidyModule.cpp:58 "modernize-use-bool-literals"); -CheckFactories.registerCheck("modernize-use-default"); + CheckFactories.registerCheck("modernize-use-equals-default"); CheckFactories.r

[PATCH] D26511: [clang-tidy] Rename modernize-use-default to modernize-use-equals-default

2016-12-01 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/modernize/ModernizeTidyModule.cpp:58 "modernize-use-bool-literals"); -CheckFactories.registerCheck("modernize-use-default"); + CheckFactories.registerCheck("modernize-use-equals-default"); CheckFactories.r

[PATCH] D26511: [clang-tidy] Rename modernize-use-default to modernize-use-equals-default

2016-12-01 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG. Thanks! https://reviews.llvm.org/D26511 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinf

[PATCH] D27284: [ClangTidy] Add new performance-type-promotion-in-math-fn check.

2016-12-01 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added inline comments. This revision now requires changes to proceed. Comment at: clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.cpp:62-67 + Finder->addMatcher( + callExpr(callee(functionDecl(TwoDoubleA

[PATCH] D26137: [clang-tidy] Add check name to YAML export

2016-12-08 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. The patch spans two repos, so I couldn't apply it using arcanist. Just made it "manually" (patch -p0 -i ...); now running tests... Repository: rL LLVM https://reviews.llvm.org/D26137 ___ cfe-commits mailing list cfe-commi

[PATCH] D26137: [clang-tidy] Add check name to YAML export

2016-12-08 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added a comment. This revision now requires changes to proceed. Looks like compiler has found a couple of bugs: In file included from llvm.git/tools/clang/tools/extra/clang-tidy/ClangTidy.cpp:38: llvm.git/tools/clang/include/clang/Tooling/Dia

[PATCH] D26137: [clang-tidy] Add check name to YAML export

2016-12-09 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Have you run the tests? I see a number of failures: $ ninja check-clang-tools ... Failing Tests (6): Clang Tools :: clang-apply-replacements/basic.cpp Clang Tools :: clang-apply-replacements/conflict.cpp Clang Tools :: clang-apply-replacements/crlf.

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-12 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added inline comments. This revision now requires changes to proceed. Comment at: clang-tidy/cppcoreguidelines/NoMallocCheck.cpp:54 + +void NoMallocCheck::handleAquisition(const CallExpr *AquisitionCall) { + diag(AquisitionCall->

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-12 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added a comment. This revision now requires changes to proceed. One important thing is missing. Please run this check on a large enough codebase (LLVM + Clang is a good choice for testing most of kinds of checks usually) and include a summary of

[PATCH] D27700: [clang-tidy] refactor ExprSequence out of misc-use-after-move check

2016-12-13 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/utils/ExprSequence.cpp:154 +return SyntheticStmtSourceMap.lookup(S); + else +return S; nit: No `else` after return, please. https://reviews.llvm.org/D27700

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG, but please wait until Malcolm > Whats not nice is, that there is no underlining (in test neither), but i > could not find out what is wrong, > since i supply a SourceRange in the diag()-c

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Hit "submit" too early. LG, but please wait until Malcolm is happy with the change as well. Repository: rL LLVM https://reviews.llvm.org/D26167 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org

[PATCH] D27284: [ClangTidy] Add new performance-type-promotion-in-math-fn check.

2016-12-13 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG with one nit. Comment at: clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.cpp:145-153 + bool StdFnRequresCpp11 = + llvm::StringSwitch(OldFnName)

[PATCH] D22507: Clang-tidy - Enum misuse check

2016-12-13 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. LG with one nit. Feel free to ping earlier next time. Comment at: clang-tidy/misc/SuspiciousEnumUsageCheck.cpp:170-171 + if (const auto *EnumExpr = Result.Nodes.getNodeAs("enumExpr")) { +if (!StrictMode) + return; +const auto *EnumDec = Res

[PATCH] D22507: Clang-tidy - Enum misuse check

2016-12-13 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/misc/SuspiciousEnumUsageCheck.cpp:155 + +if (EnumDec->enumerator_begin() == EnumDec->enumerator_end() || +OtherEnumDec->enumerator_begin() == OtherEnumDec->enumerator_end()) szepet wrote: > alexfh w

[PATCH] D21298: [Clang-tidy] delete null check

2016-12-13 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added inline comments. This revision now requires changes to proceed. Comment at: clang-tidy/readability/DeleteNullPointerCheck.cpp:52 + + auto D = diag( + IfWithDelete->getLocStart(), Rename `D` to `Diag`,

[PATCH] D27210: [clang-tidy] misc-string-compare. Adding a new check to clang-tidy

2016-12-13 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added inline comments. This revision now requires changes to proceed. Comment at: clang-tidy/misc/StringCompareCheck.cpp:48 +diag(Matched->getLocStart(), + "do not use compare to test equality of strings; " + "

[PATCH] D27700: [clang-tidy] refactor ExprSequence out of misc-use-after-move check

2016-12-13 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/utils/ExprSequence.cpp:154 +return SyntheticStmtSourceMap.lookup(S); + else +return S; Prazek wrote: > alexfh wrote: > > nit: No `else` after return, please. > Not sure if he should change it in this p

[PATCH] D26750: [clang-tidy] Add modernize-use-default-member-init check

2016-12-13 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/modernize/UseDefaultMemberInitCheck.cpp:21 + +static StringRef getValueInit(const CXXCtorInitializer *Init) { + switch (Init->getInit()->getType()->getScalarTypeKind()) { The function name doesn't make it clea

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Jonas, do you need someone to commit the patch for you? Repository: rL LLVM https://reviews.llvm.org/D26167 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D27187: [clang-tidy] Do not move parameter if only DeclRefExpr occurs inside of a loop

2016-12-13 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG modulo comment. Comment at: clang-tidy/utils/DeclRefExprUtils.cpp:127 + match(findAll(declRefExpr(equalsNode(&DeclRef), +unless(hasAnc

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Committed in r289546. Repository: rL LLVM https://reviews.llvm.org/D26167 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D27748: [clang-tidy] Suggest including if necessary in type-promotion-in-math-fn-check.

2016-12-13 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.cpp:187 - diag(Call->getExprLoc(), "call to '%0' promotes float to double") - <<

[PATCH] D27748: [clang-tidy] Suggest including if necessary in type-promotion-in-math-fn-check.

2016-12-13 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. LG with a couple of nits. https://reviews.llvm.org/D27748 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32294: [clang-tidy] run-clang-tidy.py: check if clang-apply-replacements succeeds

2017-04-20 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added inline comments. This revision now requires changes to proceed. Comment at: clang-tidy/tool/run-clang-tidy.py:99-101 + except: +print >>sys.stderr, "Unable to run clang-apply-replacements." +sys.exit(1)

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2017-04-20 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D24892#723536, @malcolm.parsons wrote: > The `modernize-use-default-member-init` check now has an option with the same > effect, but it is called `UseAssignment`. > We should use consistent option names. > Is there any way for multiple checks

[PATCH] D32294: [clang-tidy] run-clang-tidy.py: check if clang-apply-replacements succeeds

2017-04-20 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. SGTM provided this continues to work with python 2. https://reviews.llvm.org/D32294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http:

[PATCH] D32294: [clang-tidy] run-clang-tidy.py: check if clang-apply-replacements succeeds

2017-04-20 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D32294#732986, @Prazek wrote: > In https://reviews.llvm.org/D32294#732861, @kuhar wrote: > > > After thinking about Piotr's comment, I think that a better way to perform > > the check would be te invoking clang-apply-replacements with `--versio

[PATCH] D32294: [clang-tidy] run-clang-tidy.py: check if clang-apply-replacements succeeds

2017-04-20 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/tool/run-clang-tidy.py:226 +print('Applying fixes ...') +successfully_applied = True + ` = False` here and ` = True` after `apply_fixes()` inside `try`. https://reviews.llvm.org/D32294

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2017-04-20 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D24892#732243, @malcolm.parsons wrote: > In https://reviews.llvm.org/D24892#732217, @alexfh wrote: > > > In https://reviews.llvm.org/D24892#723536, @malcolm.parsons wrote: > > > > > Is there any way for multiple checks to share an option? > > >

[PATCH] D32333: [clang-tidy] Update IdentifierNamingCheck to remove extra leading/trailing underscores

2017-04-26 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG with a nit. Comment at: clang-tidy/readability/IdentifierNamingCheck.cpp:378 + StringRef Mid = StringRef(Fixed).trim("_"); + if (Mid.size() == 0) +Mid = "_"; -

[PATCH] D32436: [clang-tidy] Support detecting for-range loop in inefficient-vector-operation check.

2017-04-26 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Cool! A few nits. Comment at: clang-tidy/performance/InefficientVectorOperationCheck.cpp:56 +ast_matchers::internal::Matcher supportedContainerTypesMatcher() { + const auto types = cxxRecordDecl(hasAnyName( + "::std::vector", "::std::set", "::std::

[PATCH] D32333: [clang-tidy] Update IdentifierNamingCheck to remove extra leading/trailing underscores

2017-04-26 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D32333#738266, @jtbandes wrote: > Done, thanks for the review! > > What is the procedure for merging patches in? I'm sure I don't have > permissions to do it myself. I'll commit the patch for you. Thank you for working on this! https://rev

[PATCH] D32436: [clang-tidy] Support detecting for-range loop in inefficient-vector-operation check.

2017-04-26 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG Comment at: clang-tidy/performance/InefficientVectorOperationCheck.cpp:152 + + const Stmt * LoopStmt = nullptr; + if (ForLoop) hokein wrote: > alexfh wr

[PATCH] D32333: [clang-tidy] Update IdentifierNamingCheck to remove extra leading/trailing underscores

2017-04-26 Thread Alexander Kornienko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL301431: [clang-tidy] Update IdentifierNamingCheck to remove extra leading/trailing… (authored by alexfh). Changed prior to commit: https://reviews.llvm.org/D32333?vs=96762&id=96771#toc Repository: rL

[PATCH] D32395: [clang-tidy] modernize-use-emplace: remove unnecessary make_pair calls

2017-04-28 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. LG https://reviews.llvm.org/D32395 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32678: [clang-tidy] Fix naming convention in modernize-use-emplace

2017-04-30 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. LG https://reviews.llvm.org/D32678 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32767: [clang-tidy] Fix PR32896: detect initializer lists in modernize-use-empalce

2017-05-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Thank you! One comment inline. Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:23 +AST_MATCHER(CXXStdInitializerListExpr, cxxStdInitializerListExpr) { + return true; This should be a node matcher rather than a narrowing matcher,

[PATCH] D32810: Add cxxStdInitializerListExpr AST matcher

2017-05-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Please add a test. Repository: rL LLVM https://reviews.llvm.org/D32810 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32810: Add cxxStdInitializerListExpr AST matcher

2017-05-05 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. LG Repository: rL LLVM https://reviews.llvm.org/D32810 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32767: [clang-tidy] Fix PR32896: detect initializer lists in modernize-use-empalce

2017-05-05 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. LG Repository: rL LLVM https://reviews.llvm.org/D32767 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32815: [clang-tidy][CMake] Make clang-tidy usable as distribution component

2017-05-05 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. I'm not sure I understand all implications, but from a cursory glance this seems reasonable. Repository: rL LLVM https://reviews.llvm.org/D32815

[PATCH] D32743: [clang-tidy] Add new cert-dcl21-cpp check.

2017-05-05 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/cert/PostfixOperatorCheck.cpp:27 +hasOverloadedOperatorName("--"))) + .bind("decl"), + this); JonasToth wrote: > could the `,t

<    6   7   8   9   10   11   12   >