SymbolVendor: Remove the object file member variable

Summary:
The last responsibility of the SymbolVendor was to hold an owning
reference to the object file (in case symbols are being read from a
different file than the main module). As SymbolFile classes already hold
a non-owning reference to the object file, we can easily remove this
responsibility of the SymbolVendor by making the SymbolFile reference
owning.

Reviewers: JDevlieghere, clayborg, jingham

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D65401

llvm-svn: 367392
diff --git a/lldb/source/Symbol/SymbolFile.cpp b/lldb/source/Symbol/SymbolFile.cpp
index b88a268..afc2abb 100644
--- a/lldb/source/Symbol/SymbolFile.cpp
+++ b/lldb/source/Symbol/SymbolFile.cpp
@@ -32,23 +32,23 @@
   return GetObjectFile()->GetModule()->GetMutex();
 }
 ObjectFile *SymbolFile::GetMainObjectFile() {
-  return m_obj_file->GetModule()->GetObjectFile();
+  return m_objfile_sp->GetModule()->GetObjectFile();
 }
 
-SymbolFile *SymbolFile::FindPlugin(ObjectFile *obj_file) {
+SymbolFile *SymbolFile::FindPlugin(ObjectFileSP objfile_sp) {
   std::unique_ptr<SymbolFile> best_symfile_up;
-  if (obj_file != nullptr) {
+  if (objfile_sp != nullptr) {
 
     // We need to test the abilities of this section list. So create what it
-    // would be with this new obj_file.
-    lldb::ModuleSP module_sp(obj_file->GetModule());
+    // would be with this new objfile_sp.
+    lldb::ModuleSP module_sp(objfile_sp->GetModule());
     if (module_sp) {
       // Default to the main module section list.
       ObjectFile *module_obj_file = module_sp->GetObjectFile();
-      if (module_obj_file != obj_file) {
+      if (module_obj_file != objfile_sp.get()) {
         // Make sure the main object file's sections are created
         module_obj_file->GetSectionList();
-        obj_file->CreateSections(*module_sp->GetUnifiedSectionList());
+        objfile_sp->CreateSections(*module_sp->GetUnifiedSectionList());
       }
     }
 
@@ -62,7 +62,7 @@
          (create_callback = PluginManager::GetSymbolFileCreateCallbackAtIndex(
               idx)) != nullptr;
          ++idx) {
-      std::unique_ptr<SymbolFile> curr_symfile_up(create_callback(obj_file));
+      std::unique_ptr<SymbolFile> curr_symfile_up(create_callback(objfile_sp));
 
       if (curr_symfile_up) {
         const uint32_t sym_file_abilities = curr_symfile_up->GetAbilities();
@@ -88,7 +88,7 @@
 llvm::Expected<TypeSystem &>
 SymbolFile::GetTypeSystemForLanguage(lldb::LanguageType language) {
   auto type_system_or_err =
-      m_obj_file->GetModule()->GetTypeSystemForLanguage(language);
+      m_objfile_sp->GetModule()->GetTypeSystemForLanguage(language);
   if (type_system_or_err) {
     type_system_or_err->SetSymbolFile(this);
   }