[PATCH] D29726: [Clang-tidy] Fix for bug 31838: readability-delete-null-pointer does not work for class members

2017-02-08 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:46 + DeleteExpr, DeleteMemberExpr, + compoundStmt(anyOf(has(Delete

[PATCH] D29262: Fixes to modernize-use-using

2017-02-09 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 few comments. Comment at: clang-tidy/modernize/UseUsingCheck.h:24 class UseUsingCheck : public ClangTidyCheck { + public: nit: empty line =

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

2017-02-09 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Please mark all addressed comments "Done". Comment at: clang-tidy/modernize/ReturnBracedInitListCheck.cpp:60 + // Make sure that the return type matches the constructed type. + const QualType returnType = + MatchedFunctionDecl->getReturnType().get

[PATCH] D29661: [clang-tidy] Add -quiet option to suppress extra output

2017-02-09 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 comment. Comment at: clang-tidy/tool/ClangTidyMain.cpp:194 +printing statistics about ignored warnings, +check profile data and warnings treated as +errors if the

[PATCH] D29726: [Clang-tidy] Fix for bug 31838: readability-delete-null-pointer does not work for class members

2017-02-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: test/clang-tidy/readability-delete-null-pointer.cpp:67 + // CHECK-MESSAGES: :[[@LINE-2]]:7: warning: 'if' statement is unnecessary; deleting n

[PATCH] D34674: [clang-tidy] Handle new array expressions in modernize-make-unique check.

2017-06-27 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/D34674 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[PATCH] D34771: [clang-tidy] follow-up on misc-definitions-in-header check.

2017-06-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 https://reviews.llvm.org/D34771 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[PATCH] D34440: [Clang] Expand response files before loading compilation database

2017-06-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. Please re-upload the patch with full context (see http://llvm.org/docs/Phabricator.html). Comment at: lib/Tooling/CommonOptionsParser.cpp:119 cl::HideUnrelatedO

[PATCH] D34404: [Clang-Tidy] Preserve Message, FileOffset, FilePath in Clang-Tidy YAML output

2017-06-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. Please upload a diff with full context (http://llvm.org/docs/Phabricator.html). Comment at: include/clang/Tooling/DiagnosticsYaml.h:86-95 -std::vector Diagnosti

[PATCH] D34206: [clang-tidy] Add "MakeSmartPtrFunction" option to modernize-make-shared/unique checks.

2017-06-30 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/modernize/MakeSmartPtrCheck.h:28 MakeSmartPtrCheck(StringRef Name, ClangTidyContext *Context, -std::string makeSma

[PATCH] D34404: [Clang-Tidy] Preserve Message, FileOffset, FilePath in Clang-Tidy YAML output

2017-07-05 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: unittests/Tooling/DiagnosticsYamlTest.cpp:51 + + ASSERT_STREQ("---\n" +"MainSourceFile: path/to/source.cpp\n" EXPECT_STREQ is

[PATCH] D34206: [clang-tidy] Add "MakeSmartPtrFunction" option to modernize-make-shared/unique checks.

2017-07-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. LG with a couple of nits. Comment at: test/clang-tidy/modernize-make-shared-header.cpp:9 +// RUN: -- -std=c++11 \ +// RUN: -I%S/Inputs/modernize-smart-ptr + -

[PATCH] D33844: terminating continue check

2017-07-05 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Please don't forget to add cfe-commits to `Subscribers:` when initially sending the patch for review. Otherwise nobody on the list will see it. Could you run the check on LLVM+Clang and post a summary of your findings here? https://reviews.llvm.org/D33844 ___

[PATCH] D34404: [Clang-Tidy] Preserve Message, FileOffset, FilePath in Clang-Tidy YAML output

2017-07-05 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: unittests/clang-apply-replacements/ApplyReplacementsTest.cpp:23 + SmallVector EmptyNotes; + return tooling::Diagnostic(DiagnosticName, Message, Replacements, EmptyNotes, + tooling::Diagnostic::Warning, BuildD

[PATCH] D34913: [clang-tidy] Add a new Android check "android-cloexec-socket"

2017-07-05 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added inline comments. Comment at: test/clang-tidy/android-cloexec-socket.cpp:20 + // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: 'socket' should use SOCK_CLOEXEC where possible [android-cloexec-socket] + // CHECK-FIXES: SOCK_STR

[PATCH] D34404: [Clang-Tidy] Preserve Message, FileOffset, FilePath in Clang-Tidy YAML output

2017-07-05 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. A few more nits. Comment at: unittests/Tooling/DiagnosticsYamlTest.cpp:39 + + StringMap Fix1{ +{ "path/to/source.cpp", Replacements(Replacement("path/to/source.cpp", 100, The assignment form of initialization is clearer for containe

[PATCH] D31326: Add option to export fixes to run-clang-tidy.py

2017-07-05 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: run-clang-tidy.py:49 +import yaml +import glob Please sort the imports Comment at: run-clang-tidy.py:99 +

[PATCH] D34440: [Clang] Expand response files before loading compilation database

2017-07-05 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/Tooling/CommonOptionsParser.cpp:120 + + // Expand response files before loading compilation database from command line + SmallVector newArg

[PATCH] D35078: [clang-tidy] Fix modernize-use-override incorrect replacement

2017-07-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. Looks good with a nit. Thank you for the fix! Comment at: clang-tidy/modernize/UseOverrideCheck.cpp:43 while (!RawLexer.LexFromRawLexer(Tok)) { -if (Tok.is(tok::semi)

[PATCH] D34404: [Clang-Tidy] Preserve Message, FileOffset, FilePath in Clang-Tidy YAML output

2017-07-07 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. Looks good. Thanks! Repository: rL LLVM https://reviews.llvm.org/D34404 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.l

[PATCH] D35078: [clang-tidy] Fix modernize-use-override incorrect replacement

2017-07-07 Thread Alexander Kornienko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL307379: [clang-tidy] Fix modernize-use-override incorrect replacement (authored by alexfh). Changed prior to commit: https://reviews.llvm.org/D35078?vs=105554&id=105610#toc Repository: rL LLVM https

[PATCH] D31326: Add option to export fixes to run-clang-tidy.py

2017-07-07 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: run-clang-tidy.py:93 +def merge_replacement_files(tmpdir, fixfile): + """Merge all replacement files in a directory into a single fixf

[PATCH] D31326: Add option to export fixes to run-clang-tidy.py

2017-07-10 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. Just noticed another couple of nits, otherwise looks good. Thanks! Do you need me to commit the patch for you? Comment at: clang-tidy/tool/run-clang-tidy.py:158 +

[PATCH] D34913: [clang-tidy] Add a new Android check "android-cloexec-socket"

2017-07-10 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/utils/ASTUtils.h:24 + +/// Check whether a macro flag presents in the given argument. Only consider +/// cases of single match or match i

[PATCH] D31326: Add option to export fixes to run-clang-tidy.py

2017-07-11 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D31326#803535, @mfherbst wrote: > I do not have commit rights to the svn if that's what you're asking, but I > could send the patch to llvm-commits if that makes it easier for you. No need to send the patch to the list separately, Phabricator

[PATCH] D35230: [clang] buildFixItInsertionLine should use Hints of the same FID and LineNo

2017-07-11 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: lib/Frontend/TextDiagnostic.cpp:1109-1110 - } else { -FixItInsertionLine.clear(); -break; } Did you figure out why the old code used to give up here? Why does your code just continue? https:

[PATCH] D35225: [clang-tidy] add regression test to performance-unnecessary-value-param

2017-07-11 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: test/clang-tidy/performance-unnecessary-value-param.cpp:1 -// RUN: %check_clang_tidy %s performance-unnecessary-value-param %t +// RUN: cp %S/Inputs

[PATCH] D35194: [clang-tidy] clang-apply-replacements: Don't insert null entry

2017-07-11 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 fix! A few comments below. Comment at: clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp:291-299 const FileEntry *Entry = SM.getFi

[PATCH] D34225: [clang-format] Teach clang-format how to handle C++ coroutines

2017-07-11 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Leaving only the most likely reviewers for this code. https://reviews.llvm.org/D34225 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D34225: [clang-format] Teach clang-format how to handle C++ coroutines

2017-07-11 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. This looks good overall, btw. But please wait for Krasimir or Daniel, since they actually know this code ;] https://reviews.llvm.org/D34225 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bi

[PATCH] D33841: [clang-tidy] redundant keyword check

2017-07-11 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: docs/clang-tidy/checks/readability-redundant-keyword.rst:8 + +`extern` is redundant in function declarations + xazax.hun wrote: > alexfh wrote: > > Could you explain, why you think `extern` is redundant in function > > d

[PATCH] D35051: [clang-tidy] Add misc-undefined-memory-manipulation check.

2017-07-11 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. As usual, please run the check at least on LLVM+Clang and include a brief summary of results into the description of the patch. https://reviews.llvm.org/D35051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://l

[PATCH] D35051: [clang-tidy] Add misc-undefined-memory-manipulation check.

2017-07-11 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Another thing is that at this point I'd already create a `bugprone` module (if nobody has a better name) and place the check there (together with the other memset-related check). https://reviews.llvm.org/D35051 ___ cfe-comm

[PATCH] D34913: [clang-tidy] Add a new Android check "android-cloexec-socket"

2017-07-11 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/utils/ASTUtils.h:24 + +/// Check whether a macro flag is present in the given argument. Only consider +/// cases of single match or match

[PATCH] D34404: [Clang-Tidy] Preserve Message, FileOffset, FilePath in Clang-Tidy YAML output

2017-07-12 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. I tried landing the patch for you, but it doesn't apply cleanly. One reason is that it contains changes to both cfe and clang-tools-extra repos. But even when I apply the patch to the two directories it breaks a bunch of clang-apply-replacements tests: Failing Tests (

[PATCH] D31805: [clang-tidy] Mention "add the check to release note" in add_new_check.py.

2017-07-12 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D31805#721433, @Eugene.Zelenko wrote: > I don't know how hard it'll be to implement, but will be great to add > > - New ` .html>`_ check > > Please add short description here. Good idea. I

[PATCH] D31700: [clang-tidy] Ignore blank spaces between cast's ")" and its sub expr.

2017-07-12 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. You might want to commit this at some point ;] https://reviews.llvm.org/D31700 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D35225: [clang-tidy] add regression test to performance-unnecessary-value-param

2017-07-12 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/D35225 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinf

[PATCH] D34913: [clang-tidy] Add a new Android check "android-cloexec-socket"

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

[PATCH] D35230: [clang] buildFixItInsertionLine should use Hints of the same FID and LineNo

2017-07-12 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/D35230 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/

[PATCH] D35051: [clang-tidy] Add bugprone-undefined-memory-manipulation check.

2017-07-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/bugprone/UndefinedMemoryManipulationCheck.cpp:22 +AST_MATCHER(CXXRecordDecl, isNotTriviallyCopyable) { + return !(Node.isTriviallyCopyab

[PATCH] D32700: [clang-tidy] Add bugprone-suspicious-memset-usage check.

2017-07-12 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/bugprone/SuspiciousMemsetUsageCheck.cpp:127-130 +SourceRange LHSRange = FillChar->getSourceRange(); +SourceRange RHSRange = ByteCount->getSourceRange(); +StringRef RHSString = getAsString(Result, RHSRange); +Str

[PATCH] D35051: [clang-tidy] Add bugprone-undefined-memory-manipulation check.

2017-07-12 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/bugprone/UndefinedMemoryManipulationCheck.cpp:39 + // Check whether source object is not TriviallyCopyable. + // Only applicable to memcpy() and m

[PATCH] D31700: [clang-tidy] Ignore blank spaces between cast's ")" and its sub expr.

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

[PATCH] D34404: [Clang-Tidy] Preserve Message, FileOffset, FilePath in Clang-Tidy YAML output

2017-07-14 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: unittests/Tooling/DiagnosticsYamlTest.cpp:35-45 +TEST(DiagnosticsYamlTest, serializesDiagnostics) { + TranslationUnitDiagnostics TUD; + TUD.MainSourceFile = "path/to/source.cpp"; + + StringMap Fix1 = { +{ + "path/to/source.c

[PATCH] D34404: [Clang-Tidy] Preserve Message, FileOffset, FilePath in Clang-Tidy YAML output

2017-07-14 Thread Alexander Kornienko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL308014: [Clang-Tidy] Preserve Message, FileOffset, FilePath in Clang-Tidy YAML output (authored by alexfh). Changed prior to commit: https://reviews.llvm.org/D34404?vs=106402&id=106608#toc Repository:

[PATCH] D35349: [Clang-Tidy] Preserve Message, FileOffset, FilePath in Clang-Tidy YAML output

2017-07-14 Thread Alexander Kornienko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL308015: [Clang-Tidy] Preserve Message, FileOffset, FilePath in Clang-Tidy YAML output (authored by alexfh). Changed prior to commit: https://reviews.llvm.org/D35349?vs=106406&id=106609#toc Repository:

[PATCH] D32700: [clang-tidy] Add bugprone-suspicious-memset-usage check.

2017-07-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. Looks good with a single comment. Thank you for working on this! Comment at: clang-tidy/bugprone/SuspiciousMemsetUsageCheck.cpp:74-75 + + // Case 2: fill_char of memset() i

[PATCH] D34440: [Clang] Expand response files before loading compilation database

2017-07-14 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D34440#808156, @vladimir.plyashkun wrote: > **To discuss:** > ... > By this moment, we unable to use //CompilationDatabase.json// from //CLion > //side which is widely used in //Clang-Tidy// and in other common tools. It would be interestin

[PATCH] D34440: [Clang] Expand response files before loading compilation database

2017-07-14 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D34440#809522, @klimek wrote: > In https://reviews.llvm.org/D34440#809325, @vladimir.plyashkun wrote: > > > Even if i'll change content of //arguments.rsp// to > > `-std=c++11 -Ipath/to/include -Ipath/to/include2 -DMACRO ` > > and will try

[PATCH] D34654: Allow passing a regex for headers to exclude from clang-tidy

2017-07-14 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Please regenerate the patch with full context (e.g. as described in llvm.org/docs/Phabricator.html). Repository: rL LLVM https://reviews.llvm.org/D34654 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists

[PATCH] D35372: [clang-tidy] Add a close-on-exec check on memfd_create() in Android module.

2017-07-15 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. I have deja vu ;) Should we make a single check for all CLOEXEC and friends with a single configurable list of (function name, flag name) pairs? https://reviews.llvm.org/D35372 ___ cfe-commits mailing list cfe-commits@lists

[PATCH] D35370: [clang-tidy] Add a close-on-exec check on inotify_init() in Android module.

2017-07-15 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. See the comment on https://reviews.llvm.org/D35372. https://reviews.llvm.org/D35370 ___ cfe-commits mailing list cfe-commits@lists.llvm

[PATCH] D35367: [clang-tidy] Add a close-on-exec check on epoll_create() in Android module.

2017-07-15 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. See the comment on https://reviews.llvm.org/D35372. https://reviews.llvm.org/D35367 ___ cfe-commits mailing list cfe-commits@lists.llvm

[PATCH] D35368: [clang-tidy] Add a close-on-exec check on inotify_init1() in Android module.

2017-07-15 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. See the comment on https://reviews.llvm.org/D35372. https://reviews.llvm.org/D35368 ___ cfe-commits mailing list cfe-commits@lists.llvm

[PATCH] D35365: [clang-tidy] Add a close-on-exec check on epoll_create1() in Android module.

2017-07-15 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. See the comment on https://reviews.llvm.org/D35372. https://reviews.llvm.org/D35365 ___ cfe-commits mailing list cfe-commits@lists.llvm

[PATCH] D35364: [clang-tidy] Add a close-on-exec check on dup() in Android module.

2017-07-15 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. See the comment on https://reviews.llvm.org/D35372. Repository: rL LLVM https://reviews.llvm.org/D35364 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D35363: [clang-tidy] Add a close-on-exec check on accept4() in Android module.

2017-07-15 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. See the comment on https://reviews.llvm.org/D35372. Repository: rL LLVM https://reviews.llvm.org/D35363 ___ cfe-commits mailing list

[PATCH] D35362: [clang-tidy] Add a close-on-exec check on accept() in Android module.

2017-07-15 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. See the comment on https://reviews.llvm.org/D35372. Repository: rL LLVM https://reviews.llvm.org/D35362 ___ cfe-commits mailing list

[PATCH] D35372: [clang-tidy] Add a close-on-exec check on memfd_create() in Android module.

2017-07-15 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D35372#810457, @alexfh wrote: > I have deja vu ;) > > Should we make a single check for all CLOEXEC and friends with a single > configurable list of (function name, flag name) pairs? Okay, it may be a bit more complicated than just a list of

[PATCH] D34654: Allow passing a regex for headers to exclude from clang-tidy

2017-07-20 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. I wonder whether anyone uses file patterns that need anything from regular expressions beyond `|` and `.*`. If not, globs (as used in -checks=) would be a better solution. One problem with a header-filter + exclude-header-filter is that it doesn't make it easier to expr

[PATCH] D34654: Allow passing a regex for headers to exclude from clang-tidy

2017-07-20 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. > In our project we want to do something like include src/.*.h but exclude > src/some-thirdparty/.*.h. There are at least two other possibilities to handle this use case. The first one is to extend the way clang-tidy handles per-directory configs. Currently, for each tr

[PATCH] D35051: [clang-tidy] Add bugprone-undefined-memory-manipulation check.

2017-07-20 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. FYI, bugprone-undefined-memory-manipulation crashes on some of our code. I guess, this happens with dependent types, but I don't have an isolated repro yet. Repository: rL LLVM https://reviews.llvm.org/D35051 ___ cfe-com

[PATCH] D35051: [clang-tidy] Add bugprone-undefined-memory-manipulation check.

2017-07-20 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. The top of stack trace is: clang::CXXRecordDecl::isTriviallyCopyable() (unknown) clang::tidy::bugprone::(anonymous namespace)::internal::matcher_isNotTriviallyCopyableMatcher::matches() Repository: rL LLVM https://reviews.llvm.org/D35051

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

2017-07-20 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. In https://reviews.llvm.org/D24892#733016, @alexfh wrote: > In https://reviews.llvm.org/D24892#732243, @malcolm.parsons wrote: > > > In https://reviews.llvm.org/D24892#732217, @alexfh

[PATCH] D31326: Add option to export fixes to run-clang-tidy.py

2017-07-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:96-98 + # Clang-tidy < 4.0.0 uses "Replacements" as a key to the list + # of replacements. Clang-tidy >= 4.0.0 u

[PATCH] D31326: Add option to export fixes to run-clang-tidy.py

2017-07-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. I'll commit the patch for you https://reviews.llvm.org/D31326 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/c

[PATCH] D31326: Add option to export fixes to run-clang-tidy.py

2017-07-21 Thread Alexander Kornienko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL308726: [clang-tidy] Add option to export fixes to run-clang-tidy.py (authored by alexfh). Changed prior to commit: https://reviews.llvm.org/D31326?vs=107633&id=107650#toc Repository: rL LLVM https:

[PATCH] D31326: Add option to export fixes to run-clang-tidy.py

2017-07-21 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Committed as r308726. Thank you for the contribution! One note for the future: the patch doesn't contain repository-based paths, so I had to apply it manually. There's a good documentation at http://llvm.org/docs/Phabricator.html, which you could follow to create the p

[PATCH] D35718: [clang-tidy] Do not issue fixit for explicit template specializations

2017-07-21 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: test/clang-tidy/performance-unnecessary-value-param.cpp:358 +void templateFunction(ExpensiveToCopyType E) { + // CHECK-MESSAGES: [[@LINE-1]]:64: wa

[PATCH] D35718: [clang-tidy] Do not issue fixit for explicit template specializations

2017-07-23 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/D35718 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinf

[PATCH] D35790: [clang-tidy] Handle incomplete types in bugprone-undefined-memory-manipulation check.

2017-07-24 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/D35790 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/

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

2017-07-24 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/cppcoreguidelines/ProTypeMemberInitCheck.h:68 bool IgnoreArrays; + // Whether fix-its for initializers of fundamental ty

[PATCH] D35787: [clang-tidy] Ignore vector in inefficient-vector-operation.

2017-07-24 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Should we look at whether the size is statically known? https://reviews.llvm.org/D35787 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D35787: [clang-tidy] Ignore vector in inefficient-vector-operation.

2017-07-24 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D35787#819007, @alexfh wrote: > Should we look at whether the size is statically known? (and small enough) https://reviews.llvm.org/D35787 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D35194: [clang-tidy] clang-apply-replacements: Don't insert null entry

2017-07-25 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. Do you need someone to commit the patch for you? https://reviews.llvm.org/D35194 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[PATCH] D35941: Fix -Wshadow false positives with function-local classes.

2017-07-27 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh created this revision. Fixes http://llvm.org/PR33947. https://godbolt.org/g/54XRMT void f(int a) { struct A { void g(int a) {} A() { int a; } }; } 3 : :3:16: warning: declaration shadows a local variable [-Wshadow] void g(int a) {} ^ 1 : :1:12: note: previo

[PATCH] D35932: [clang-tidy] Add integer division check

2017-07-27 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: docs/clang-tidy/checks/bugprone-integer-division.rst:21-24 + // Do not warn, there are signs of deliberateness. + sin(abs(3) / 5); + sin(1 + abs(1 + 7 / 2)); + 1 << 2 / 3; I'd argue that the presence of `abs` here doe

[PATCH] D35932: [clang-tidy] Add integer division check

2017-07-27 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. Could you run the check over LLVM+Clang code and post a summary of results here? https://reviews.llvm.org/D35932 ___ cfe-commits mailin

[PATCH] D35941: Fix -Wshadow false positives with function-local classes.

2017-07-27 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D35941#823020, @rnk wrote: > I'm not really sure this is a bug. The point of -Wshadow is to warn on valid > but possibly confusing code. Shadowing a variable is perfectly legal, but > people think it's confusing, so we implemented this warning

[PATCH] D41708: [clang-tidy] Update fuchsia-overloaded-operator to check for valid loc

2018-01-17 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D41708#977000, @hans wrote: > Alex, do you think the fix is still OK for the 6.0 branch? Let me know, and > I'll merge it. Yes, please. Thank you! Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41708

[PATCH] D41720: [clang-tidy] Add a -show-color flag.

2018-01-31 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/ClangTidyOptions.h:93 + /// \brief Show color diagnostics. + llvm::Optional ShowColor; + itessier wrote: > alexfh wrote: > > This doesn't belong to ClangTidyOptions. It's specific to the CLI, but CLI > > is

[PATCH] D41720: [clang-tidy] Add a -show-color flag.

2018-01-31 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: test/clang-tidy/show-color.cpp:7 + int *value = 0; + // CHECK-COLOR: [[BOLD:.\[1m]]{{.*}}[[@LINE+2]]:10: [[RESET:.\[0m]][[MAGENTA:.\[0;1;35m]]warning: [[RESET]][[BOLD]]Dereference of null pointer (loaded from variable 'value') [clang

[PATCH] D42730: Add clang-tidy check for use of types/classes/functions from functional.h which are deprecated and removed in C++17

2018-01-31 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Thank you for this new check! A few minor comments (mostly style issues). Comment at: clang-tidy/modernize/AvoidFunctionalCheck.cpp:37 +void AvoidFunctionalCheck::check(const MatchFinder::MatchResult &Result) { + if (const auto* const un_or_binary_deriv

[PATCH] D42682: [clang-tidy] Add misc-io-functions-misused checker

2018-01-31 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/IoFunctionsMisusedCheck.cpp:33 + has(cxxMemberCallExpr( + on(hasType(namedDecl(matchesName("istream"))

[PATCH] D42730: Add clang-tidy check for use of types/classes/functions from header which are deprecated and removed in C++17

2018-01-31 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/modernize/AvoidFunctionalCheck.h:19 + +/// Check for several deprecated types and classes from header +/// aaron.ballman wrote: > massberg wrote: > > massberg wrote: > > > aaron.ballman wrote: > > > > Missing

[PATCH] D42730: Add clang-tidy check for use of types/classes/functions from header which are deprecated and removed in C++17

2018-01-31 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/modernize/AvoidFunctionalCheck.h:19 + +/// Check for several deprecated types and classes from header +/// alexfh wrote: > aaron.ballman wrote: > > massberg wrote: > > > massberg wrote: > > > > aaron.ballman w

[PATCH] D42730: Add clang-tidy check for use of types/classes/functions from header which are deprecated and removed in C++17

2018-01-31 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: test/clang-tidy/modernize-avoid-functional.cpp:30 + +// CHECK-MESSAGES: [[@LINE+1]]:25: warning: 'binary_function' is deprecated in C++11 and removed in C++17 [modernize-avoid-functional] +class BinaryTestClass : public std::binary_funct

[PATCH] D42730: [clang-tidy]] Add check for use of types/classes/functions from header which are deprecated and removed in C++17

2018-01-31 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/modernize/AvoidFunctionalCheck.h:19 + +/// Check for several deprecated types and classes from header +/// Quuxplusone wrote: > aaron.ballman wrote: > > alexfh wrote: > > > alexfh wrote: > > > > aaron.ballman

[PATCH] D42623: [clang-tidy] Add a Lexer util to get the source text of a statement

2018-01-31 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/utils/LexerUtils.h:26 +/// Get source code text for statement. +Optional getStmtText(const Stmt* Statement, const SourceManager& SM); +

[PATCH] D42730: [clang-tidy]] Add check for use of types/classes/functions from header which are deprecated and removed in C++17

2018-01-31 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/modernize/AvoidFunctionalCheck.h:19 + +/// Check for several deprecated types and classes from header +/// aaron.ballman wrote: > alexfh wrote: > > Quuxplusone wrote: > > > aaron.ballman wrote: > > > > alexfh

[PATCH] D42730: [clang-tidy]] Add check for use of types/classes/functions from header which are deprecated and removed in C++17

2018-02-02 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/modernize/AvoidFunctionalCheck.cpp:22 + Finder->addMatcher( + cxxRecordDecl(allOf(anyOf(isDerivedFrom("std::binary_function"), +isDerivedFrom("std::unary_function")), aaron

[PATCH] D41655: [clang-tidy] New check bugprone-unused-return-value

2018-02-02 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/bugprone/UnusedReturnValueCheck.cpp:36 + Node.printQualifiedName(OS, Policy); + return llvm::Regex(RegExp).match(OS.str()); +} Can we avoid creating the regex on each match? For example, by changing the para

[PATCH] D41655: [clang-tidy] New check bugprone-unused-return-value

2018-02-02 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/bugprone/UnusedReturnValueCheck.cpp:45-48 +"^::std::async$|" +"^::std::launder$|" +"^::std::remove$|" +"^::std::rem

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

2017-02-10 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. What's your use case? Can it be addressed by just forwarding the -p flag to clang-tidy? The script shouldn't know anything about implementation details of the compilation database b

[PATCH] D29726: [Clang-tidy] Fix for bug 31838: readability-delete-null-pointer does not work for class members

2017-02-12 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/D29726 ___ 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-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. A couple of comments. Comment at: clang-tidy/modernize/ReturnBracedInitListCheck.cpp:35 + + auto HasConstructExpr = has(ConstructExpr); + Nit: I s

[PATCH] D29839: [clang-tidy] New misc-istream-overflow check

2017-02-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. In https://reviews.llvm.org/D29839#674517, @aaron.ballman wrote: > In https://reviews.llvm.org/D29839#674301, @xazax.hun wrote: > > > Shouldn't this be a path sensitive check within t

[PATCH] D19586: Misleading Indentation check

2017-02-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/MisleadingIndentationCheck.cpp:72 +SM.getExpansionColumnNumber(NextLoc)) + diag(NextLoc, "misleading indentation

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

2017-02-14 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/DefinitionsInHeadersCheck.cpp:131-135 +if (FD->getTemplateSpecializationKind() != TSK_Undeclared) + diag(FD->getLocation(),

<    5   6   7   8   9   10   11   12   >