diff options
author | Sean Callanan <scallanan@apple.com> | 2012-07-28 00:21:01 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2012-07-28 00:21:01 +0000 |
commit | 308a3c54121fec25edab8aef6d3d6864f62dec2a (patch) | |
tree | b18ed5e5e5e2228ffd1d3eb72d00fa2c91ac47cf /lldb/source/Expression/ClangExpressionDeclMap.cpp | |
parent | 3ac187731e959f40f6f2572c0645472adeac6a22 (diff) | |
download | bcm5719-llvm-308a3c54121fec25edab8aef6d3d6864f62dec2a.tar.gz bcm5719-llvm-308a3c54121fec25edab8aef6d3d6864f62dec2a.zip |
Fixed the expression parser to ignore C++ and
Objective-C method names when looking for functions
in the top level or a namespace. Method names should
only be found via FindExternalLexicalDecls.
<rdar://problem/11711679>
llvm-svn: 160907
Diffstat (limited to 'lldb/source/Expression/ClangExpressionDeclMap.cpp')
-rw-r--r-- | lldb/source/Expression/ClangExpressionDeclMap.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index e85239d0159..e4c5a179439 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -2703,6 +2703,9 @@ ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context, { const bool include_symbols = true; + // TODO Fix FindFunctions so that it doesn't return + // instance methods for eFunctionNameTypeBase. + target->GetImages().FindFunctions(name, eFunctionNameTypeBase, include_symbols, @@ -2725,6 +2728,14 @@ ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context, if (sym_ctx.function) { + clang::DeclContext *decl_ctx = sym_ctx.function->GetClangDeclContext(); + + // Filter out class/instance methods. + if (dyn_cast<clang::ObjCMethodDecl>(decl_ctx)) + continue; + if (dyn_cast<clang::CXXMethodDecl>(decl_ctx)) + continue; + // TODO only do this if it's a C function; C++ functions may be // overloaded if (!context.m_found.function_with_type_info) @@ -3281,10 +3292,15 @@ ClangExpressionDeclMap::AddOneFunction (NameSearchContext &context, { ASTDumper ast_dumper(fun_decl); - log->Printf(" CEDM::FEVD[%u] Found %s function %s, returned %s", + StreamString ss; + + fun_address->Dump(&ss, m_parser_vars->m_exe_ctx.GetBestExecutionContextScope(), Address::DumpStyleResolvedDescription); + + log->Printf(" CEDM::FEVD[%u] Found %s function %s (description %s), returned %s", current_id, (fun ? "specific" : "generic"), - decl_name.c_str(), + decl_name.c_str(), + ss.GetData(), ast_dumper.GetCString()); } } |