This is an archive of the discontinued LLVM Phabricator instance.

[ASTImporter] Import overrides before importing the rest of the chain
ClosedPublic

Authored by martong on Oct 25 2018, 7:44 AM.

Details

Summary

During method import we check for structural eq of two methods.
In the structural eq check we check for their isVirtual() flag. That
flag, however, may depend on the number of overrides. Before this
change we imported the overrides *after* we had imported the rest of the
redecl chain. So, during the import of another decl from the chain
IsVirtual() gave false result.

Writing tests for this is not really possible, because there is no way
to remove an overridden method via the AST API.
(We should access the private ASTContext::OverriddenMethods container.)
Also, we should do the remove in the middle of the import process.

Diff Detail

Repository
rC Clang

Event Timeline

martong created this revision.Oct 25 2018, 7:44 AM
a_sidorin accepted this revision.Oct 27 2018, 4:18 PM

Hello Gabor,

The change looks harmless so I think it can be accepted even without tests. Did you encountered the issue while analyzing some real code?

This revision is now accepted and ready to land.Oct 27 2018, 4:18 PM

Hi Aleksei,

Thanks for the review. Yes, we encountered the issue during the analysis of Xerces.

This revision was automatically updated to reflect the committed changes.