<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
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index 3a78854..4f1d77a 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -1038,10 +1038,10 @@
}
bool
-ClangASTContext::AreTypesSame(ASTContext *ast,
- clang_type_t type1,
- clang_type_t type2,
- bool ignore_qualifiers)
+ClangASTContext::AreTypesSame (ASTContext *ast,
+ clang_type_t type1,
+ clang_type_t type2,
+ bool ignore_qualifiers)
{
QualType type1_qual = QualType::getFromOpaquePtr(type1);
QualType type2_qual = QualType::getFromOpaquePtr(type2);
@@ -3797,7 +3797,7 @@
// Base classes should be a multiple of 8 bits in size
child_byte_offset = bit_offset/8;
- child_name = ClangASTType::GetTypeNameForQualType(base_class->getType());
+ child_name = ClangASTType::GetTypeNameForQualType(ast, base_class->getType());
uint64_t clang_type_info_bit_size = ast->getTypeSize(base_class->getType());
@@ -4662,7 +4662,7 @@
if (omit_empty_base_classes && RecordHasFields(base_class_decl) == false)
continue;
- std::string base_class_type_name (ClangASTType::GetTypeNameForQualType(base_class->getType()));
+ std::string base_class_type_name (ClangASTType::GetTypeNameForQualType(ast, base_class->getType()));
if (base_class_type_name.compare (name) == 0)
return child_idx;
++child_idx;