Don't put modules for .o files into the global shared module list. We
used to do this because we needed to find the shared pointer for a .o
file when the .o file's module was needed in a SymbolContext since the
module in a symbol context was a shared pointer. Now that we are using
intrusive pointers we don't have this limitation anymore since any
instrusive shared pointer can be made from a pointer to an object
all on its own.

Also switched over to having the Module and SymbolVendor use shared 
pointers to their object files as had a leak on MacOSX when the 
SymbolVendor's object file wasn't the same as the Module's (debug info
in a stand along file (dSYM file)). Now everything will correctly clean
itself up when the module goes away after an executable gets rebuilt.

Now we correctly get rid of .o files that are used with the DWARF with 
debug map executables on subsequent runs since the only shared pointer
to the object files in from the DWARF symbol file debug map parser, and
when the module gets replaced, it destroys to old one along with all .o 
files. 

Also added a small optimization when using BSD archives where we will
remove old BSD containers from the shared list when they are outdated.

llvm-svn: 140002
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
index f615dc4..92c6f8f 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -166,19 +166,14 @@
         if (oso_symbol)
         {
             FileSpec oso_file_spec(oso_symbol->GetMangled().GetName().AsCString(), true);
-            // Don't allow cached .o files since we dress up each .o file with
-            // new sections. We want them to be in the module list so we can 
-            // always find a shared pointer to the module but just don't share them.
-            const bool always_create = true;
-            ModuleList::GetSharedModule (oso_file_spec,
-                                         m_obj_file->GetModule()->GetArchitecture(),
-                                         NULL,  // lldb_private::UUID pointer
-                                         NULL,  // object name
-                                         0,     // object offset
-                                         comp_unit_info->oso_module_sp,
-                                         NULL,
-                                         NULL,
-                                         always_create);
+            // Always create a new module for .o files. Why? Because we
+            // use the debug map, to add new sections to each .o file and
+            // even though a .o file might not have changed, the sections
+            // that get added to the .o file can change.
+            comp_unit_info->oso_module_sp = new Module (oso_file_spec, 
+                                                        m_obj_file->GetModule()->GetArchitecture(),
+                                                        NULL, 
+                                                        0);
         }
     }
     return comp_unit_info->oso_module_sp.get();