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

2016-04-26 Thread Etienne Bergeron via cfe-commits
etienneb added inline comments. Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:21 @@ +20,3 @@ + +static bool AreIdenticalExpr(const Expr *Left, const Expr *Right) { + if (!Left || !Right) alexfh wrote: > This is to some degree similar to comparing `llvm

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] 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] D19451: [clang-tidy] New checker for redundant expressions.

2016-04-26 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. 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.IdenticalExpr` checker (lib/StaticAnalyzer/Checkers/IdenticalExprChecker

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

2016-04-26 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. Awesome idea! LG with a couple of nits. In http://reviews.llvm.org/D19451#410064, @etienneb wrote: > Tested over LLVM code, no false positives. > > Two catches: > http://reviews.llvm.org/D19

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

2016-04-26 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. BTW, have you seen the `alpha.core.IdenticalExpr` static analyzer checker? http://reviews.llvm.org/D19451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

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 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 Eugene Zelenko via cfe-commits
Eugene.Zelenko added a subscriber: Eugene.Zelenko. Eugene.Zelenko added a comment. 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)) ? Will be good idea to add such case

[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