Re: [PATCH] D17387: Add check for CERT FLP30-C

2016-02-19 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. LG Comment at: test/clang-tidy/cert-flp30-c.c:6 @@ +5,3 @@ +void func(void) { + // CHECK-MESSAGES: :[[@LINE+1]]:37: warning: loop induction expression should not have floating-point type [cert-flp30-c] + for (float x = 0.1f; x <= 1.0f; x += 0.1f) { ---

Re: [PATCH] D17434: [Clang-tidy] Make readability-container-size-empty working with STL string

2016-02-19 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. In http://reviews.llvm.org/D17434#356765, @dblaikie wrote: > should probably have test coverage +1 Repository: rL LLVM http://reviews.llvm.org/D17434 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.

Re: [PATCH] D17335: [clang-tidy] Fix a crash issue when clang-tidy runs with compilation database.

2016-02-19 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/ClangTidy.cpp:115 @@ +114,3 @@ +// +// Specify the build directory of the source file as current working +// directroy to find source file correctly. Maybe `Change the directory to the one used durin

[clang-tools-extra] r261431 - [clang-tidy] Describe modules, link to LLVM development docs, other minor updates

2016-02-20 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Sat Feb 20 05:42:13 2016 New Revision: 261431 URL: http://llvm.org/viewvc/llvm-project?rev=261431&view=rev Log: [clang-tidy] Describe modules, link to LLVM development docs, other minor updates Modified: clang-tools-extra/trunk/docs/clang-tidy/index.rst Modified: clang-

Re: [PATCH] D17335: [clang-tidy] Fix a crash issue when clang-tidy runs with compilation database.

2016-02-22 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/ClangTidyDiagnosticConsumer.cpp:120 @@ +119,3 @@ + bool IsWarningAsError, + const std::string &BuildDirectory) +: BuildDirectory(std::move(BuildDirectory)), CheckNa

Re: [PATCH] D17488: Extend UnnecessaryCopyInitialization check to trigger on non-const copies that can be safely converted to const references.

2016-02-22 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/performance/UnnecessaryCopyInitialization.cpp:69 @@ +68,3 @@ + : "the variable '%0' is copy-constructed from a const reference " + "but " + "is only used as const reference; conside

Re: [PATCH] D17491: Add performance check to flag function parameters of expensive to copy types that can be safely converted to const references.

2016-02-22 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/performance/UnnecessaryValueParamCheck.cpp:41 @@ +40,3 @@ + Function->parameters().begin(); + if (Index >= Function->getNumParams()) { +return; Please add a comment about when this hap

Re: [PATCH] D17163: [ASTMatchers] Add matcher hasAnyName.

2016-02-22 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. Looks good. Thanks! (I suppose, Manuel has no substantial comments on this, since he has already seen the patch). http://reviews.llvm.org/D17163 __

Re: [PATCH] D17484: [clang-tidy] introduce modernize-deprecated-headers check

2016-02-22 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. Thank you for this check! Mostly looks good, but there are a number of style nits. The most important question to this check is that the standard doesn't guarantee that the C++ headers declare all the same functions **in the global namespace** (at least, this is how I u

Re: [PATCH] D17484: [clang-tidy] introduce modernize-deprecated-headers check

2016-02-22 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. In http://reviews.llvm.org/D17484#358617, @alexfh wrote: > ... the check in its current form can break the code that uses library > symbols from the global namespace. ... An action item for this is: document this possible issue and add a FIXME somewhere in the code to

Re: [PATCH] D17335: [clang-tidy] Fix a crash issue when clang-tidy runs with compilation database.

2016-02-22 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. In http://reviews.llvm.org/D17335#358613, @hokein wrote: > - Don't save BuildDirectory for every error in each check. I think, it's not going to work with multiple files. There's just one Stats instance. Comment at: test/clang-tidy/clang-tidy-run-with

Re: [PATCH] D17484: [clang-tidy] introduce modernize-deprecated-headers check

2016-02-22 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/modernize/DeprecatedHeadersCheck.cpp:78 @@ +77,3 @@ + if (LangOpts.CPlusPlus11) { +std::vector> Cxx11DeprecatedHeaders = { +{"fenv.h", "cfenv"}, This can be done without STL algorithms and lambdas:

[clang-tools-extra] r261622 - [clang-tidy] Updated docs on testing clang-tidy checks.

2016-02-23 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Tue Feb 23 03:30:20 2016 New Revision: 261622 URL: http://llvm.org/viewvc/llvm-project?rev=261622&view=rev Log: [clang-tidy] Updated docs on testing clang-tidy checks. Modified: clang-tools-extra/trunk/docs/clang-tidy/index.rst Modified: clang-tools-extra/trunk/docs/clan

r261625 - Print options, if requested.

2016-02-23 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Tue Feb 23 04:29:02 2016 New Revision: 261625 URL: http://llvm.org/viewvc/llvm-project?rev=261625&view=rev Log: Print options, if requested. Modified: cfe/trunk/lib/Tooling/CommonOptionsParser.cpp Modified: cfe/trunk/lib/Tooling/CommonOptionsParser.cpp URL: http://llvm.

r261626 - Fix a -Wunused-variable diagnostic.

2016-02-23 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Tue Feb 23 04:29:04 2016 New Revision: 261626 URL: http://llvm.org/viewvc/llvm-project?rev=261626&view=rev Log: Fix a -Wunused-variable diagnostic. Modified: cfe/trunk/lib/ASTMatchers/ASTMatchersInternal.cpp Modified: cfe/trunk/lib/ASTMatchers/ASTMatchersInternal.cpp URL

Re: [PATCH] D17484: [clang-tidy] introduce modernize-deprecated-headers check

2016-02-23 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. Looks good with one nit. Let me know if you need me to commit the patch for you. Comment at: clang-tidy/modernize/DeprecatedHeadersCheck.cpp:99 @@ +98,3 @@ +std::string R

Re: [PATCH] D17244: [clang-tidy] readability-ternary-operator new check

2016-02-23 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/readability/BracesAroundStatementsCheck.cpp:16 @@ -15,2 +15,3 @@ using namespace clang::ast_matchers; +using namespace clang::tidy::lexer_utils; This file only needs one function from this namespace, so it's

r261642 - Allow running dump_format_style.py from any directory.

2016-02-23 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Tue Feb 23 10:11:43 2016 New Revision: 261642 URL: http://llvm.org/viewvc/llvm-project?rev=261642&view=rev Log: Allow running dump_format_style.py from any directory. Modified: cfe/trunk/docs/tools/dump_format_style.py Modified: cfe/trunk/docs/tools/dump_format_style.py

r261643 - Update clang-format options docs.

2016-02-23 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Tue Feb 23 10:11:51 2016 New Revision: 261643 URL: http://llvm.org/viewvc/llvm-project?rev=261643&view=rev Log: Update clang-format options docs. Modified: cfe/trunk/docs/ClangFormatStyleOptions.rst Modified: cfe/trunk/docs/ClangFormatStyleOptions.rst URL: http://llvm.o

r261644 - Support language selection for \code blocks.

2016-02-23 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Tue Feb 23 10:11:55 2016 New Revision: 261644 URL: http://llvm.org/viewvc/llvm-project?rev=261644&view=rev Log: Support language selection for \code blocks. Modified: cfe/trunk/docs/tools/dump_format_style.py Modified: cfe/trunk/docs/tools/dump_format_style.py URL: http

r261645 - Clean up clang-format options documentation. NFC

2016-02-23 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Tue Feb 23 10:12:00 2016 New Revision: 261645 URL: http://llvm.org/viewvc/llvm-project?rev=261645&view=rev Log: Clean up clang-format options documentation. NFC Use uniform style for inline code blocks, specify language for YAML code blocks, various formatting fixes etc. Mod

r261646 - Fix a typo. NFC

2016-02-23 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Tue Feb 23 10:12:08 2016 New Revision: 261646 URL: http://llvm.org/viewvc/llvm-project?rev=261646&view=rev Log: Fix a typo. NFC Modified: cfe/trunk/docs/ClangFormatStyleOptions.rst cfe/trunk/include/clang/Format/Format.h Modified: cfe/trunk/docs/ClangFormatStyleOptio

Re: r261626 - Fix a -Wunused-variable diagnostic.

2016-02-23 Thread Alexander Kornienko via cfe-commits
On Tue, Feb 23, 2016 at 5:51 PM, David Blaikie wrote: > > > On Tue, Feb 23, 2016 at 2:29 AM, Alexander Kornienko via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> Author: alexfh >> Date: Tue Feb 23 04:29:04 2016 >> New Revision: 261626 >> &g

[clang-tools-extra] r261737 - [clang-tidy] Added a check for forward declaration in the potentially wrong namespace

2016-02-24 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Wed Feb 24 07:35:32 2016 New Revision: 261737 URL: http://llvm.org/viewvc/llvm-project?rev=261737&view=rev Log: [clang-tidy] Added a check for forward declaration in the potentially wrong namespace Adds a new check "misc-forward-declaration-namespace". In check, A forward de

[clang-tools-extra] r261738 - [clang-tidy] introduce modernize-deprecated-headers check

2016-02-24 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Wed Feb 24 07:36:34 2016 New Revision: 261738 URL: http://llvm.org/viewvc/llvm-project?rev=261738&view=rev Log: [clang-tidy] introduce modernize-deprecated-headers check Summary: This patch introduces the modernize-deprecated-headers check, which is supposed to replace depre

Re: [PATCH] D17484: [clang-tidy] introduce modernize-deprecated-headers check

2016-02-24 Thread Alexander Kornienko via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL261738: [clang-tidy] introduce modernize-deprecated-headers check (authored by alexfh). Changed prior to commit: http://reviews.llvm.org/D17484?vs=48905&id=48919#toc Repository: rL LLVM http://revie

r261744 - [docs] Change non-c++ code blocks to 'text' format to fix a sphinx warning.

2016-02-24 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Wed Feb 24 09:07:48 2016 New Revision: 261744 URL: http://llvm.org/viewvc/llvm-project?rev=261744&view=rev Log: [docs] Change non-c++ code blocks to 'text' format to fix a sphinx warning. Modified: cfe/trunk/docs/InternalsManual.rst Modified: cfe/trunk/docs/InternalsManu

Re: [clang-tools-extra] r261738 - [clang-tidy] introduce modernize-deprecated-headers check

2016-02-24 Thread Alexander Kornienko via cfe-commits
h(225): > or > 'llvm::StringMap::StringMap(unsigned > int)' > while trying to match the argument list '(initializer-list)' >Creating library lib\libclang.lib and object lib\libclang.exp > > > On Wed, Feb 24, 2016 at 8:36 AM, Alexander Kornienko via cfe

Re: [clang-tools-extra] r261738 - [clang-tidy] introduce modernize-deprecated-headers check

2016-02-24 Thread Alexander Kornienko via cfe-commits
ValueTy=std::string >> ] >> >> D:\buildslave\clang-x64-ninja-win7\llvm\include\llvm/ADT/StringMap.h(228): >> or >> 'llvm::StringMap::StringMap(AllocatorTy)' >> with >> [ >> AllocatorTy=llvm::Ma

[clang-tools-extra] r261806 - Trying to fix MSVC build

2016-02-24 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Wed Feb 24 17:48:24 2016 New Revision: 261806 URL: http://llvm.org/viewvc/llvm-project?rev=261806&view=rev Log: Trying to fix MSVC build Modified: clang-tools-extra/trunk/clang-tidy/modernize/DeprecatedHeadersCheck.cpp Modified: clang-tools-extra/trunk/clang-tidy/modern

[clang-tools-extra] r261811 - [clang-tidy] Another attempt to fix MSVC build

2016-02-24 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Wed Feb 24 18:39:11 2016 New Revision: 261811 URL: http://llvm.org/viewvc/llvm-project?rev=261811&view=rev Log: [clang-tidy] Another attempt to fix MSVC build Modified: clang-tools-extra/trunk/clang-tidy/modernize/DeprecatedHeadersCheck.cpp Modified: clang-tools-extra/t

Re: [clang-tools-extra] r261738 - [clang-tidy] introduce modernize-deprecated-headers check

2016-02-24 Thread Alexander Kornienko via cfe-commits
zer_list>)' >>> with >>> [ >>> ValueTy=std::string >>> ] >>> >>> D:\buildslave\clang-x64-ninja-win7\llvm\include\llvm/ADT/StringMap.h(228): >>> or >>> 'llvm::StringMap::Strin

Re: [PATCH] D16962: clang-tidy: avoid std::bind

2016-02-25 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/readability/AvoidStdBindCheck.cpp:37 @@ +36,3 @@ + +std::vector +buildBindArguments(const MatchFinder::MatchResult &Result, const CallExpr *C) { `SmallVector<>` would be better here, since the number of argument

Re: [PATCH] D17335: [clang-tidy] Fix a crash issue when clang-tidy runs with compilation database.

2016-02-25 Thread Alexander Kornienko via cfe-commits
alexfh requested changes to this revision. This revision now requires changes to proceed. Comment at: clang-tidy/ClangTidyDiagnosticConsumer.h:76 @@ +75,3 @@ + // Note: In unittest, it is empty. + StringRef BuildDirectory; + As discussed offline, I'd like `Clang

Re: [PATCH] D17602: [clang-tidy] update links to Google Code Style in docs

2016-02-25 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments. Comment at: docs/clang-tidy/checks/readability-named-parameter.rst:13 @@ -13,1 +12,3 @@ +https://google.github.io/styleguide/cppguide.html#Function_Declarations_and_ +Definitions omtcyf0 wrote: > hokein wrote: > > This should be in

Re: [PATCH] D17602: [clang-tidy] update links to Google Code Style in docs

2016-02-25 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments. Comment at: docs/clang-tidy/checks/readability-named-parameter.rst:13 @@ -13,2 +12,3 @@ +https://google.github.io/styleguide/cppguide.html#Function_Declarations_and_Definitions All parameters should be named, with identical names in the declaration

Re: [PATCH] D17602: [clang-tidy] update links to Google Code Style in docs

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

Re: [PATCH] D17602: [clang-tidy] update links to Google Code Style in docs

2016-02-25 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. Hajian, if you have no concerns, could you commit the patch? Thanks! http://reviews.llvm.org/D17602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D17335: [clang-tidy] Fix a crash issue when clang-tidy runs with compilation database.

2016-02-25 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments. Comment at: test/clang-tidy/clang-tidy-run-with-database.cpp:2 @@ +1,3 @@ +// REQUIRES: shell +// RUN: mkdir -p %T/compilation-database-test +// RUN: mkdir -p %T/compilation-database-test/include You don't need to create the root dire

Re: [PATCH] D17586: Add a new check, readability-redundant-string-init, that checks unnecessary string initializations.

2016-02-25 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/readability/RedundantStringInitCheck.cpp:26 @@ +25,3 @@ +void RedundantStringInitCheck::registerMatchers( +ast_matchers::MatchFinder *Finder) { + if (!getLangOpts().CPlusPlus) nit: `ast_matchers::` can be o

Re: [clang-tools-extra] r261737 - [clang-tidy] Added a check for forward declaration in the potentially wrong namespace

2016-02-25 Thread Alexander Kornienko via cfe-commits
Wed, Feb 24, 2016 at 5:35 AM, Alexander Kornienko via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> Author: alexfh >> Date: Wed Feb 24 07:35:32 2016 >> New Revision: 261737 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=261737&view=rev >

[clang-tools-extra] r261893 - [clang-tidy] Adding headers needed in modernize-deprecated-headers tests

2016-02-25 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Thu Feb 25 10:46:54 2016 New Revision: 261893 URL: http://llvm.org/viewvc/llvm-project?rev=261893&view=rev Log: [clang-tidy] Adding headers needed in modernize-deprecated-headers tests Added: clang-tools-extra/trunk/test/clang-tidy/Inputs/modernize-deprecated-headers/

Re: [clang-tools-extra] r261737 - [clang-tidy] Added a check for forward declaration in the potentially wrong namespace

2016-02-25 Thread Alexander Kornienko via cfe-commits
://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/636 >> >> -- Sean Silva >> >> On Wed, Feb 24, 2016 at 5:35 AM, Alexander Kornienko via cfe-commits < >> cfe-commits@lists.llvm.org> wrote: >> >>> Author: alex

Re: [clang-tools-extra] r261814 - check-clang-tools: Introduce the feature "target-headers".

2016-02-25 Thread Alexander Kornienko via cfe-commits
I've committed r261893 that adds stub headers and points the tool to the right search directory. If the solution works, this commit can be reverted. On Thu, Feb 25, 2016 at 2:12 AM, NAKAMURA Takumi via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: chapuni > Date: Wed Feb 24 19:12:57

Re: [PATCH] D17335: [clang-tidy] Fix a crash issue when clang-tidy runs with compilation database.

2016-02-25 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. Looks good. Thank you for fixing this! http://reviews.llvm.org/D17335 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.o

Re: [PATCH] D17586: Add a new check, readability-redundant-string-init, that checks unnecessary string initializations.

2016-02-25 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments. Comment at: test/clang-tidy/readability-redundant-string-init.cpp:69 @@ +68,3 @@ +#define M(x) x +#define N { std::string s = ""; } + Please add a CHECK-FIXES to ensure the macro definition hasn't changed and that the macro invocatio

Re: [PATCH] D17586: Add a new check, readability-redundant-string-init, that checks unnecessary string initializations.

2016-02-25 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision. alexfh added a comment. Looks good! I'll commit the patch for you. http://reviews.llvm.org/D17586 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D17586: Add a new check, readability-redundant-string-init, that checks unnecessary string initializations.

2016-02-25 Thread Alexander Kornienko via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL261939: Add a new check, readability-redundant-string-init, that checks unnecessary… (authored by alexfh). Changed prior to commit: http://reviews.llvm.org/D17586?vs=49114&id=49118#toc Repository: rL

[clang-tools-extra] r261940 - Remove a blank line at EOF. NFC

2016-02-25 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Thu Feb 25 17:57:30 2016 New Revision: 261940 URL: http://llvm.org/viewvc/llvm-project?rev=261940&view=rev Log: Remove a blank line at EOF. NFC Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/readability-redundant-string-init.rst Modified: clang-tools-extra/tr

[clang-tools-extra] r261939 - Add a new check, readability-redundant-string-init, that checks unnecessary string initializations.

2016-02-25 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Thu Feb 25 17:57:23 2016 New Revision: 261939 URL: http://llvm.org/viewvc/llvm-project?rev=261939&view=rev Log: Add a new check, readability-redundant-string-init, that checks unnecessary string initializations. Reviewers: hokein, alexfh Subscribers: cfe-commits Patch by S

[clang-tools-extra] r261998 - [clang-tidy] Minor change in the doc

2016-02-26 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Fri Feb 26 04:24:29 2016 New Revision: 261998 URL: http://llvm.org/viewvc/llvm-project?rev=261998&view=rev Log: [clang-tidy] Minor change in the doc Modified: clang-tools-extra/trunk/docs/clang-tidy/index.rst Modified: clang-tools-extra/trunk/docs/clang-tidy/index.rst UR

Re: [PATCH] D16535: [clang-tidy] Check to find unintended semicolons that changes the semantics.

2016-02-26 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. In http://reviews.llvm.org/D16535#362685, @omtcyf0 wrote: > @xazax.hun did you actually run the tool on the LLVM codebase? > > Because this check generates **tons** of false-positive reports during > codebase analysis. > > See the minimal example below. > > omtcyf0-lapt

Re: [PATCH] D16535: [clang-tidy] Check to find unintended semicolons that changes the semantics.

2016-02-26 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. Having said that, it makes sense to handle invalid AST in the check somehow (e.g. completely disable the check), so it doesn't generate spurious errors. Repository: rL LLVM http://reviews.llvm.org/D16535 ___ cfe-commits m

Re: [PATCH] D16535: [clang-tidy] Check to find unintended semicolons that changes the semantics.

2016-02-26 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. I think, the check can be submitted as is and guards against spurious errors on invalid AST can be added as a follow up. Repository: rL LLVM http://reviews.llvm.org/D16535 ___ cfe-commits mailing list cfe-commits@lists.ll

Re: [PATCH] D17640: [clang-tidy] Fix an assertion failure in `modernize-use-nullptr` check.

2016-02-26 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. Looks good! Thank you for coming up with the reduced test. Repository: rL LLVM http://reviews.llvm.org/D17640 ___ cfe-commits mailing list cfe

Re: [PATCH] D16535: [clang-tidy] Check to find unintended semicolons that changes the semantics.

2016-02-26 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. In http://reviews.llvm.org/D16535#362761, @xazax.hun wrote: > In http://reviews.llvm.org/D16535#362726, @alexfh wrote: > > > I think, the check can be submitted as is and guards against spurious > > errors on invalid AST can be added as a follow up. > > > This check is al

[clang-tools-extra] r267587 - [clang-tidy] Added misc-move-const-arg docs.

2016-04-26 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Tue Apr 26 13:48:59 2016 New Revision: 267587 URL: http://llvm.org/viewvc/llvm-project?rev=267587&view=rev Log: [clang-tidy] Added misc-move-const-arg docs. Added: clang-tools-extra/trunk/docs/clang-tidy/checks/misc-move-const-arg.rst Modified: clang-tools-extra/trunk

[clang-tools-extra] r267592 - [clang-tidy] Now adding correct misc-move-const-arg documentation ; ]

2016-04-26 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Tue Apr 26 14:33:49 2016 New Revision: 267592 URL: http://llvm.org/viewvc/llvm-project?rev=267592&view=rev Log: [clang-tidy] Now adding correct misc-move-const-arg documentation ;] + brushed the code a bit and renamed the test file to match the check name Added: clang-to

Re: [PATCH] D19583: Don't search compilation database in explain-check test.

2016-04-27 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG Repository: rL LLVM http://reviews.llvm.org/D19583 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/ma

Re: [PATCH] D19577: [clang-tidy] Enhance misc-suspicious-string-compare by matching string.compare

2016-04-27 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. I'm somewhat reluctant to add LLVM-specific checks to misc-. I would prefer either to split the LLVM-specific part to a separate check in llvm/ (which might derive from this check or somehow reuse the logic) or make the check configurable enough so that these checks can

Re: [PATCH] D19547: [clang-tidy] Add FixIt for swapping arguments in string-constructor-checker.

2016-04-27 Thread Alexander Kornienko via cfe-commits
alexfh requested changes to this revision. This revision now requires changes to proceed. Comment at: clang-tidy/misc/StringConstructorCheck.cpp:110 @@ -106,2 +109,3 @@ if (Result.Nodes.getNodeAs("swapped-parameter")) { -diag(Loc, "constructor parameters are probably swappe

Re: [PATCH] D18136: boost-use-to-string check

2016-04-27 Thread Alexander Kornienko via cfe-commits
alexfh requested changes to this revision. This revision now requires changes to proceed. Comment at: clang-tidy/boost/BoostTidyModule.cpp:26 @@ -22,3 +25,3 @@ ClangTidyOptions getModuleOptions() override { ClangTidyOptions Options; This method doesn't d

[clang-tools-extra] r267697 - clang-tidy -list-checks should exit with non-zero code when no checks are enabled.

2016-04-27 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Wed Apr 27 06:45:14 2016 New Revision: 267697 URL: http://llvm.org/viewvc/llvm-project?rev=267697&view=rev Log: clang-tidy -list-checks should exit with non-zero code when no checks are enabled. Modified: clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp Modifie

Re: [PATCH] D19586: Misleading Indentation check

2016-04-27 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. The patch is broken: Index: clang-tidy/readability/Mislead === --- /dev/null +++ clang-tidy/readability/Mislead @@ -0,0 +1,77 @@ +//===--- MisleadingIndentationCheck.cpp - clang-tidy--

Re: [PATCH] D19249: Fix include path in ClangTidy.cpp.

2016-04-27 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. Since http://reviews.llvm.org/D19393 is approved, this patch also looks fine. http://reviews.llvm.org/D19249 ___ cfe-commits mailing list cfe-com

Re: [clang-tools-extra] r267828 - clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-type-member-init-cxx98.cpp: Appease ms targets with -fno-delayed-template-parsing.

2016-04-28 Thread Alexander Kornienko via cfe-commits
Thank you for the fix! We've actually tried adding -fdelayed-template-parsing and -fms-compatibility on linux, and the test passed. Not sure why it failed on Windows. Is there any other subtle difference? On Thu, Apr 28, 2016 at 2:39 AM, NAKAMURA Takumi via cfe-commits < cfe-commits@lists.llvm.org

[PATCH] D19672: [clang-tidy] cppcoreguidelines-pro-type-member-init should not complain about static variables

2016-04-28 Thread Alexander Kornienko via cfe-commits
alexfh created this revision. alexfh added a reviewer: sbenza. alexfh added subscribers: cfe-commits, flx, michael_miller. Variables with static storage duration are zero-initialized per [stmt.dcl]p4 and [basic.start.init]p2. http://reviews.llvm.org/D19672 Files: clang-tidy/cppcoreguidelines/P

Re: [PATCH] D18136: boost-use-to-string check

2016-04-28 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. Looks good with a couple of nits. Please submit this as a single patch, there's no need to add an empty "boost" module separately. Comment at: clang-tidy/boost/UseToStringChe

Re: [PATCH] D19672: [clang-tidy] cppcoreguidelines-pro-type-member-init should not complain about static variables

2016-04-28 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp:284 @@ -283,2 +283,3 @@ varDecl(isDefinition(), HasDefaultConstructor, + hasAutomaticStorageDuration(), hasType(recordDecl(has(fieldDecl()), ---

Re: [PATCH] D19672: [clang-tidy] cppcoreguidelines-pro-type-member-init should not complain about static variables

2016-04-28 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp:284 @@ -283,2 +283,3 @@ varDecl(isDefinition(), HasDefaultConstructor, + hasAutomaticStorageDuration(), hasType(recordDecl(has(fieldDecl()), ---

[clang-tools-extra] r267933 - [clang-tidy] cppcoreguidelines-pro-type-member-init should not complain about static variables

2016-04-28 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Thu Apr 28 15:20:01 2016 New Revision: 267933 URL: http://llvm.org/viewvc/llvm-project?rev=267933&view=rev Log: [clang-tidy] cppcoreguidelines-pro-type-member-init should not complain about static variables Summary: Variables with static storage duration are zero-initialized

Re: [PATCH] D19672: [clang-tidy] cppcoreguidelines-pro-type-member-init should not complain about static variables

2016-04-28 Thread Alexander Kornienko via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL267933: [clang-tidy] cppcoreguidelines-pro-type-member-init should not complain about… (authored by alexfh). Changed prior to commit: http://reviews.llvm.org/D19672?vs=55441&id=55476#toc Repository:

Re: [PATCH] D19547: [clang-tidy] Add FixIt for swapping arguments in string-constructor-checker.

2016-04-29 Thread Alexander Kornienko via cfe-commits
alexfh requested changes to this revision. This revision now requires changes to proceed. Comment at: clang-tidy/misc/StringConstructorCheck.cpp:110 @@ -106,2 +109,3 @@ if (Result.Nodes.getNodeAs("swapped-parameter")) { -diag(Loc, "constructor parameters are probably swappe

Re: [PATCH] D19590: Check for CERT ERR34-C. Detect errors when converting a string to a number

2016-04-29 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. Looks good with a few nits. Comment at: clang-tidy/cert/StrToNumCheck.cpp:182 @@ +181,3 @@ +void StrToNumCheck::check(const MatchFinder::MatchResult &Result) { + const auto *

Re: [PATCH] D19811: [clang-tidy] Cleaning namespaces to be more consistant across checkers.

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

Re: [PATCH] D19819: [clang-tidy] Cleanup namespace in utils folder.

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

Re: [PATCH] D19841: [clang-tidy] Lift common matchers to utils namespace

2016-05-02 Thread Alexander Kornienko via cfe-commits
alexfh requested changes to this revision. This revision now requires changes to proceed. Comment at: clang-tidy/utils/Matchers.h:20 @@ -19,1 +19,3 @@ +AST_MATCHER_P(StringLiteral, lengthIs, unsigned, N) { + return Node.getLength() == N; All these should go to

Re: [PATCH] D19849: [clang-tidy] MoveConstructorInitCheck - Add parameter name to check message.

2016-05-02 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/misc/MoveConstructorInitCheck.cpp:114 @@ -114,1 +113,3 @@ + "value argument %0 can be moved to avoid copy") + << MovableParam->getName(); DiagOut << FixItHint::CreateReplacement( -

Re: [PATCH] D19841: [clang-tidy] Lift common matchers to utils namespace

2016-05-03 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. In http://reviews.llvm.org/D19841#419488, @etienneb wrote: > Who is the owner of ASTMatcher? > > If he is willing to receive these matchers in ASTMatcher, I'll lift them. > Otherwise, we should at least lift them within clang-tidy. Send a patch to sbenza or klimek. I th

Re: [PATCH] D19846: [clang-tidy] Lift parsing of sequence of names functions to utils.

2016-05-03 Thread Alexander Kornienko via cfe-commits
alexfh requested changes to this revision. This revision now requires changes to proceed. Comment at: clang-tidy/misc/SuspiciousStringCompareCheck.cpp:94 @@ +93,3 @@ + std::vector FunctionNames = utils::option::parseNames( + (llvm::Twine(KnownStringCompareFunctions) + String

Re: [PATCH] D19865: [clang-tidy] - PerformanceUnnecesaryCopyInitialization - only trigger for decl stmts with single VarDecl.

2016-05-03 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. Is it a workaround to avoid breaking the code by incorrect fixes? Repository: rL LLVM http://reviews.llvm.org/D19865 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cf

Re: [PATCH] D19849: [clang-tidy] MoveConstructorInitCheck - Add parameter name to check message.

2016-05-03 Thread Alexander Kornienko 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 http://reviews.llvm.org/D19849 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/c

Re: [PATCH] D16962: clang-tidy: avoid std::bind

2016-05-03 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. Please regenerate the patch with the full context (see http://llvm.org/docs/Phabricator.html). Comment at: clang-tidy/readability/AvoidStdBindCheck.cpp:77 @@ +76,3 @@ + for (size_t I = 1; I <= PlaceholderCount; ++I) { +Stream << Delimiter << "auto &

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-03 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. In http://reviews.llvm.org/D19871#419947, @aaron.ballman wrote: > Is this required for some purpose? > > I'm not keen on adding new AST matchers that we cannot expose via the dynamic > API, so I would prefer to solve that problem if we want to add this matcher. I agree

Re: [PATCH] D19877: [clang-tidy] Speedup misc-static-assert.

2016-05-04 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. Thank you for finding and fixing this! I think I used to suggest the wrong pattern, now I won't. Repository: rL LLVM http://reviews.llvm.org/D19877 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm

[clang-tools-extra] r268555 - [clang-tidy] Apply NOLINT filtering to Clang warnings.

2016-05-04 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Wed May 4 16:18:31 2016 New Revision: 268555 URL: http://llvm.org/viewvc/llvm-project?rev=268555&view=rev Log: [clang-tidy] Apply NOLINT filtering to Clang warnings. Modified: clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp clang-tools-extra/trunk/

[clang-tools-extra] r268579 - [clang-tidy] Improve -warnings-as-errors tests.

2016-05-04 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Wed May 4 19:09:29 2016 New Revision: 268579 URL: http://llvm.org/viewvc/llvm-project?rev=268579&view=rev Log: [clang-tidy] Improve -warnings-as-errors tests. Added: clang-tools-extra/trunk/test/clang-tidy/werrors-diagnostics.cpp Modified: clang-tools-extra/trunk/tes

Re: [PATCH] D19993: Fixed cppcoreguidelines-pro-type-member-init when checking records with indirect fields

2016-05-05 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp:31 @@ +30,3 @@ +// Convenience utility to get a RecordDecl from a QualType. +const RecordDecl *getCanonicalRecordDecl(const QualType &Type) { + if (const auto *RT = Type.getCanonical

Re: [PATCH] D19865: [clang-tidy] - PerformanceUnnecesaryCopyInitialization - only trigger for decl stmts with single VarDecl.

2016-05-06 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. In http://reviews.llvm.org/D19865#423140, @flx wrote: > In http://reviews.llvm.org/D19865#419905, @flx wrote: > > > In http://reviews.llvm.org/D19865#419830, @alexfh wrote: > > > > > Is it a workaround to avoid breaking the code by incorrect fixes? > > > > > > Yes. We can'

Re: [PATCH] D18745: [clang-tidy] Adds modernize-use-bool-literals check.

2016-05-06 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. Looks good! http://reviews.llvm.org/D18745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo

Re: [PATCH] D20052: Add new ASTMatcher that matches dynamic exception specifications.

2016-05-08 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. Please add tests, re-generate documentation and add the matcher to the dynamic matchers registry. See http://reviews.llvm.org/D19871 for an example. http://reviews.llvm.org/D20052 ___ cfe-commits mailing list cfe-commits@lis

[clang-tools-extra] r268899 - Fix docs.

2016-05-09 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Mon May 9 05:00:52 2016 New Revision: 268899 URL: http://llvm.org/viewvc/llvm-project?rev=268899&view=rev Log: Fix docs. Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/misc-unconventional-assign-operator.rst Modified: clang-tools-extra/trunk/docs/clang-tidy/

[clang-tools-extra] r268905 - Trying to fix docs.

2016-05-09 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Mon May 9 05:56:57 2016 New Revision: 268905 URL: http://llvm.org/viewvc/llvm-project?rev=268905&view=rev Log: Trying to fix docs. Modified: clang-tools-extra/trunk/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp clang-tools-extra/trunk/clang-tidy/misc/Unconve

Re: [PATCH] D19846: [clang-tidy] Lift parsing of sequence of names functions to utils.

2016-05-10 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. Looks good with one nit. Thank you! Comment at: clang-tidy/utils/OptionsUtils.h:21 @@ +20,3 @@ +/// \brief Parse a semicolon separated list of strings. +std::vector parseStrin

Re: [PATCH] D19941: [tooling] FixItHint Tooling refactoring

2016-05-10 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments. Comment at: include/clang/Tooling/Fixit.h:1 @@ +1,2 @@ +//===--- FixIt.h - FixIt Hint utilities -*- C++ -*-===// +// nit: s/FixIt Hint/FixItHint/, since this is a reference to the type. Comm

Re: [PATCH] D19941: [tooling] FixItHint Tooling refactoring

2016-05-11 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG. Thanks! Comment at: unittests/Tooling/FixItTest.cpp:37 @@ +36,3 @@ +EXPECT_EQ("foo(x, y)", + tooling::fixit::getText(CE->getSourceRange(), *Context)); + -

Re: [PATCH] D19703: [clang-tidy] Improve misc-redundant-expression and decrease false-positive

2016-05-11 Thread Alexander Kornienko via cfe-commits
alexfh requested changes to this revision. This revision now requires changes to proceed. Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:27 @@ +26,3 @@ + +static void ParseMacroNames(StringRef Option, +std::vector *Result) { N

Re: [PATCH] D19105: Changes in clang after running http://reviews.llvm.org/D18821

2016-05-11 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. Too much noise here as well. Particularly, `someBool == true` should not be changed to `someBool == 1`. Please fix the check and update the results. Comment at: clang-tidy/readability/ImplicitBoolCastCheck.cpp:253 @@ -252,3 +252,3 @@ DestinationT

Re: [PATCH] D19105: Changes in clang after running http://reviews.llvm.org/D18821

2016-05-11 Thread Alexander Kornienko via cfe-commits
alexfh requested changes to this revision. alexfh added a comment. This revision now requires changes to proceed. The bottom line is that the fixit in its current form is not particularly useful in most cases. We should try to detect some cases where the replacement is unlikely to be useful, e.g

Re: [PATCH] D19703: [clang-tidy] Improve misc-redundant-expression and decrease false-positive

2016-05-11 Thread Alexander Kornienko 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/misc/RedundantExpressionCheck.cpp:140 @@ +139,3 @@ + const LangOptions &LO = Finder->getASTContext().getLangOpts(); + std::set Names(NameRefs.begi

<    6   7   8   9   10   11   12   13   14   15   >