Several performance-oriented changes to the introspecting data formatters:
 (a) the SystemParameters object is now passed around to the formatters; doing so enables the formatters to reuse computed values for things such as pointer-size and endianness
     instead of repeatedly computing these on their own
 (b) replacing the global ISA cache with a per-process one
 (c) providing a per-process types cache where each formatter can store the types it needs to operate, and be sure to find them the next time without recalculating them
     this also enables formatters to share types if they agree on a local naming convention
 (d) lazy fetching of data from Objective-C runtime data structures
     data is fetched as needed and we stop reading as soon as we determine that an ISA is actually garbage

llvm-svn: 152052
diff --git a/lldb/examples/summaries/cocoa/CFString.py b/lldb/examples/summaries/cocoa/CFString.py
index c954ae4..ad2a1e4 100644
--- a/lldb/examples/summaries/cocoa/CFString.py
+++ b/lldb/examples/summaries/cocoa/CFString.py
@@ -102,10 +102,7 @@
 				return self.handle_unicode_string_safe();
 			else:
 				# a full pointer is skipped here before getting to the live data
-				if self.is_64_bit == False:
-					pointer = pointer + 4
-				else:
-					pointer = pointer + 8;
+				pointer = pointer + self.pointer_size
 		else:
 			pointer = self.valobj.GetValueAsUnsigned(0) + self.size_of_cfruntime_base();
 			# read 8 bytes here and make an address out of them
@@ -123,19 +120,13 @@
 			"(char*)\"" + pystr.encode('utf-8') + "\"")
 
 	def handle_inline_explicit(self):
-		if self.is_64_bit:
-			offset = 24
-		else:
-			offset = 12
+		offset = 3*self.pointer_size
 		offset = offset + self.valobj.GetValueAsUnsigned(0)
 		return self.valobj.CreateValueFromExpression("content",
 				"(char*)(" + str(offset) + ")")
 
 	def handle_mutable_string(self):
-		if self.is_64_bit:
-			offset = 16
-		else:
-			offset = 8
+		offset = 2 * self.pointer_size
 		data = self.valobj.CreateChildAtOffset("content",
 			offset, self.valobj.GetType().GetBasicType(lldb.eBasicTypeChar).GetPointerType());
 		data_value = data.GetValueAsUnsigned(0)
@@ -208,21 +199,12 @@
 		if name == "special":
 			return 4;
 
-	def is_64bit(self):
-		return self.valobj.GetTarget().GetProcess().GetAddressByteSize() == 8
-
-	def is_little_endian(self):
-		return self.valobj.GetTarget().GetProcess().GetByteOrder() == lldb.eByteOrderLittle
-
 	# CFRuntimeBase is defined as having an additional
 	# 4 bytes (padding?) on LP64 architectures
 	# to get its size we add up sizeof(pointer)+4
 	# and then add 4 more bytes if we are on a 64bit system
 	def size_of_cfruntime_base(self):
-		if self.is_64_bit == True:
-			return 8+4+4;
-		else:
-			return 4+4;
+		return self.pointer_size+4+(4 if self.is_64_bit else 0)
 
 	# the info bits are part of the CFRuntimeBase structure
 	# to get at them we have to skip a uintptr_t and then get
@@ -230,10 +212,7 @@
 	# on big-endian this means going to byte 3, if we are on
 	# little endian (OSX & iOS), this means reading byte 0
 	def offset_of_info_bits(self):
-		if self.is_64_bit == True:
-			offset = 8;
-		else:
-			offset = 4;
+		offset = self.pointer_size
 		if self.is_little == False:
 			offset = offset + 3;
 		return offset;
@@ -278,8 +257,9 @@
 	# preparing ourselves to read into memory
 	# by adjusting architecture-specific info
 	def adjust_for_architecture(self):
-		self.is_64_bit = self.is_64bit();
-		self.is_little = self.is_little_endian();
+		self.pointer_size = self.valobj.GetTarget().GetProcess().GetAddressByteSize()
+		self.is_64_bit = self.pointer_size == 8
+		self.is_little = self.valobj.GetTarget().GetProcess().GetByteOrder() == lldb.eByteOrderLittle
 
 	# reading info bits out of the CFString and computing
 	# useful values to get at the real data