<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



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@169759 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/examples/synthetic/gnu_libstdcpp.py b/examples/synthetic/gnu_libstdcpp.py
index 0d124d7..1cc92a7 100644
--- a/examples/synthetic/gnu_libstdcpp.py
+++ b/examples/synthetic/gnu_libstdcpp.py
@@ -133,24 +133,6 @@
 			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 @@
 			
 
 	def has_children(self):
-		return self.num_children() > 0
+		return True
 
 
 class StdMapSynthProvider:
@@ -434,7 +416,7 @@
 			return x;
 
 	def has_children(self):
-		return self.num_children() > 0
+		return True
 
 _map_capping_size = 255
 _list_capping_size = 255
diff --git a/examples/synthetic/libcxx.py b/examples/synthetic/libcxx.py
index 8c58ae5..815c76f 100644
--- a/examples/synthetic/libcxx.py
+++ b/examples/synthetic/libcxx.py
@@ -125,8 +125,7 @@
 			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 @@
 			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 @@
 			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 @@
         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/source/Core/CXXFormatterFunctions.cpp b/source/Core/CXXFormatterFunctions.cpp
index a147ed0..3dc48c5 100644
--- a/source/Core/CXXFormatterFunctions.cpp
+++ b/source/Core/CXXFormatterFunctions.cpp
@@ -833,9 +833,7 @@
 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 @@
 bool
 lldb_private::formatters::NSArrayISyntheticFrontEnd::MightHaveChildren ()
 {
-    if (!m_data_ptr)
-        Update ();
-    return CalculateNumChildren();
+    return true;
 }
 
 lldb::ValueObjectSP
@@ -1052,7 +1048,7 @@
 bool
 lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::MightHaveChildren ()
 {
-    return CalculateNumChildren() > 0;
+    return true;
 }
 
 uint32_t
@@ -1149,7 +1145,7 @@
 bool
 lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::MightHaveChildren ()
 {
-    return CalculateNumChildren() > 0;
+    return true;
 }
 
 uint32_t
@@ -1247,9 +1243,7 @@
 bool
 lldb_private::formatters::NSDictionaryISyntheticFrontEnd::MightHaveChildren ()
 {
-    if (!m_data_32 && !m_data_64)
-        Update ();
-    return CalculateNumChildren();
+    return true;
 }
 
 lldb::ValueObjectSP
@@ -1396,9 +1390,7 @@
 bool
 lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::MightHaveChildren ()
 {
-    if (!m_data_32 && !m_data_64)
-        Update ();
-    return CalculateNumChildren();
+    return true;
 }
 
 lldb::ValueObjectSP