[clang] [clang] fix lack comparison of declRefExpr in ASTStructuralEquivalence (PR #66041)

via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 12 01:41:11 PDT 2023


================
@@ -214,6 +214,14 @@ class StmtComparer {
     return E1->size() == E2->size();
   }
 
+  bool IsStmtEquivalent(const DeclRefExpr *DRE1, const DeclRefExpr *DRE2) {
+    if (nullptr == DRE1->getDecl() || nullptr == DRE2->getDecl()) {
+      return false;
+    }
+    return IsStructurallyEquivalent(Context, DRE1->getDecl()->getDeclName(),
----------------
mzyKi wrote:

Thanks for review, now I have taken your suggestions.When I develop in llvm 13,```static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context,Decl *D1, Decl *D2)``` this function do not give me expected result. Maybe now this updated, I will find changes between two versions after

https://github.com/llvm/llvm-project/pull/66041


More information about the cfe-commits mailing list