Re: [PATCH] D18783: [clang-tidy] add new checker for string literal with NUL character.

2016-04-07 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 52935. etienneb added a comment. nit http://reviews.llvm.org/D18783 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/StringLiteralWithEmbeddedNulCheck.cpp clang-tidy/misc/StringLiteralWithEmbeddedNulCheck.h

[clang-tools-extra] r265691 - [clang-tidy] add new checker for string literal with NUL character.

2016-04-07 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Thu Apr 7 11:16:36 2016 New Revision: 265691 URL: http://llvm.org/viewvc/llvm-project?rev=265691&view=rev Log: [clang-tidy] add new checker for string literal with NUL character. Summary: This patch adds the support for detecting suspicious string literals and their //inco

Re: [PATCH] D18852: [clang-tidy] fix a crash with -fdelayed-template-parsing in UnnecessaryValueParamCheck.

2016-04-07 Thread Etienne Bergeron via cfe-commits
etienneb marked an inline comment as done. Comment at: test/clang-tidy/performance-unnecessary-value-param-delayed.cpp:1 @@ +1,2 @@ +// RUN: %check_clang_tidy %s performance-unnecessary-value-param %t -- -- -fdelayed-template-parsing + kimgr wrote: > Are the doub

[PATCH] D19014: [clang-tidy] Add new checker for suspicious sizeof expressions

2016-04-12 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: alexfh. etienneb added a subscriber: cfe-commits. This check found suspicious cases of sizeof expression. Sizeof expression is retuning the size (in bytes) of a type or an expression. Programmers often abuse of misuse this expression. Th

Re: [PATCH] D19014: [clang-tidy] Add new checker for suspicious sizeof expressions

2016-04-12 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 53428. etienneb marked 6 inline comments as done. etienneb added a comment. fix alexfh@ comments http://reviews.llvm.org/D19014 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/SizeofExpressionCheck.cpp clang

Re: [PATCH] D19014: [clang-tidy] Add new checker for suspicious sizeof expressions

2016-04-12 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 53429. etienneb added a comment. release notes. http://reviews.llvm.org/D19014 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/SizeofExpressionCheck.cpp clang-tidy/misc/SizeofExpressionCheck.h docs/Release

Re: [PATCH] D19014: [clang-tidy] Add new checker for suspicious sizeof expressions

2016-04-12 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 53431. etienneb added a comment. more unittests http://reviews.llvm.org/D19014 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/SizeofExpressionCheck.cpp clang-tidy/misc/SizeofExpressionCheck.h docs/Release

Re: [PATCH] D19014: [clang-tidy] Add new checker for suspicious sizeof expressions

2016-04-12 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 53436. etienneb added a comment. fix typos and doc. http://reviews.llvm.org/D19014 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/SizeofExpressionCheck.cpp clang-tidy/misc/SizeofExpressionCheck.h docs/Rel

Re: [PATCH] D19014: [clang-tidy] Add new checker for suspicious sizeof expressions

2016-04-12 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 53437. etienneb marked 5 inline comments as done. etienneb added a comment. alexfh comments. http://reviews.llvm.org/D19014 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/SizeofExpressionCheck.cpp clang-tid

Re: [PATCH] D19014: [clang-tidy] Add new checker for suspicious sizeof expressions

2016-04-12 Thread Etienne Bergeron via cfe-commits
etienneb added inline comments. Comment at: clang-tidy/misc/SizeofExpressionCheck.cpp:27 @@ +26,3 @@ + +AST_MATCHER(BinaryOperator, isRelationnalOperator) { + return Node.isRelationalOp(); alexfh wrote: > alexfh wrote: > > nit: extra 'n' in "relational" > I'd put

Re: [PATCH] D19014: [clang-tidy] Add new checker for suspicious sizeof expressions

2016-04-12 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 53442. etienneb marked an inline comment as done. etienneb added a comment. alexfh comments. http://reviews.llvm.org/D19014 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/SizeofExpressionCheck.cpp clang-tid

Re: [PATCH] D19014: [clang-tidy] Add new checker for suspicious sizeof expressions

2016-04-13 Thread Etienne Bergeron via cfe-commits
etienneb added inline comments. Comment at: clang-tidy/misc/SizeofExpressionCheck.cpp:28 @@ +27,3 @@ + return Node.getValue().getZExtValue() > N; +} + alexfh wrote: > There are no firm rules. It mostly depends on how generic/useful in other > tools the matcher c

Re: [PATCH] D19014: [clang-tidy] Add new checker for suspicious sizeof expressions

2016-04-13 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 53609. etienneb marked 2 inline comments as done. etienneb added a comment. alexfh@ comment: top-down approach. http://reviews.llvm.org/D19014 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/SizeofExpressionCh

[PATCH] D19118: [clang-tidy] Add checker for operations between integrals and pointers

2016-04-14 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: alexfh. etienneb added a subscriber: cfe-commits. This check is finding suspicious operations involving pointers and integral types; which are most likely bugs. Examples: subversion/v1_6/subversion/libsvn_subr/utf.c ``` static const char

Re: [PATCH] D19118: [clang-tidy] Add checker for operations between integrals and pointers

2016-04-14 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 53730. etienneb added a comment. nits http://reviews.llvm.org/D19118 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/PointerAndIntegralOperationCheck.cpp clang-tidy/misc/PointerAndIntegralOperationCheck.h

[PATCH] D19121: [clang-tidy] Fix documentation generation.

2016-04-14 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: alexfh. etienneb added a subscriber: cfe-commits. The patch is fixing the generation of clang-tidy documentation. http://reviews.llvm.org/D19121 Files: docs/ReleaseNotes.rst docs/clang-tidy/checks/readability-deleted-default.rst Ind

Re: [PATCH] D19121: [clang-tidy] Fix documentation generation.

2016-04-14 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 53741. etienneb added a comment. right fix. http://reviews.llvm.org/D19121 Files: docs/ReleaseNotes.rst docs/clang-tidy/checks/readability-deleted-default.rst Index: docs/clang-tidy/checks/readability-deleted-default.rst ==

[clang-tools-extra] r266333 - [clang-tidy] Fix documentation generation.

2016-04-14 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Thu Apr 14 11:08:04 2016 New Revision: 266333 URL: http://llvm.org/viewvc/llvm-project?rev=266333&view=rev Log: [clang-tidy] Fix documentation generation. Summary: The patch is fixing the generation of clang-tidy documentation. Reviewers: alexfh Subscribers: cfe-commits

Re: [PATCH] D19121: [clang-tidy] Fix documentation generation.

2016-04-14 Thread Etienne Bergeron via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL266333: [clang-tidy] Fix documentation generation. (authored by etienneb). Changed prior to commit: http://reviews.llvm.org/D19121?vs=53741&id=53744#toc Repository: rL LLVM http://reviews.llvm.org/D

[PATCH] D19146: [clang-tidy] New checker to detect suspicious string constructor.

2016-04-14 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: alexfh. etienneb added a subscriber: cfe-commits. Checker to validate string constructor parameters. A common mistake is to swap parameter for the fill-constructor. ``` std::string str('x', 4); std::string str('4', x); ``` http://rev

Re: [PATCH] D19146: [clang-tidy] New checker to detect suspicious string constructor.

2016-04-15 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 53892. etienneb marked 2 inline comments as done. etienneb added a comment. alexfh comments. http://reviews.llvm.org/D19146 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/StringConstructorCheck.cpp clang-ti

Re: [PATCH] D19146: [clang-tidy] New checker to detect suspicious string constructor.

2016-04-15 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 53894. etienneb added a comment. fix unittests http://reviews.llvm.org/D19146 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/StringConstructorCheck.cpp clang-tidy/misc/StringConstructorCheck.h docs/clang-

Re: [PATCH] D19146: [clang-tidy] New checker to detect suspicious string constructor.

2016-04-15 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 53895. etienneb added a comment. add missing unittest for large length parameter http://reviews.llvm.org/D19146 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/StringConstructorCheck.cpp clang-tidy/misc/Stri

Re: [PATCH] D19118: [clang-tidy] Add checker for operations between integrals and pointers

2016-04-15 Thread Etienne Bergeron via cfe-commits
etienneb added inline comments. Comment at: docs/clang-tidy/checks/misc-pointer-and-integral-operation.rst:22 @@ +21,3 @@ + + void Prcess(std::string path, bool* error) { +[...] Eugene.Zelenko wrote: > Process? tpo. oups.. typo :) http://reviews.llvm.org/D1

Re: [PATCH] D19118: [clang-tidy] Add checker for operations between integrals and pointers

2016-04-15 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 53903. etienneb marked 3 inline comments as done. etienneb added a comment. comments. http://reviews.llvm.org/D19118 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/PointerAndIntegralOperationCheck.cpp clang

[clang-tools-extra] r266450 - [clang-tidy] Add checker for operations between integrals and pointers

2016-04-15 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Fri Apr 15 11:31:15 2016 New Revision: 266450 URL: http://llvm.org/viewvc/llvm-project?rev=266450&view=rev Log: [clang-tidy] Add checker for operations between integrals and pointers Summary: This check is finding suspicious operations involving pointers and integral types

[clang-tools-extra] r266451 - [clang-tidy] Add new checker for suspicious sizeof expressions

2016-04-15 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Fri Apr 15 11:36:00 2016 New Revision: 266451 URL: http://llvm.org/viewvc/llvm-project?rev=266451&view=rev Log: [clang-tidy] Add new checker for suspicious sizeof expressions Summary: This check is finding suspicious cases of sizeof expression. Sizeof expression is returni

Re: [PATCH] D19014: [clang-tidy] Add new checker for suspicious sizeof expressions

2016-04-15 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 53905. etienneb added a comment. rebased http://reviews.llvm.org/D19014 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/SizeofExpressionCheck.cpp clang-tidy/misc/SizeofExpressionCheck.h docs/ReleaseNotes.r

[clang-tools-extra] r266463 - [clang-tidy] Add more detection rules for redundant c_str calls.

2016-04-15 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Fri Apr 15 13:12:06 2016 New Revision: 266463 URL: http://llvm.org/viewvc/llvm-project?rev=266463&view=rev Log: [clang-tidy] Add more detection rules for redundant c_str calls. Summary: The string class contains methods which support receiving either a string literal or a

Re: [PATCH] D18703: [clang-tidy] Add new checker for comparison with runtime string functions.

2016-04-15 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 53966. etienneb added a comment. alexfh comments. http://reviews.llvm.org/D18703 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/SuspiciousStringCompareCheck.cpp clang-tidy/misc/SuspiciousStringCompareCheck.

Re: [PATCH] D18703: [clang-tidy] Add new checker for comparison with runtime string functions.

2016-04-15 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. ok, alexfh. I addressed your comments. http://reviews.llvm.org/D18703 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D18703: [clang-tidy] Add new checker for comparison with runtime string functions.

2016-04-15 Thread Etienne Bergeron via cfe-commits
etienneb marked 4 inline comments as done. etienneb added a comment. ship draft. http://reviews.llvm.org/D18703 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D18703: [clang-tidy] Add new checker for comparison with runtime string functions.

2016-04-15 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 53978. etienneb added a comment. nits http://reviews.llvm.org/D18703 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/SuspiciousStringCompareCheck.cpp clang-tidy/misc/SuspiciousStringCompareCheck.h docs/cla

Re: [PATCH] D19146: [clang-tidy] New checker to detect suspicious string constructor.

2016-04-15 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 53979. etienneb marked an inline comment as done. etienneb added a comment. alexfh nits. http://reviews.llvm.org/D19146 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/StringConstructorCheck.cpp clang-tidy/m

[PATCH] D19200: [clang-tidy] Cleanup some ast-matchers and lift some to utils.

2016-04-17 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: alexfh. etienneb added a subscriber: cfe-commits. Little cleanup to lift-out and to remove some frequently used ast-matchers. Some of theses matchers are candidates to be lifted to ASTMatchers.h. http://reviews.llvm.org/D19200 Files:

Re: [PATCH] D19200: [clang-tidy] Cleanup some ast-matchers and lift some to utils.

2016-04-21 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 54522. etienneb added a comment. rebased, merge: http://reviews.llvm.org/D19262 http://reviews.llvm.org/D19200 Files: clang-tidy/misc/BoolPointerImplicitConversionCheck.cpp clang-tidy/misc/IncorrectRoundings.cpp clang-tidy/misc/MacroParenthesesCheck.

[clang-tools-extra] r267003 - [clang-tidy] Cleanup some ast-matchers and lift some to utils.

2016-04-21 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Thu Apr 21 11:57:56 2016 New Revision: 267003 URL: http://llvm.org/viewvc/llvm-project?rev=267003&view=rev Log: [clang-tidy] Cleanup some ast-matchers and lift some to utils. Summary: Little cleanup to lift-out and to remove some frequently used ast-matchers. Some of these

Re: [PATCH] D18703: [clang-tidy] Add new checker for comparison with runtime string functions.

2016-04-21 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 54526. etienneb marked 2 inline comments as done. etienneb added a comment. rebased http://reviews.llvm.org/D18703 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/SuspiciousStringCompareCheck.cpp clang-tidy/

Re: [PATCH] D18703: [clang-tidy] Add new checker for comparison with runtime string functions.

2016-04-21 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 54531. etienneb added a comment. fix integration http://reviews.llvm.org/D18703 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/SuspiciousStringCompareCheck.cpp clang-tidy/misc/SuspiciousStringCompareCheck.h

[clang-tools-extra] r267009 - [clang-tidy] Add new checker for comparison with runtime string functions.

2016-04-21 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Thu Apr 21 12:19:36 2016 New Revision: 267009 URL: http://llvm.org/viewvc/llvm-project?rev=267009&view=rev Log: [clang-tidy] Add new checker for comparison with runtime string functions. Summary: This checker is validating suspicious usage of string compare functions. Exam

Re: [PATCH] D19146: [clang-tidy] New checker to detect suspicious string constructor.

2016-04-21 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 54532. etienneb added a comment. rebased http://reviews.llvm.org/D19146 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/StringConstructorCheck.cpp clang-tidy/misc/StringConstructorCheck.h docs/clang-tidy/c

[clang-tools-extra] r267011 - [clang-tidy] New checker to detect suspicious string constructor.

2016-04-21 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Thu Apr 21 12:28:08 2016 New Revision: 267011 URL: http://llvm.org/viewvc/llvm-project?rev=267011&view=rev Log: [clang-tidy] New checker to detect suspicious string constructor. Summary: Checker to validate string constructor parameters. A common mistake is to swap paramet

[PATCH] D19379: [clang-tidy] Fix broken build bot.

2016-04-21 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: alexfh. etienneb added a subscriber: cfe-commits. There is a build bot that doesn't support 'constexpr'. ``` FAILED: C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe /nologo /TP /DWIN32 /D_WINDOWS /W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd425

[clang-tools-extra] r267027 - [clang-tidy] Fix broken build bot.

2016-04-21 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Thu Apr 21 13:15:35 2016 New Revision: 267027 URL: http://llvm.org/viewvc/llvm-project?rev=267027&view=rev Log: [clang-tidy] Fix broken build bot. Summary: There is a build bot that doesn't support 'constexpr'. ``` FAILED: C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe /nolo

[PATCH] D19451: [clang-tidy] New checker for redundant expressions.

2016-04-22 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: alexfh. etienneb added a subscriber: cfe-commits. This checker finds redundant expression on both side of a binary operator. The current implementation provide a function to check whether expression are the equivalent. This implementation

Re: [PATCH] D19451: [clang-tidy] New checker for redundant expressions.

2016-04-23 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. In http://reviews.llvm.org/D19451#410014, @Eugene.Zelenko wrote: > Please mention this check in docs/ReleaseNotes.rst (in alphabetical order). > > Will check catch more complicated cases, like > > if ((Point1.x < Point2.x) && (Point1.x < Point2.x)) ? It is catching t

Re: [PATCH] D19451: [clang-tidy] New checker for redundant expressions.

2016-04-23 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. > Will check catch more complicated cases, like [..] It is not "yet" catching these cases: if ((Point2.x > Point1.x) && (Point1.x < Point2.x)) ? I believe the AreEquivalentExpression should be extended, and probably llifted to utils. Here again, I propose to do it i

Re: [PATCH] D19451: [clang-tidy] New checker for redundant expressions.

2016-04-23 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 54785. etienneb added a comment. addressed eugene requests. http://reviews.llvm.org/D19451 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/RedundantExpressionCheck.cpp clang-tidy/misc/RedundantExpressionChec

[PATCH] D19459: Cleanup redundant expression in InstCombineAndOrXor.

2016-04-23 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: rnk. etienneb added a subscriber: cfe-commits. The expression is redundant on both side of operator |. detected by : http://reviews.llvm.org/D19451 http://reviews.llvm.org/D19459 Files: lib/Transforms/InstCombine/InstCombineAndOrXor.c

[PATCH] D19460: Fix incorrect redundant expresion in target AMDGPU.

2016-04-23 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: rnk. etienneb added a subscriber: cfe-commits. Herald added a reviewer: tstellarAMD. Herald added a subscriber: arsenm. The expression is detected as a redundant expression. Turn out, this is probably a bug. ``` /home/etienneb/llvm/llvm/l

Re: [PATCH] D19451: [clang-tidy] New checker for redundant expressions.

2016-04-23 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. Tested over LLVM code, no false positives. Two catches: http://reviews.llvm.org/D19460 http://reviews.llvm.org/D19451 http://reviews.llvm.org/D19451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm

Re: [PATCH] D19459: Cleanup redundant expression in InstCombineAndOrXor.

2016-04-25 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. thx Reid. added the appropriate reviewer. http://reviews.llvm.org/D19459 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D19497: [clang-tidy] Enhance misc-suspicious-string-compare to move down false-positives.

2016-04-25 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: alexfh. etienneb added a subscriber: cfe-commits. The checker was noisy when running over llvm code base. This patch is impriving the way string-compare functions are matched. 1) By default, do not report !strcmp(...) unless it's activate

Re: [PATCH] D19451: [clang-tidy] New checker for redundant expressions.

2016-04-26 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. In http://reviews.llvm.org/D19451#412017, @alexfh wrote: > In http://reviews.llvm.org/D19451#411990, @alexfh wrote: > > > BTW, have you seen the `alpha.core.IdenticalExpr` static analyzer checker? > > > Anna, Jordan, and whoever else is interested in the > `alpha.core.I

Re: [PATCH] D19497: [clang-tidy] Enhance misc-suspicious-string-compare to move down false-positives.

2016-04-26 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 55025. etienneb marked an inline comment as done. etienneb added a comment. address alexfh comments. http://reviews.llvm.org/D19497 Files: clang-tidy/misc/SuspiciousStringCompareCheck.cpp test/clang-tidy/misc-suspicious-string-compare.c test/clang-ti

[clang-tools-extra] r267570 - [clang-tidy] Enhance misc-suspicious-string-compare to move down false-positives.

2016-04-26 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Tue Apr 26 11:53:21 2016 New Revision: 267570 URL: http://llvm.org/viewvc/llvm-project?rev=267570&view=rev Log: [clang-tidy] Enhance misc-suspicious-string-compare to move down false-positives. Summary: The checker was noisy when running over llvm code base. This patch is

Re: [PATCH] D19451: [clang-tidy] New checker for redundant expressions.

2016-04-26 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 55028. etienneb marked 2 inline comments as done. etienneb added a comment. address alexfh comments. http://reviews.llvm.org/D19451 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/RedundantExpressionCheck.cpp

Re: [PATCH] D20347: Add support to clang-cl driver for /GS switch

2016-05-25 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 58502. etienneb marked an inline comment as done. etienneb added a comment. more tests http://reviews.llvm.org/D20347 Files: include/clang/Driver/CLCompatOptions.td lib/Driver/Tools.cpp test/Driver/cl-fallback.c test/Driver/cl-options.c Index: tes

Re: [PATCH] D20347: Add support to clang-cl driver for /GS switch

2016-05-25 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. This patch needs land after http://reviews.llvm.org/D20346. thx for the review. http://reviews.llvm.org/D20347 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[PATCH] D20766: [clang-tidy] Fix script adding new clang-tidy check

2016-05-27 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: alexfh. etienneb added a subscriber: cfe-commits. The `getName()` call is useless. It's better to show a better example as tutorial. http://reviews.llvm.org/D20766 Files: clang-tidy/add_new_check.py Index: clang-tidy/add_new_check.py

[PATCH] D20767: [ASTMatchers] Add support of hasCondition for SwitchStmt.

2016-05-27 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added reviewers: aaron.ballman, sbenza. etienneb added a subscriber: cfe-commits. Herald added a subscriber: klimek. The switch statement could be added to the hasCondition matcher. Example: ``` clang-query> match switchStmt(hasCondition(ignoringImpCasts(d

[PATCH] D20773: [Sema] Fix incorrect enum token namespace

2016-05-28 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: rsmith. etienneb added a subscriber: cfe-commits. This patch fix the scoping of enum literal. They were not resolving to the right type. It was not causing any problem as one is a copy of the other one. The literal in the switch are reso

[clang-tools-extra] r271207 - [clang-tidy] Fix script adding new clang-tidy check

2016-05-30 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Mon May 30 10:05:10 2016 New Revision: 271207 URL: http://llvm.org/viewvc/llvm-project?rev=271207&view=rev Log: [clang-tidy] Fix script adding new clang-tidy check Summary: The `getName()` call is useless. It's better to show a better example as tutorial. Reviewers: alexfh

Re: [PATCH] D20766: [clang-tidy] Fix script adding new clang-tidy check

2016-05-30 Thread Etienne Bergeron via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL271207: [clang-tidy] Fix script adding new clang-tidy check (authored by etienneb). Changed prior to commit: http://reviews.llvm.org/D20766?vs=58878&id=58958#toc Repository: rL LLVM http://reviews.l

r271208 - [ASTMatchers] Add support of hasCondition for SwitchStmt.

2016-05-30 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Mon May 30 10:25:25 2016 New Revision: 271208 URL: http://llvm.org/viewvc/llvm-project?rev=271208&view=rev Log: [ASTMatchers] Add support of hasCondition for SwitchStmt. Summary: The switch statement could be added to the hasCondition matcher. Example: ``` clang-query> mat

[PATCH] D20792: [clang-tidy] Remove redundant quote in add_new_check script

2016-05-30 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: bkramer. etienneb added a subscriber: cfe-commits. Remove redundant quote. These quotes were added here: http://reviews.llvm.org/D20766 http://reviews.llvm.org/D20792 Files: clang-tidy/add_new_check.py clang-tidy/misc/UnusedUsingDecl

Re: [PATCH] D20792: [clang-tidy] Remove redundant quote in add_new_check script

2016-05-30 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 58969. etienneb added a comment. nits http://reviews.llvm.org/D20792 Files: clang-tidy/add_new_check.py Index: clang-tidy/add_new_check.py === --- clang-tidy/add_new_check.py +++ clang-tidy

[clang-tools-extra] r271210 - [clang-tidy] Remove redundant quote in add_new_check script

2016-05-30 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Mon May 30 10:42:08 2016 New Revision: 271210 URL: http://llvm.org/viewvc/llvm-project?rev=271210&view=rev Log: [clang-tidy] Remove redundant quote in add_new_check script Summary: Remove redundant quote. These quotes were added here: http://reviews.llvm.org/D20766 Reviewe

Re: [PATCH] D20714: [Clang-tidy] Fix some Include What You Use warnings; other minor fixes

2016-05-30 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. drive-by Comment at: clang-tidy/ClangTidy.cpp:24 @@ -24,2 +23,3 @@ #include "clang/ASTMatchers/ASTMatchFinder.h" -#include "clang/Frontend/ASTConsumers.h" +#include "clang/Basic/DiagnosticOptions.h" +#include "clang/Basic/FileManager.h" ---

Re: [PATCH] D20714: [Clang-tidy] Fix some Include What You Use warnings; other minor fixes

2016-05-31 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. In http://reviews.llvm.org/D20714#444802, @Eugene.Zelenko wrote: > Point of Include What You Use suggestions to rely on explicit dependencies, > not implicit ones. It's true most of the time. In some case, splitting the header file is for maintainability and includin

Re: [PATCH] D20714: [Clang-tidy] Fix some Include What You Use warnings; other minor fixes

2016-06-01 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. In http://reviews.llvm.org/D20714#445911, @Eugene.Zelenko wrote: > There is a way to tell IWYU about compound headers with pragmas > . > I also suggested to make this possible

Re: [PATCH] D20857: [clang-tidy] Add modernize-explicit-operator-bool check.

2016-06-01 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. I wonder if these two checks should not be merge in one checker. modernize-explicit-conversion-operator Comment at: clang-tidy/modernize/ExplicitOperatorBoolCheck.cpp:21 @@ +20,3 @@ +void ExplicitOperatorBoolCheck::registerMatchers(MatchFinder *Finde

r271431 - [Sema] Fix incorrect enum token namespace

2016-06-01 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Wed Jun 1 16:17:32 2016 New Revision: 271431 URL: http://llvm.org/viewvc/llvm-project?rev=271431&view=rev Log: [Sema] Fix incorrect enum token namespace Summary: This patch fix the scoping of enum literal. They were not resolving to the right type. It was not causing any

Re: [PATCH] D20857: [clang-tidy] Add modernize-explicit-operator-bool check.

2016-06-02 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. In http://reviews.llvm.org/D20857#446654, @murrayc wrote: > In http://reviews.llvm.org/D20857#446101, @etienneb wrote: > > > I wonder if these two checks should not be merge in one checker. > > > Personally I find it cleaner to keep them separate, but I would be happy to

Re: [PATCH] D20857: [clang-tidy] Add modernize-explicit-operator-bool check.

2016-06-02 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. In http://reviews.llvm.org/D20857#446784, @murrayc wrote: > In http://reviews.llvm.org/D20857#446732, @etienneb wrote: > > > Enabling/disabling can be done with options (see SizeofExpressionCheck). > > > Thanks. Am I being asked to combine the checks? I'll let alexfh@

Re: [PATCH] D20857: [clang-tidy] Add modernize-explicit-operator-bool check.

2016-06-02 Thread Etienne Bergeron via cfe-commits
etienneb added inline comments. Comment at: test/clang-tidy/modernize-operator-void-pointer.cpp:39 @@ +38,3 @@ +class SomethingGoodNonConstVoidPtr { + // A non-const void* is unlikely to to be meant as operator bool before C++11 + // let us use explicit. You kno

Re: [PATCH] D20053: [clang-tidy] Add misc-unnecessary-mutable check.

2016-06-03 Thread Etienne Bergeron via cfe-commits
etienneb added inline comments. Comment at: clang-tidy/misc/UnnecessaryMutableCheck.cpp:23 @@ +22,3 @@ + +// Matcher checking if the declaration is non-macro existent mutable which is +// not dependent on context. add an anonymous namespace around this declaration

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

2016-06-13 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. Some comments after a quick look to the code. Comment at: clang-tidy/misc/DeleteNullCheck.cpp:22 @@ +21,3 @@ +void DeleteNullCheck::registerMatchers(MatchFinder *Finder) { + const auto HasDeleteExpr = + cxxDeleteExpr(hasDescendant(declRefExpr().bi

Re: [PATCH] D21241: Add an ASTMatcher for ignoring ExprWithCleanups.

2016-06-15 Thread Etienne Bergeron via cfe-commits
etienneb added a subscriber: etienneb. etienneb added a comment. I was wondering why we didn't created that Matcher: IgnoreImplicit I believe it's more commonly used than 'ignoringExprWithCleanups'. It can be implemented by calling 'Stmt.IgnoreImplicit'. /// Skip past any implicit AST nodes w

r272832 - Add support to clang-cl driver for /GS switch

2016-06-15 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Wed Jun 15 15:34:33 2016 New Revision: 272832 URL: http://llvm.org/viewvc/llvm-project?rev=272832&view=rev Log: Add support to clang-cl driver for /GS switch Summary: This patch is adding command-line support for the MSVC buffer security check. The buffer security check is

Re: [PATCH] D21392: [clang-tidy] Enhance redundant-expression check

2016-06-16 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 60982. etienneb marked 7 inline comments as done. etienneb added a comment. address comments http://reviews.llvm.org/D21392 Files: clang-tidy/misc/RedundantExpressionCheck.cpp clang-tidy/misc/RedundantExpressionCheck.h test/clang-tidy/misc-redundant-

Re: [PATCH] D21392: [clang-tidy] Enhance redundant-expression check

2016-06-16 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. thx Aaron. Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:131 @@ +130,3 @@ + + // Handle the case where constants are off by one: x <= 4 <==> x < 5. + llvm::APSInt ValueLHS_plus1 = ValueLHS; aaron.ballman wrote: > Why is o

Re: [PATCH] D21392: [clang-tidy] Enhance redundant-expression check

2016-06-16 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 60983. etienneb added a comment. refactoring http://reviews.llvm.org/D21392 Files: clang-tidy/misc/RedundantExpressionCheck.cpp clang-tidy/misc/RedundantExpressionCheck.h test/clang-tidy/misc-redundant-expression.cpp Index: test/clang-tidy/misc-redu

Re: [PATCH] D21392: [clang-tidy] Enhance redundant-expression check

2016-06-27 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 61984. etienneb marked 12 inline comments as done. etienneb added a comment. address comments http://reviews.llvm.org/D21392 Files: clang-tidy/misc/RedundantExpressionCheck.cpp clang-tidy/misc/RedundantExpressionCheck.h test/clang-tidy/misc-redundant

Re: [PATCH] D21392: [clang-tidy] Enhance redundant-expression check

2016-06-28 Thread Etienne Bergeron via cfe-commits
etienneb added inline comments. Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:27 @@ -25,1 +26,3 @@ +static bool incrementWithoutOverflow(const llvm::APSInt &Value, + llvm::APSInt &Result) { aaron.ballman wrote: > I

Re: [PATCH] D21392: [clang-tidy] Enhance redundant-expression check

2016-07-06 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 63020. etienneb marked 2 inline comments as done. etienneb added a comment. nits http://reviews.llvm.org/D21392 Files: clang-tidy/misc/RedundantExpressionCheck.cpp clang-tidy/misc/RedundantExpressionCheck.h test/clang-tidy/misc-redundant-expression.c

[clang-tools-extra] r274731 - [clang-tidy] Enhance redundant-expression check

2016-07-06 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Wed Jul 6 23:03:05 2016 New Revision: 274731 URL: http://llvm.org/viewvc/llvm-project?rev=274731&view=rev Log: [clang-tidy] Enhance redundant-expression check Summary: This patch is adding support to recognize more complex redundant expressions. Reviewers: alexfh Subscr

[clang-tools-extra] r275254 - fix missing newline in sphinx doc

2016-07-12 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Wed Jul 13 01:06:48 2016 New Revision: 275254 URL: http://llvm.org/viewvc/llvm-project?rev=275254&view=rev Log: fix missing newline in sphinx doc Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-emplace.rst Modified: clang-tools-extra/trunk/docs/

r275256 - fix missing whitespace in sphinx doc

2016-07-12 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Wed Jul 13 01:37:39 2016 New Revision: 275256 URL: http://llvm.org/viewvc/llvm-project?rev=275256&view=rev Log: fix missing whitespace in sphinx doc Modified: cfe/trunk/docs/ClangFormat.rst Modified: cfe/trunk/docs/ClangFormat.rst URL: http://llvm.org/viewvc/llvm-proj

[PATCH] D17981: [clang-tidy] Fix clang-tidy to support parsing of assembly statements.

2016-03-09 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added reviewers: alexfh, rnk. etienneb added a subscriber: cfe-commits. Summary: Clang-tidy fails when parsing MSVC inline assembly statements. The native target and asm parser aren't initialized. The following patch is fixing the issue by using the same

Re: [PATCH] D17981: [clang-tidy] Fix clang-tidy to support parsing of assembly statements.

2016-03-14 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. > $ du -cksh bin/clang-tidy.exe bin/clang.exe > 21M bin/clang-tidy.exe > 47M bin/clang.exe > 68M total This is a huge difference. I didn't expect dependencies to bring so much code. I'm not a fan of having an empty statement and increasing false posi

[PATCH] D18293: [clang-tidy] Fix redundant-string-init check with msvc 14 headers.

2016-03-18 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: alexfh. etienneb added a subscriber: cfe-commits. The string constructors are not defined using optional parameters and are not recognized by the redundant-string-init checker. The following patch fixes the redundant-string-init checker

[PATCH] D18262: [clang-tidy] Skip reporting of not applicable fixes.

2016-03-19 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added reviewers: rnk, emso, alexfh, bkramer. etienneb added a subscriber: cfe-commits. Invalid source location are causing clang-tidy to crash when manipulating an invalid file. Macro definitions on the command line have locations in a virtual buffer and

Re: [PATCH] D18238: [clang-tidy] Fix clang-tidy crashes when using -fdelayed-template-parsing.

2016-03-19 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 50971. etienneb added a comment. tests added. http://reviews.llvm.org/D18238 Files: cppcoreguidelines-pro-type-member-init-delayed.cpp cppcoreguidelines/ProTypeMemberInitCheck.cpp modernize-redundant-void-arg-delayed.cpp modernize/RedundantVoidArgC

[PATCH] D18238: [clang-tidy] Fix clang-tidy crashes when using -fdelayed-template-parsing.

2016-03-19 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added reviewers: rnk, alexfh, emso, bkramer. etienneb added a subscriber: cfe-commits. Herald added a subscriber: aemerson. Fix crashes caused by deferencing null pointer when declarations parsing may be delayed. The body of the declarations may be null.

Re: [PATCH] D18238: [clang-tidy] Fix clang-tidy crashes when using -fdelayed-template-parsing.

2016-03-19 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 50940. etienneb marked 3 inline comments as done. etienneb added a comment. fixed. thanks. http://reviews.llvm.org/D18238 Files: cppcoreguidelines/ProTypeMemberInitCheck.cpp modernize/RedundantVoidArgCheck.cpp Index: cppcoreguidelines/ProTypeMemberIni

Re: [PATCH] D18231: [Clang-tools-extra] Fix Clang-tidy modernize-deprecated-headers warnings; other minor fixes

2016-03-19 Thread Etienne Bergeron via cfe-commits
etienneb added a subscriber: etienneb. etienneb added a comment. lgtm Repository: rL LLVM http://reviews.llvm.org/D18231 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D18262: [clang-tidy] Skip reporting of not applicable fixes.

2016-03-19 Thread Etienne Bergeron via cfe-commits
etienneb added inline comments. Comment at: ClangTidy.cpp:144 @@ -138,1 +143,3 @@ + +Diag << FixItHint::CreateReplacement(Range, Fix.getReplacementText()); ++TotalFixes; alexfh wrote: > aaron.ballman wrote: > > Is there a purpose to emittin

Re: [PATCH] D18191: [clang-tidy] Add check for function parameters that are const& to builtin types

2016-03-19 Thread Etienne Bergeron via cfe-commits
etienneb added a subscriber: etienneb. etienneb added a comment. drive-by, some comments. Comment at: clang-tidy/misc/ConstRefBuiltinCheck.cpp:51 @@ +50,3 @@ + << Parameter->getFunctionScopeIndex() + << Function->getName() + << Fix; Function is de

Re: [PATCH] D18262: [clang-tidy] Skip reporting of not applicable fixes.

2016-03-20 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 51046. etienneb marked 2 inline comments as done. etienneb added a comment. Added test. http://reviews.llvm.org/D18262 Files: ClangTidy.cpp misc-macro-parentheses-cmdline.cpp Index: misc-macro-parentheses-cmdline.cpp ==

<    1   2   3   4   >