summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ExpressionParser
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2016-07-05 22:06:01 +0000
committerSean Callanan <scallanan@apple.com>2016-07-05 22:06:01 +0000
commit8ba1654d488398d56c4a1c7514fa70216af929d7 (patch)
treeb3a1801339a6bffae385cc00771d374fba8c9776 /lldb/source/Plugins/ExpressionParser
parentb395d7271d11ba9e0337fb18f617e6c21cfeae9c (diff)
downloadbcm5719-llvm-8ba1654d488398d56c4a1c7514fa70216af929d7.tar.gz
bcm5719-llvm-8ba1654d488398d56c4a1c7514fa70216af929d7.zip
Fixed a bug where we report a single type multiple times in namespaces.
Also added a testcase. <rdar://problem/22786569> llvm-svn: 274580
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser')
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp13
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h1
2 files changed, 8 insertions, 6 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
index 923b8a8af04..def0d42d32d 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
@@ -743,6 +743,9 @@ ClangASTSource::FindExternalVisibleDecls (NameSearchContext &context,
do
{
+ if (context.m_found.type)
+ break;
+
TypeList types;
SymbolContext null_sc;
const bool exact_match = false;
@@ -751,8 +754,6 @@ ClangASTSource::FindExternalVisibleDecls (NameSearchContext &context,
module_sp->FindTypesInNamespace(null_sc, name, &namespace_decl, 1, types);
else
m_target->GetImages().FindTypes(null_sc, name, exact_match, 1, searched_symbol_files, types);
-
- bool found_a_type = false;
if (size_t num_types = types.GetSize())
{
@@ -785,12 +786,12 @@ ClangASTSource::FindExternalVisibleDecls (NameSearchContext &context,
context.AddTypeDecl(copied_clang_type);
- found_a_type = true;
+ context.m_found.type = true;
break;
}
}
- if (!found_a_type)
+ if (!context.m_found.type)
{
// Try the modules next.
@@ -835,13 +836,13 @@ ClangASTSource::FindExternalVisibleDecls (NameSearchContext &context,
context.AddNamedDecl(copied_named_decl);
- found_a_type = true;
+ context.m_found.type = true;
}
}
} while (0);
}
- if (!found_a_type)
+ if (!context.m_found.type)
{
do
{
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h
index 653675eb99d..13791d7e627 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h
@@ -431,6 +431,7 @@ struct NameSearchContext {
bool function_with_type_info : 1;
bool function : 1;
bool local_vars_nsp : 1;
+ bool type : 1;
} m_found;
//------------------------------------------------------------------
OpenPOWER on IntegriCloud