summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/ClangExpressionDeclMap.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2014-12-05 01:27:35 +0000
committerSean Callanan <scallanan@apple.com>2014-12-05 01:27:35 +0000
commitc8278afc9ff03e51872abe800aa67f1f2d2b2b11 (patch)
treef3fb7548d21fd0bbc6cfba284d36ae5fb21aa51d /lldb/source/Expression/ClangExpressionDeclMap.cpp
parentc631b64fab30f30b36781e819add0a264d03ed7e (diff)
downloadbcm5719-llvm-c8278afc9ff03e51872abe800aa67f1f2d2b2b11.tar.gz
bcm5719-llvm-c8278afc9ff03e51872abe800aa67f1f2d2b2b11.zip
Changes to the expression parser to actually use
the types that we find in Clang modules. llvm-svn: 223436
Diffstat (limited to 'lldb/source/Expression/ClangExpressionDeclMap.cpp')
-rw-r--r--lldb/source/Expression/ClangExpressionDeclMap.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp
index 5b7065d388a..e3027378422 100644
--- a/lldb/source/Expression/ClangExpressionDeclMap.cpp
+++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp
@@ -1327,6 +1327,16 @@ ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context,
return;
}
}
+
+ std::vector<clang::NamedDecl *> decls_from_modules;
+
+ if (target)
+ {
+ if (ClangModulesDeclVendor *decl_vendor = target->GetClangModulesDeclVendor())
+ {
+ decl_vendor->FindDecls(name, false, UINT32_MAX, decls_from_modules);
+ }
+ }
if (!context.m_found.variable)
{
@@ -1404,6 +1414,19 @@ ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context,
non_extern_symbol = sym_ctx.symbol;
}
}
+
+ if (!context.m_found.function_with_type_info)
+ {
+ for (clang::NamedDecl *decl : decls_from_modules)
+ {
+ if (llvm::isa<clang::FunctionDecl>(decl))
+ {
+ clang::NamedDecl *copied_decl = llvm::cast<FunctionDecl>(m_ast_importer->CopyDecl(m_ast_context, &decl->getASTContext(), decl));
+ context.AddNamedDecl(copied_decl);
+ context.m_found.function_with_type_info = true;
+ }
+ }
+ }
if (!context.m_found.function_with_type_info)
{
OpenPOWER on IntegriCloud