balazske added inline comments.

================
Comment at: lib/AST/ASTImporter.cpp:2085
             }
+          } else {
+            if (!IsStructuralMatch(D, FoundRecord, false))
----------------
martong wrote:
> a_sidorin wrote:
> > 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?
> Yes, this is a good point, updated the patch accordingly.
My idea was to remove this whole `if (!SearchName)` branch, but some 
restructuring of the next conditions may be needed. Setting of `PrevDecl` in 
the `if` branch does not look correct (if `!SearchName` is false it is never 
set, unlike in the old code).


Repository:
  rC Clang

https://reviews.llvm.org/D48773



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to