diff options
author | Paul Herman <paulherman@google.com> | 2015-09-16 18:48:30 +0000 |
---|---|---|
committer | Paul Herman <paulherman@google.com> | 2015-09-16 18:48:30 +0000 |
commit | ea188fc318a0df1e4bb5a8857d26fad456d0b1ee (patch) | |
tree | c1ae88dc714d4b8e85a71be406033ebd1d396e5b /lldb/source/Expression/ClangExpressionDeclMap.cpp | |
parent | 459a64aed70f5e74f80bf081c9ebc827274fbd1e (diff) | |
download | bcm5719-llvm-ea188fc318a0df1e4bb5a8857d26fad456d0b1ee.tar.gz bcm5719-llvm-ea188fc318a0df1e4bb5a8857d26fad456d0b1ee.zip |
Add using directives to the clang::DeclContext and fix decls for variables inside namespaces
Summary: Supports the parsing of the "using namespace XXX" and "using XXX::XXX" directives. Added ambiguity errors when it two decls with the same name are encountered (see comments in TestCppNsImport). Fixes using directives being duplicated for anonymous namespaces. Fixes GetDeclForUID for specification DIEs.
Reviewers: sivachandra, chaoren, clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D12897
llvm-svn: 247836
Diffstat (limited to 'lldb/source/Expression/ClangExpressionDeclMap.cpp')
-rw-r--r-- | lldb/source/Expression/ClangExpressionDeclMap.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index 1678d835227..235288ab783 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -1351,7 +1351,6 @@ ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context, { ValueObjectSP valobj; VariableSP var; - Error err; if (frame && !namespace_decl) { @@ -1366,17 +1365,21 @@ ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context, // Search for declarations matching the name std::vector<CompilerDecl> found_decls = compiler_decl_context.FindDeclByName(name); + + bool variable_found = false; for (CompilerDecl decl : found_decls) { var = decl.GetAsVariable(); if (var) { + variable_found = true; valobj = ValueObjectVariable::Create(frame, var); AddOneVariable(context, var, valobj, current_id); context.m_found.variable = true; - return; } } + if (variable_found) + return; } } if (target) |