<rdar://problem/12632394>

Add a format for FourCharCode

This is now safe to do thanks to the "formats in categories" feature

llvm-svn: 192233
diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp
index b67cfb2..e8bc54f 100644
--- a/lldb/source/DataFormatters/FormatManager.cpp
+++ b/lldb/source/DataFormatters/FormatManager.cpp
@@ -563,6 +563,22 @@
 }
 
 static void
+AddFormat (TypeCategoryImpl::SharedPointer category_sp,
+           lldb::Format format,
+           ConstString type_name,
+           TypeFormatImpl::Flags flags,
+           bool regex = false)
+{
+    lldb::TypeFormatImplSP format_sp(new TypeFormatImpl(format, flags));
+    
+    if (regex)
+        category_sp->GetRegexValueNavigator()->Add(RegularExpressionSP(new RegularExpression(type_name.AsCString())),format_sp);
+    else
+        category_sp->GetValueNavigator()->Add(type_name, format_sp);
+}
+
+
+static void
 AddStringSummary(TypeCategoryImpl::SharedPointer category_sp,
                  const char* string,
                  ConstString type_name,
@@ -854,6 +870,11 @@
 
     AddCXXSummary(sys_category_sp, lldb_private::formatters::Char16SummaryProvider, "unichar summary provider", ConstString("unichar"), widechar_flags);
     
+    TypeFormatImpl::Flags fourchar_flags;
+    fourchar_flags.SetCascades(true).SetSkipPointers(true).SetSkipReferences(true);
+    
+    AddFormat(sys_category_sp, lldb::eFormatOSType, ConstString("FourCharCode"), fourchar_flags);
+    
 #endif
 }