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
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
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
barancsuk added inline comments.
Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:41
+static const llvm::StringSet<> KnownBannedMacroNames = {"EAGAIN",
"EWOULDBLOCK",
+ "SIGCLD", "SIGCHLD"};
xazax.hu
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
xazax.hun added inline comments.
Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:41
+static const llvm::StringSet<> KnownBannedMacroNames = {"EAGAIN",
"EWOULDBLOCK",
+ "SIGCLD", "SIGCHLD"};
Is this
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
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
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
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
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
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
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
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
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
15 matches
Mail list logo