diff options
author | Sean Callanan <scallanan@apple.com> | 2011-10-12 18:00:53 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2011-10-12 18:00:53 +0000 |
commit | 4c3977c27897b84f5dfc2e38dfe14d2657005c88 (patch) | |
tree | f6c3de4bd6046b0019f7239f66322e84a206f7f5 /lldb/source/Expression/ClangExpressionDeclMap.cpp | |
parent | 04a101d475ab7b078f4f3ffa15fc8bebed3bc4a6 (diff) | |
download | bcm5719-llvm-4c3977c27897b84f5dfc2e38dfe14d2657005c88.tar.gz bcm5719-llvm-4c3977c27897b84f5dfc2e38dfe14d2657005c88.zip |
Added support to ClagnExpressionDeclMap for finding
data symbols in namespaces.
llvm-svn: 141792
Diffstat (limited to 'lldb/source/Expression/ClangExpressionDeclMap.cpp')
-rw-r--r-- | lldb/source/Expression/ClangExpressionDeclMap.cpp | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index 4256a1827e8..c28f26db7f9 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -1630,7 +1630,10 @@ ClangExpressionDeclMap::DoMaterializeOneVariable TypeFromUser type(expr_var->GetTypeFromUser()); VariableSP var = FindVariableInScope (*frame, name, &type); - Symbol *sym = FindGlobalDataSymbol(*target, name); + + ModuleSP module; + + Symbol *sym = FindGlobalDataSymbol(*target, module, name, NULL); std::auto_ptr<lldb_private::Value> location_value; @@ -1977,14 +1980,22 @@ Symbol * ClangExpressionDeclMap::FindGlobalDataSymbol ( Target &target, - const ConstString &name + ModuleSP &module, + const ConstString &name, + ClangNamespaceDecl *namespace_decl ) { SymbolContextList sc_list; - target.GetImages().FindSymbolsWithNameAndType(name, - eSymbolTypeData, - sc_list); + if (module && namespace_decl) + module->FindSymbolsWithNameAndType(name, + namespace_decl, + eSymbolTypeData, + sc_list); + else + target.GetImages().FindSymbolsWithNameAndType(name, + eSymbolTypeData, + sc_list); if (sc_list.GetSize()) { @@ -2430,7 +2441,17 @@ ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context, // We couldn't find a variable or function for this. Now we'll hunt for a generic // data symbol, and -- if it is found -- treat it as a variable. - Symbol *data_symbol = FindGlobalDataSymbol(*target, name); + Symbol *data_symbol; + + if (namespace_decl && module) + { + data_symbol = FindGlobalDataSymbol(*target, module, name, &namespace_decl); + } + else + { + ModuleSP module; + data_symbol = FindGlobalDataSymbol(*target, module, name, NULL); + } if (data_symbol) { |