This is an archive of the discontinued LLVM Phabricator instance.

[ASTImporter] Remove ASTNodeImporter::IsStructuralMatch overload for EnumConstantDecl
ClosedPublic

Authored by teemperor on Oct 29 2021, 4:51 AM.

Details

Summary
  1. Moves the check to ASTStructuralEquivalence.cpp like all the other checks.
  2. Adds the missing checks for identifier and init expression. Also add the respective tests for that stuff.

Diff Detail

Event Timeline

teemperor created this revision.Oct 29 2021, 4:51 AM
teemperor requested review of this revision.Oct 29 2021, 4:51 AM
teemperor added inline comments.Oct 29 2021, 4:57 AM
clang/lib/AST/ASTStructuralEquivalence.cpp
1640

FWIW, there is some duplicating here that we could avoid. The question is if we should keep the diagnostics or drop them?

(This code here is also missing the InitExpr check)

martong accepted this revision.Oct 29 2021, 5:19 AM

Great, thanks!

clang/lib/AST/ASTStructuralEquivalence.cpp
1640

I don't mind if we drop the warning, actually, we do emit the warnings inconsistently, so it would not matter.
(We do not emit any warning in some of the IsStructurallyEquivalent overloads at all. )

In a long term, I think, either we should emit the warnings everywhere, or we should return with the non-equivalent node pair, so the user code of StructuralEquivalenceContext could emit the warning properly and only in one place. I'd prefer the latter.

This revision is now accepted and ready to land.Oct 29 2021, 5:19 AM
This revision was landed with ongoing or failed builds.Oct 30 2021, 4:12 AM
This revision was automatically updated to reflect the committed changes.