This is an archive of the discontinued LLVM Phabricator instance.

[lldb][NFC] Add an ImporterBackedASTSource that serves as base class for LLDB ExternalASTSources that use the ASTImporter
AcceptedPublic

Authored by teemperor on Nov 10 2021, 4:32 AM.

Details

Reviewers
aprantl
a.sidorin
Summary

This gives all ExternalASTSource classes a common base class that allows
other classes (in LLDB's case ClangASTImporter) to invalidate the redeclaration chains
in an ASTContext. The implementation just calls the (private) function to bump the
generation counter which is how we track whether a redeclaration chain is out of date.

This is used in D101950 to let the ClangASTImporter mark redeclaration chains as
out-of-date so that they update themselves via the ExternalASTSource.

Patch itself is NFC as it just changes the inheritance of a bunch of classes and changes
the LLVM RTTI to make sure we can reliably cast to it. Will be merged with its
dependent patch that lets the ClangASTImporter handle redeclaration chains.

Diff Detail

Event Timeline

teemperor created this revision.Nov 10 2021, 4:32 AM
teemperor requested review of this revision.Nov 10 2021, 4:32 AM
This revision is now accepted and ready to land.Nov 10 2021, 11:13 AM