summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-03-26 23:03:23 +0000
committerGreg Clayton <gclayton@apple.com>2012-03-26 23:03:23 +0000
commit84db9105d24a326f35054f103fbb468eb6d9bfeb (patch)
treef2d1a6c18e9f3b6843cba0e65ed5c89ac3fbbfcd /lldb/source/Expression
parent98e5d863ad3515ff119d120a1eb40c1c6a345443 (diff)
downloadbcm5719-llvm-84db9105d24a326f35054f103fbb468eb6d9bfeb.tar.gz
bcm5719-llvm-84db9105d24a326f35054f103fbb468eb6d9bfeb.zip
<rdar://problem/11113279>
Fixed type lookups to "do the right thing". Prior to this fix, looking up a type using "foo::bar" would result in a type list that contains all types that had "bar" as a basename unless the symbol file was able to match fully qualified names (which our DWARF parser does not). This fix will allow type matches to be made based on the basename and then have the types that don't match filtered out. Types by name can be fully qualified, or partially qualified with the new "bool exact_match" parameter to the Module::FindTypes() method. This fixes some issue that we discovered with dynamic type resolution as well as improves the overall type lookups in LLDB. llvm-svn: 153482
Diffstat (limited to 'lldb/source/Expression')
-rw-r--r--lldb/source/Expression/ClangASTSource.cpp10
-rw-r--r--lldb/source/Expression/ClangFunction.cpp9
2 files changed, 12 insertions, 7 deletions
diff --git a/lldb/source/Expression/ClangASTSource.cpp b/lldb/source/Expression/ClangASTSource.cpp
index 08f63b5c8f8..9933ed1976e 100644
--- a/lldb/source/Expression/ClangASTSource.cpp
+++ b/lldb/source/Expression/ClangASTSource.cpp
@@ -206,7 +206,7 @@ ClangASTSource::CompleteType (TagDecl *tag_decl)
SymbolContext null_sc;
ConstString name(tag_decl->getName().str().c_str());
- i->first->FindTypes(null_sc, name, &i->second, true, UINT32_MAX, types);
+ i->first->FindTypesInNamespace(null_sc, name, &i->second, UINT32_MAX, types);
for (uint32_t ti = 0, te = types.GetSize();
ti != te && !found;
@@ -244,7 +244,8 @@ ClangASTSource::CompleteType (TagDecl *tag_decl)
ModuleList &module_list = m_target->GetImages();
- module_list.FindTypes(null_sc, name, true, UINT32_MAX, types);
+ bool exact_match = false;
+ module_list.FindTypes2 (null_sc, name, exact_match, UINT32_MAX, types);
for (uint32_t ti = 0, te = types.GetSize();
ti != te && !found;
@@ -592,11 +593,12 @@ ClangASTSource::FindExternalVisibleDecls (NameSearchContext &context,
{
TypeList types;
SymbolContext null_sc;
+ const bool exact_match = false;
if (module_sp && namespace_decl)
- module_sp->FindTypes(null_sc, name, &namespace_decl, true, 1, types);
+ module_sp->FindTypesInNamespace(null_sc, name, &namespace_decl, 1, types);
else
- m_target->GetImages().FindTypes(null_sc, name, true, 1, types);
+ m_target->GetImages().FindTypes2(null_sc, name, exact_match, 1, types);
if (types.GetSize())
{
diff --git a/lldb/source/Expression/ClangFunction.cpp b/lldb/source/Expression/ClangFunction.cpp
index a3d177cf4c1..a6344f925ee 100644
--- a/lldb/source/Expression/ClangFunction.cpp
+++ b/lldb/source/Expression/ClangFunction.cpp
@@ -113,7 +113,8 @@ ClangFunction::CompileFunction (Stream &errors)
// FIXME: How does clang tell us there's no return value? We need to handle that case.
unsigned num_errors = 0;
- std::string return_type_str (ClangASTType::GetTypeNameForOpaqueQualType (m_function_return_qual_type));
+ std::string return_type_str (ClangASTType::GetTypeNameForOpaqueQualType (m_clang_ast_context->getASTContext(),
+ m_function_return_qual_type));
// Cons up the function we're going to wrap our call in, then compile it...
// We declare the function "extern "C"" because the compiler might be in C++
@@ -159,7 +160,8 @@ ClangFunction::CompileFunction (Stream &errors)
if (trust_function)
{
lldb::clang_type_t arg_clang_type = m_function_ptr->GetArgumentTypeAtIndex(i);
- type_name = ClangASTType::GetTypeNameForOpaqueQualType (arg_clang_type);
+ type_name = ClangASTType::GetTypeNameForOpaqueQualType (m_clang_ast_context->getASTContext(),
+ arg_clang_type);
}
else
{
@@ -167,7 +169,8 @@ ClangFunction::CompileFunction (Stream &errors)
lldb::clang_type_t clang_qual_type = arg_value->GetClangType ();
if (clang_qual_type != NULL)
{
- type_name = ClangASTType::GetTypeNameForOpaqueQualType (clang_qual_type);
+ type_name = ClangASTType::GetTypeNameForOpaqueQualType (m_clang_ast_context->getASTContext(),
+ clang_qual_type);
}
else
{
OpenPOWER on IntegriCloud