Instead of having an UnwindTable own a single assembly profiler, 
and sharing it with all of its FuncUnwinders, have each FuncUnwinder
create an AssemblyProfiler on demand as needed.  I was worried that
the cost of creating the llvm disassemblers would be high for this
approach but it's not supposed to be an expensive operation, and it
means we don't need to add locks around this section of code.
<rdar://problem/16992332> 

llvm-svn: 209493
diff --git a/lldb/source/Symbol/UnwindTable.cpp b/lldb/source/Symbol/UnwindTable.cpp
index 60d919e..9aaacb3 100644
--- a/lldb/source/Symbol/UnwindTable.cpp
+++ b/lldb/source/Symbol/UnwindTable.cpp
@@ -17,7 +17,6 @@
 #include "lldb/Symbol/FuncUnwinders.h"
 #include "lldb/Symbol/SymbolContext.h"
 #include "lldb/Symbol/DWARFCallFrameInfo.h"
-#include "lldb/Target/UnwindAssembly.h"
 
 // There is one UnwindTable object per ObjectFile.
 // It contains a list of Unwind objects -- one per function, populated lazily -- for the ObjectFile.
@@ -30,7 +29,6 @@
     m_object_file (objfile), 
     m_unwinds (),
     m_initialized (false),
-    m_assembly_profiler (nullptr),
     m_eh_frame (nullptr)
 {
 }
@@ -54,12 +52,7 @@
         }
     }
     
-    ArchSpec arch;
-    if (m_object_file.GetArchitecture (arch))
-    {
-        m_assembly_profiler = UnwindAssembly::FindPlugin (arch);
-        m_initialized = true;
-    }
+    m_initialized = true;
 }
 
 UnwindTable::~UnwindTable ()
@@ -100,7 +93,7 @@
         }
     }
 
-    FuncUnwindersSP func_unwinder_sp(new FuncUnwinders(*this, m_assembly_profiler, range));
+    FuncUnwindersSP func_unwinder_sp(new FuncUnwinders(*this, range));
     m_unwinds.insert (insert_pos, std::make_pair(range.GetBaseAddress().GetFileAddress(), func_unwinder_sp));
 //    StreamFile s(stdout, false);
 //    Dump (s);
@@ -127,7 +120,7 @@
         }
     }
 
-    FuncUnwindersSP func_unwinder_sp(new FuncUnwinders(*this, m_assembly_profiler, range));
+    FuncUnwindersSP func_unwinder_sp(new FuncUnwinders(*this, range));
     return func_unwinder_sp;
 }
 
@@ -151,3 +144,9 @@
     Initialize();
     return m_eh_frame;
 }
+
+bool
+UnwindTable::GetArchitecture (lldb_private::ArchSpec &arch)
+{
+    return m_object_file.GetArchitecture (arch);
+}