summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2012-12-10 19:55:53 +0000
committerEnrico Granata <egranata@apple.com>2012-12-10 19:55:53 +0000
commitecbabe6d6698be496f268f98f8309bbf207fd94a (patch)
tree31ad600d6fbd0691d66818a827a4558f879a601c
parentcdf218d6060484a62cec5401add31c7480f8d14a (diff)
downloadbcm5719-llvm-ecbabe6d6698be496f268f98f8309bbf207fd94a.tar.gz
bcm5719-llvm-ecbabe6d6698be496f268f98f8309bbf207fd94a.zip
<rdar://problem/12848118>
Making MightHaveChildren() always return true regardless for our own data formatters This is meant to optimize performance for common most-often-not-empty container classes llvm-svn: 169759
-rw-r--r--lldb/examples/synthetic/gnu_libstdcpp.py22
-rw-r--r--lldb/examples/synthetic/libcxx.py27
-rw-r--r--lldb/source/Core/CXXFormatterFunctions.cpp20
3 files changed, 11 insertions, 58 deletions
diff --git a/lldb/examples/synthetic/gnu_libstdcpp.py b/lldb/examples/synthetic/gnu_libstdcpp.py
index 0d124d75865..1cc92a75428 100644
--- a/lldb/examples/synthetic/gnu_libstdcpp.py
+++ b/lldb/examples/synthetic/gnu_libstdcpp.py
@@ -133,24 +133,6 @@ class StdListSynthProvider:
pass
def has_children(self):
- logger = lldb.formatters.Logger.Logger()
- if self.count == None:
- self.update ()
- try:
- next_val = self.next.GetValueAsUnsigned(0)
- prev_val = self.prev.GetValueAsUnsigned(0)
- if next_val == 0 or prev_val == 0:
- return False
- if next_val == self.node_address:
- return False
- # skip all the advanced logic to detect the exact count of children
- # in the interest of speed from this point on, we MIGHT have children
- # our loop detection logic will still make nothing show up :)
- return True
- except:
- return False
- if self.count == 0:
- return False
return True
class StdVectorSynthProvider:
@@ -249,7 +231,7 @@ class StdVectorSynthProvider:
def has_children(self):
- return self.num_children() > 0
+ return True
class StdMapSynthProvider:
@@ -434,7 +416,7 @@ class StdMapSynthProvider:
return x;
def has_children(self):
- return self.num_children() > 0
+ return True
_map_capping_size = 255
_list_capping_size = 255
diff --git a/lldb/examples/synthetic/libcxx.py b/lldb/examples/synthetic/libcxx.py
index 8c58ae52faa..815c76f78ad 100644
--- a/lldb/examples/synthetic/libcxx.py
+++ b/lldb/examples/synthetic/libcxx.py
@@ -125,8 +125,7 @@ class stdvector_SynthProvider:
pass
def has_children(self):
- # retrieving the count is quick enough on a std::vector
- return self.num_children() > 0
+ return True
# Just an example: the actual summary is produced by a summary string: size=${svar%#}
def stdvector_SummaryProvider(valobj,dict):
@@ -322,24 +321,6 @@ class stdlist_SynthProvider:
pass
def has_children(self):
- logger = lldb.formatters.Logger.Logger()
- if self.count == None:
- self.update()
- try:
- next_val = self.head.GetValueAsUnsigned(0)
- prev_val = self.tail.GetValueAsUnsigned(0)
- if next_val == 0 or prev_val == 0:
- return False
- if next_val == self.node_address:
- return False
- # skip all the advanced logic to detect the exact count of children
- # in the interest of speed from this point on, we MIGHT have children
- # our loop detection logic will still make nothing show up :)
- return True
- except:
- return 0;
- if self.count == 0:
- return False
return True
@@ -504,7 +485,7 @@ class stdmap_SynthProvider:
return 0;
def has_children(self):
- return self.num_children_impl() > 0
+ return True
def get_data_type(self):
logger = lldb.formatters.Logger.Logger()
@@ -629,9 +610,7 @@ class stddeque_SynthProvider:
return min(self.count, _deque_capping_size)
def has_children(self):
- if self.cont is None:
- self.update()
- return self.count > 0
+ return True
def get_child_index(self,name):
logger = lldb.formatters.Logger.Logger()
diff --git a/lldb/source/Core/CXXFormatterFunctions.cpp b/lldb/source/Core/CXXFormatterFunctions.cpp
index a147ed0fbee..3dc48c560f5 100644
--- a/lldb/source/Core/CXXFormatterFunctions.cpp
+++ b/lldb/source/Core/CXXFormatterFunctions.cpp
@@ -833,9 +833,7 @@ lldb_private::formatters::NSArrayMSyntheticFrontEnd::Update()
bool
lldb_private::formatters::NSArrayMSyntheticFrontEnd::MightHaveChildren ()
{
- if (!m_data_32 && !m_data_64)
- Update ();
- return CalculateNumChildren();
+ return true;
}
static uint32_t
@@ -950,9 +948,7 @@ lldb_private::formatters::NSArrayISyntheticFrontEnd::Update()
bool
lldb_private::formatters::NSArrayISyntheticFrontEnd::MightHaveChildren ()
{
- if (!m_data_ptr)
- Update ();
- return CalculateNumChildren();
+ return true;
}
lldb::ValueObjectSP
@@ -1052,7 +1048,7 @@ lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::Update()
bool
lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::MightHaveChildren ()
{
- return CalculateNumChildren() > 0;
+ return true;
}
uint32_t
@@ -1149,7 +1145,7 @@ lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::Update()
bool
lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::MightHaveChildren ()
{
- return CalculateNumChildren() > 0;
+ return true;
}
uint32_t
@@ -1247,9 +1243,7 @@ lldb_private::formatters::NSDictionaryISyntheticFrontEnd::Update()
bool
lldb_private::formatters::NSDictionaryISyntheticFrontEnd::MightHaveChildren ()
{
- if (!m_data_32 && !m_data_64)
- Update ();
- return CalculateNumChildren();
+ return true;
}
lldb::ValueObjectSP
@@ -1396,9 +1390,7 @@ lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::Update()
bool
lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::MightHaveChildren ()
{
- if (!m_data_32 && !m_data_64)
- Update ();
- return CalculateNumChildren();
+ return true;
}
lldb::ValueObjectSP
OpenPOWER on IntegriCloud