[PATCH] D19451: [clang-tidy] New checker for redundant expressions.
    Etienne Bergeron via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Tue Apr 26 10:07:35 PDT 2016
    
    
  
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::FoldingSetNodeIDs` created using `Stmt::Profile`. However it's only useful to check for identical expressions and won't work, if you're going to extend this to equivalent expressions.
Exact. There is plan to extend the notion of "equivalent".
I think we should lift this to "utils", and maybe we can also provide a "isIdenticalExpression" based on FoldingSet.
http://reviews.llvm.org/D19451
    
    
More information about the cfe-commits
mailing list