diff options
author | Sean Callanan <scallanan@apple.com> | 2010-10-06 00:10:07 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2010-10-06 00:10:07 +0000 |
commit | 2ab40fecf6fd8eb44ccd4d8b2ae7e849a008343b (patch) | |
tree | 3c45d60ba76472a63e5a7ee7aa5ec6e763eb3b2f /lldb/source/Expression/ClangExpressionDeclMap.cpp | |
parent | 04c342ea20e0c39a03a4116c924d09a36e1399d6 (diff) | |
download | bcm5719-llvm-2ab40fecf6fd8eb44ccd4d8b2ae7e849a008343b.tar.gz bcm5719-llvm-2ab40fecf6fd8eb44ccd4d8b2ae7e849a008343b.zip |
Updated the expression parser to ignore non-external
functions it finds in libraries unless it cannot find
an external function with the desired name.
llvm-svn: 115721
Diffstat (limited to 'lldb/source/Expression/ClangExpressionDeclMap.cpp')
-rw-r--r-- | lldb/source/Expression/ClangExpressionDeclMap.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index b98ff23f28f..8937571014f 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -945,8 +945,9 @@ ClangExpressionDeclMap::GetDecls(NameSearchContext &context, m_sym_ctx->FindFunctionsByName(name_cs, false, sym_ctxs); - bool found_generic = false; bool found_specific = false; + Symbol *generic_symbol = NULL; + Symbol *non_extern_symbol = NULL; for (uint32_t index = 0, num_indices = sym_ctxs.GetSize(); index < num_indices; @@ -954,7 +955,7 @@ ClangExpressionDeclMap::GetDecls(NameSearchContext &context, { SymbolContext sym_ctx; sym_ctxs.GetContextAtIndex(index, sym_ctx); - + if (sym_ctx.function) { // TODO only do this if it's a C function; C++ functions may be @@ -963,16 +964,23 @@ ClangExpressionDeclMap::GetDecls(NameSearchContext &context, AddOneFunction(context, sym_ctx.function, NULL); found_specific = true; } - else if(sym_ctx.symbol) + else if (sym_ctx.symbol) { - if (!found_generic && !found_specific) - { - AddOneFunction(context, NULL, sym_ctx.symbol); - found_generic = true; - } + if (sym_ctx.symbol->IsExternal()) + generic_symbol = sym_ctx.symbol; + else + non_extern_symbol = sym_ctx.symbol; } } + if (!found_specific) + { + if (generic_symbol) + AddOneFunction(context, NULL, generic_symbol); + else if (non_extern_symbol) + AddOneFunction(context, NULL, non_extern_symbol); + } + Variable *var = FindVariableInScope(*m_exe_ctx->frame, name); if (var) |