Improve dynamic type resolution efficiency by looking for the type in the module that contains the vtable symbol first and only look for the first match. If we don't find anything, _then_ move on to the rest of the modules in the target and watch out for multiple matches.

llvm-svn: 159975
This commit is contained in:
Greg Clayton 2012-07-10 01:22:15 +00:00
parent 16b43dbbfe
commit cc0c4d4ae7
1 changed files with 23 additions and 5 deletions

View File

@ -119,11 +119,29 @@ ItaniumABILanguageRuntime::GetDynamicTypeAndAddress (ValueObject &in_value,
const bool exact_match = true;
TypeList class_types;
uint32_t num_matches = target->GetImages().FindTypes (sc,
ConstString(class_name),
exact_match,
UINT32_MAX,
class_types);
uint32_t num_matches = 0;
// First look in the module that the vtable symbol came from
// and look for a single exact match.
if (sc.module_sp)
{
num_matches = sc.module_sp->FindTypes (sc,
ConstString(class_name),
exact_match,
1,
class_types);
}
// If we didn't find a symbol, then move on to the entire
// module list in the target and get as many unique matches
// as possible
if (num_matches == 0)
{
num_matches = target->GetImages().FindTypes (sc,
ConstString(class_name),
exact_match,
UINT32_MAX,
class_types);
}
lldb::TypeSP type_sp;
if (num_matches == 0)