The lldb unwinder can now use the unwind information from the compact-unwind 
section for x86_64 and i386 targets on Darwin systems.  Currently only the
compact unwind encoding for normal frame-using functions is supported but it
will be easy handle frameless functions when I have a bit more free time to
test it.  The LSDA and personality routines for functions are also retrieved
correctly for functions from the compact unwind section.

This new code is very fresh -- it passes the lldb testsuite and I've done
by-hand inspection of many functions and am getting correct behavior for all
of them.  There may need to be some bug fixing over the next couple weeks as
I exercise and test it further.  But I think it's fine right now so I'm
committing it.

<rdar://problem/13220837> 

llvm-svn: 223625
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 796b92c..5aaf90a 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -1276,7 +1276,9 @@
                     const lldb::SectionType section_type = section_sp->GetType();
                     switch (section_type)
                     {
-                    case eSectionTypeInvalid:               return eAddressClassUnknown;
+                    case eSectionTypeInvalid:
+                        return eAddressClassUnknown;
+
                     case eSectionTypeCode:
                         if (m_header.cputype == llvm::MachO::CPU_TYPE_ARM)
                         {
@@ -1287,7 +1289,9 @@
                         }
                         return eAddressClassCode;
 
-                    case eSectionTypeContainer:             return eAddressClassUnknown;
+                    case eSectionTypeContainer:
+                        return eAddressClassUnknown;
+
                     case eSectionTypeData:
                     case eSectionTypeDataCString:
                     case eSectionTypeDataCStringPointers:
@@ -1300,6 +1304,7 @@
                     case eSectionTypeDataObjCMessageRefs:
                     case eSectionTypeDataObjCCFStrings:
                         return eAddressClassData;
+
                     case eSectionTypeDebug:
                     case eSectionTypeDWARFDebugAbbrev:
                     case eSectionTypeDWARFDebugAranges:
@@ -1317,12 +1322,17 @@
                     case eSectionTypeDWARFAppleNamespaces:
                     case eSectionTypeDWARFAppleObjC:
                         return eAddressClassDebug;
-                    case eSectionTypeEHFrame:               return eAddressClassRuntime;
+
+                    case eSectionTypeEHFrame:
+                    case eSectionTypeCompactUnwind:
+                        return eAddressClassRuntime;
+
                     case eSectionTypeELFSymbolTable:
                     case eSectionTypeELFDynamicSymbols:
                     case eSectionTypeELFRelocationEntries:
                     case eSectionTypeELFDynamicLinkInfo:
-                    case eSectionTypeOther:                 return eAddressClassUnknown;
+                    case eSectionTypeOther:
+                        return eAddressClassUnknown;
                     }
                 }
             }
@@ -1745,6 +1755,7 @@
                                     static ConstString g_sect_name_dwarf_apple_namespaces ("__apple_namespac");
                                     static ConstString g_sect_name_dwarf_apple_objc ("__apple_objc");
                                     static ConstString g_sect_name_eh_frame ("__eh_frame");
+                                    static ConstString g_sect_name_compact_unwind ("__unwind_info");
                                     static ConstString g_sect_name_text ("__text");
                                     static ConstString g_sect_name_data ("__data");
 
@@ -1785,6 +1796,8 @@
                                         sect_type = eSectionTypeDataObjCMessageRefs;
                                     else if (section_name == g_sect_name_eh_frame)
                                         sect_type = eSectionTypeEHFrame;
+                                    else if (section_name == g_sect_name_compact_unwind)
+                                        sect_type = eSectionTypeCompactUnwind;
                                     else if (section_name == g_sect_name_cfstring)
                                         sect_type = eSectionTypeDataObjCCFStrings;
                                     else if (section_name == g_sect_name_objc_data ||