Page MenuHomePhabricator

[lldb][modern-type-lookup] Ask the ExternalASTMerger to lookup namespaces instead of using the old mechanism
Needs ReviewPublic

Authored by teemperor on Oct 4 2019, 6:48 AM.

Details

Reviewers
shafik
Summary

With this patch LLDB starts querying the ExternalASTMerger when we look up a namespace in the translation unit context. Because
Clang's FindExternalVisibleDecls is returning a true/false on Lookup and LLDB instead uses a list of decls, this also adds some
glue code that passes this bool back to the caller when we have modern-type-lookup activated. We can't easily emulate
LLDB's API as Clang doesn't directly tell us what declarations it found in the DeclContext and querying the decl context for potential
declarations could have side-effects (like modifying the cached lookup in some way).

Note that this doesn't change any code for normal LLDB as we continue to ignore that return value in normal LLDB (mostly because
I don't know if there is a reason this was implemented this way).

The bigger change in ClangExpressionDeclMap.cpp is necessary as currently never query the ExternalASTSource when we don't
have a NamespaceMap (which we never have, as that's a non-modern-type-lookup thing). So instead we just ignore the NameSpaceMap
and continue to the actual ExternalASTSource in this case.

Diff Detail

Event Timeline

teemperor created this revision.Oct 4 2019, 6:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 4 2019, 6:48 AM