summaryrefslogtreecommitdiffstats
path: root/lldb/source
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-07-10 01:22:15 +0000
committerGreg Clayton <gclayton@apple.com>2012-07-10 01:22:15 +0000
commitcc0c4d4ae79421067dc1b9c7d30dd631d6fd605c (patch)
treec34158e9481b5bdebb77a0e623b9a53bf5fa228a /lldb/source
parent16b43dbbfe9f3616ea0b8e6fe26afc53b5c76937 (diff)
downloadbcm5719-llvm-cc0c4d4ae79421067dc1b9c7d30dd631d6fd605c.tar.gz
bcm5719-llvm-cc0c4d4ae79421067dc1b9c7d30dd631d6fd605c.zip
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
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp28
1 files changed, 23 insertions, 5 deletions
diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
index 869868546bd..1797ef20abc 100644
--- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
@@ -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)
OpenPOWER on IntegriCloud