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

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

2016-07-04 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. A couple of nits. Otherwise looks good. Thanks! Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:232 @@ +231,3 @@ + +static bool rangeSubsumeRange(BinaryOperatorKind O

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-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-25 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. A few nits. Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:135 @@ +134,3 @@ + llvm::APSInt ValueLHS_plus1; + if (((OpcodeLHS == BO_LE && OpcodeRHS == BO_LT) || + (OpcodeLHS == BO_GT && OpcodeRHS == BO_GE)) && How about r

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

2016-06-22 Thread Aaron Ballman via cfe-commits
aaron.ballman 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) { I think this could b

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-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 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 Aaron Ballman via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:114 @@ -112,1 +113,3 @@ +// Perform a comparison bitween APSInt with respect to bit-width and signedness. +static int compareValues(const llvm::APSInt &ValueLHS, s/bit