[PATCH] D66538: [AST] AST structural equivalence to work internally with pairs.

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 22 02:43:02 PDT 2019


martong added inline comments.


================
Comment at: clang/lib/AST/ASTStructuralEquivalence.cpp:1586
-  if (EquivToD1)
-    return EquivToD1 == D2->getCanonicalDecl();
 
----------------
balazske wrote:
> It looks like that the original code is correct in the decision of structural equivalence of the original pair. If we have an (A,B) and (A,C) to compare, B and C are in different decl chain, then (A,B) or (A,C) will be non-equivalent (unless B and C are equivalent, but what to do in this case?). The problem was that the code assumed that in this case always A and B (or A and C) are non-equivalent. If `NonEquivalentDecls` is not filled in this case (or not used at all) the problem does not exist.
I have a déjá vu feeling. We already had tried to get rid of the redecl chain comparison:
https://github.com/Ericsson/clang/pull/382/files


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66538/new/

https://reviews.llvm.org/D66538





More information about the cfe-commits mailing list