diff options
author | Greg Clayton <gclayton@apple.com> | 2018-04-30 21:06:30 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2018-04-30 21:06:30 +0000 |
commit | c485f056b7766e4e52b91bc5f462bb2d1d8cca8a (patch) | |
tree | de8b6c6ace70ad291629bdc6b1c8b1f7a68fa16e /lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp | |
parent | dab8515370c7fd43782e72c46333e801454219cc (diff) | |
download | bcm5719-llvm-c485f056b7766e4e52b91bc5f462bb2d1d8cca8a.tar.gz bcm5719-llvm-c485f056b7766e4e52b91bc5f462bb2d1d8cca8a.zip |
Fix expression parser to not accept any type whose basename matches for a type that must exist at root level
This patch fixes an issue where we weren't looking for exact matches in the expression parser and also fixed the type lookup logic in the Module.cpp. Tests added to make sure we don't regress.
Differential Revision: https://reviews.llvm.org/D46128
llvm-svn: 331227
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp')
-rw-r--r-- | lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp index c26b1a615a1..d98a2b25fbb 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp @@ -861,13 +861,16 @@ void ClangASTSource::FindExternalVisibleDecls( TypeList types; SymbolContext null_sc; - const bool exact_match = false; + const bool exact_match = true; llvm::DenseSet<lldb_private::SymbolFile *> searched_symbol_files; if (module_sp && namespace_decl) module_sp->FindTypesInNamespace(null_sc, name, &namespace_decl, 1, types); - else - m_target->GetImages().FindTypes(null_sc, name, exact_match, 1, + else { + SymbolContext sc; + sc.module_sp = module_sp; + m_target->GetImages().FindTypes(sc, name, exact_match, 1, searched_symbol_files, types); + } if (size_t num_types = types.GetSize()) { for (size_t ti = 0; ti < num_types; ++ti) { |