diff options
author | Greg Clayton <gclayton@apple.com> | 2011-06-25 00:44:06 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2011-06-25 00:44:06 +0000 |
commit | a2721476e7e8ec57418b460d27fd0900e8e7aa30 (patch) | |
tree | 9fdaf40ff3793d9907fe6007e245528e2d6ccc75 /lldb/source/Symbol/ClangExternalASTSourceCallbacks.cpp | |
parent | 5f836782222045a4b87837917ba8f61f25e92df4 (diff) | |
download | bcm5719-llvm-a2721476e7e8ec57418b460d27fd0900e8e7aa30.tar.gz bcm5719-llvm-a2721476e7e8ec57418b460d27fd0900e8e7aa30.zip |
This commit adds broad architectural support for hierarchical
inspection of namespaces in the expression parser.
ClangExpressionDeclMap hitherto reported that namespaces had
been completely imported, even though the namespaces are
returned empty. To deal with this situation, ClangASTSource
was recently extended with an API to complete incomplete type
definitions, and, for greater efficiency, to complete these
definitions partially, returning only those objects that have
a given name.
This commit supports these APIs on LLDB's side, and uses it
to provide information on types resident in namespaces.
Namespaces are now imported as they were -- that is to say,
empty -- but with minimal import mode on. This means that
Clang will come back and request their contents by name as
needed. We now respond with information on the contained
types; this will be followed soon by information on functions
and variables.
llvm-svn: 133852
Diffstat (limited to 'lldb/source/Symbol/ClangExternalASTSourceCallbacks.cpp')
-rw-r--r-- | lldb/source/Symbol/ClangExternalASTSourceCallbacks.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lldb/source/Symbol/ClangExternalASTSourceCallbacks.cpp b/lldb/source/Symbol/ClangExternalASTSourceCallbacks.cpp index c79aefca53e..5b7b48fa901 100644 --- a/lldb/source/Symbol/ClangExternalASTSourceCallbacks.cpp +++ b/lldb/source/Symbol/ClangExternalASTSourceCallbacks.cpp @@ -52,6 +52,17 @@ ClangExternalASTSourceCallbacks::FindExternalVisibleDeclsByName clang::DeclarationName clang_decl_name ) { + if (m_callback_find_by_name) + { + llvm::SmallVector <clang::NamedDecl *, 3> results; + + m_callback_find_by_name (m_callback_baton, decl_ctx, clang_decl_name, &results); + + DeclContextLookupResult lookup_result (SetExternalVisibleDeclsForName(decl_ctx, clang_decl_name, results)); + + return lookup_result; + } + std::string decl_name (clang_decl_name.getAsString()); switch (clang_decl_name.getNameKind()) { |