================
@@ -44,6 +45,328 @@ static bool incrementWithoutOverflow(const APSInt &Value, 
APSInt &Result) {
   return Value < Result;
 }
 
+static bool areEquivalentExpr(const Expr *Left, const Expr *Right);
----------------
voyager-jhk wrote:

@mizvekov Thanks for confirming.

To fix the original false positive on `MonthArray == ZodiacArray`, we have to 
compare the sugared types. However, because they aren't uniqued, standard 
checks like `Stmt::Profile()` yield different hashes even for identical 
expressions, causing us to miss true redundancies like:
`std::tuple_size<MonthArray>::value == std::tuple_size<MonthArray>::value;`

To correctly differentiate the aliases while still catching true redundancies, 
I had to implement a custom deep structural comparison logic in this PR.

Is there an existing Clang API that handles this sugared equivalence natively, 
so we can drop the custom traversal?

https://github.com/llvm/llvm-project/pull/198085
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to