[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-11-07 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL317570: [clang-tidy] Misc redundant expressions checker updated for macros (authored by xazax). Changed prior to commit: https://reviews.llvm.org/D38688?vs=121740&id=121875#toc Repository: rL LLVM h

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-11-06 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 121740. barancsuk marked 2 inline comments as done. barancsuk added a comment. Address review comments: fix missing full stops at the end of comments https://reviews.llvm.org/D38688 Files: clang-tidy/misc/RedundantExpressionCheck.cpp clang-tidy/misc/R

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-11-03 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. Aside from some minor commenting nits, this LGTM. Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:445 + // Do not bind to double negation, it is uneffective. const auto NegateNegateRelationalExp

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-11-02 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk added inline comments. Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:41 +static const llvm::StringSet<> KnownBannedMacroNames = {"EAGAIN", "EWOULDBLOCK", + "SIGCLD", "SIGCHLD"}; xazax.hu

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-11-02 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 121323. barancsuk added a comment. Fix shifted line https://reviews.llvm.org/D38688 Files: clang-tidy/misc/RedundantExpressionCheck.cpp clang-tidy/misc/RedundantExpressionCheck.h docs/clang-tidy/checks/misc-redundant-expression.rst test/clang-tidy

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-11-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:41 +static const llvm::StringSet<> KnownBannedMacroNames = {"EAGAIN", "EWOULDBLOCK", + "SIGCLD", "SIGCHLD"}; Is this

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-10-30 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:633-635 +// The function discards (X < M1 && X <= M2), because it can always be +// simplified to X < M, where M is the smaller one of the two macro +// values. barancs

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-10-30 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk added inline comments. Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:633-635 +// The function discards (X < M1 && X <= M2), because it can always be +// simplified to X < M, where M is the smaller one of the two macro +// values. aaron.ballm

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-10-30 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 120820. barancsuk marked 17 inline comments as done. barancsuk added a comment. Address review comments, discard ambiguously redundant macro expressions https://reviews.llvm.org/D38688 Files: clang-tidy/misc/RedundantExpressionCheck.cpp clang-tidy/mis

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-10-25 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:89 cast(Right)->getValue(); + case Stmt::IntegerLiteralClass: { I would remove the formatting changes from this function. Comment at: c

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-10-25 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added a comment. This revision is now accepted and ready to land. LGTM! But wait for @aaron.ballman, @alexfh, or @hokein for the final word. https://reviews.llvm.org/D38688 ___ cfe-commits mailing list cfe

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-10-18 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk added inline comments. Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:510 +// E.g.: from (X == 5) && (X == 5) retrieves 5 and 5 +static void retrieveConstExprFromBothSides(const BinaryOperator *&BinOp, + BinaryOperator

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-10-18 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 119452. barancsuk marked 8 inline comments as done. barancsuk added a comment. Herald added a subscriber: whisperity. Address review comments. https://reviews.llvm.org/D38688 Files: clang-tidy/misc/RedundantExpressionCheck.cpp clang-tidy/misc/Redundan

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-10-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:357 + ConstExpr = Result.Nodes.getNodeAs(CstId); + return ConstExpr && ConstExpr->isIntegerConstantExpr(Value, *Result.Context); +} xazax.hun wrote: > I think you could ju

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-10-13 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Thanks for working on this, these additions look very useful to me. Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:124 + case Stmt::CXXFunctionalCastExprClass: +return cast(Left)->getTypeAsWritten() == You could merge