[PATCH] D48773: [ASTImporter] Fix import of objects with anonymous types

Aleksei Sidorin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 30 00:02:45 PDT 2018


a_sidorin added a comment.

Hello Gabor,

The change looks reasonable to me. But could you please check if we can have some code unification with structural matching?



================
Comment at: lib/AST/ASTImporter.cpp:2085
             }
+          } else {
+            if (!IsStructuralMatch(D, FoundRecord, false))
----------------
Is it possible to use the added code for the entire condition `if (auto *FoundRecord = dyn_cast<RecordDecl>(Found))`, replacing its body? Our structural matching already knows how to handle unnamed structures, and the upper code partially duplicates `IsStructurallyEquivalent(StructuralEquivalenceContext &Context,RecordDecl *D1, RecordDecl *D2)`. Can we change structural matching to handle this stuff instead of doing it in ASTNodeImporter?


Repository:
  rC Clang

https://reviews.llvm.org/D48773





More information about the cfe-commits mailing list