================
@@ -353,23 +355,90 @@ isInUnspecifiedUntypedContext(internal::Matcher<Stmt> 
InnerMatcher) {
   return stmt(anyOf(CompStmt, IfStmtThen, IfStmtElse));
 }
 
+// Returns true iff integer E1 is equivalent to integer E2.
+//
+// For now we only support such expressions:
+//    expr := DRE | const-value | expr BO expr
+//    BO   := '*' | '+'
+//
+// FIXME: We can reuse the expression comparator of the interop analysis after
----------------
dtarditi wrote:

@ziqingluo-90 Is the expression comparator of the interop analysis the same or 
different from what is done here?

 I believe this expression comparison can result in exponential work in the 
size of an expression..  AreEquaIntegralBinaryOperator makes 2 calls to 
AreEqualIntegers per subexpression.  AreEqualIntegers can call back into 
EqualIntegeralBinaryOperator on subexpressions of its argument.

If the plan is to eventually replace this code with the expression comparator 
from interop analysis, then this is not worth fixing now.  However, if the 
expression comparator has the same issue or that is not the plan, then this 
should be fixed.   It can be fixed be bounding the amount of work that is 
allowed, for example, by limiting the recursive depth that is allowed.

https://github.com/llvm/llvm-project/pull/114894
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to