[Lldb-commits] [lldb] f012087 - [lldb] Remove unused functions in ObjectContainer (NFC)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 24 14:26:32 PDT 2022


Author: Jonas Devlieghere
Date: 2022-08-24T14:26:16-07:00
New Revision: f01208781fd72fca2c49c24c651bf0ce3bc0fb3e

URL: https://github.com/llvm/llvm-project/commit/f01208781fd72fca2c49c24c651bf0ce3bc0fb3e
DIFF: https://github.com/llvm/llvm-project/commit/f01208781fd72fca2c49c24c651bf0ce3bc0fb3e.diff

LOG: [lldb] Remove unused functions in ObjectContainer (NFC)

Added: 
    

Modified: 
    lldb/include/lldb/Symbol/ObjectContainer.h
    lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
    lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h
    lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
    lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Symbol/ObjectContainer.h b/lldb/include/lldb/Symbol/ObjectContainer.h
index 4f0c73693295e..41cae692f2e57 100644
--- a/lldb/include/lldb/Symbol/ObjectContainer.h
+++ b/lldb/include/lldb/Symbol/ObjectContainer.h
@@ -52,16 +52,6 @@ class ObjectContainer : public PluginInterface, public ModuleChild {
   /// from by the plug-in instance.
   ~ObjectContainer() override = default;
 
-  /// Dump a description of this object to a Stream.
-  ///
-  /// Dump a description of the current contents of this object to the
-  /// supplied stream \a s. The dumping should include the section list if it
-  /// has been parsed, and the symbol table if it has been parsed.
-  ///
-  /// \param[in] s
-  ///     The stream to which to dump the object description.
-  virtual void Dump(Stream *s) const = 0;
-
   /// Gets the architecture given an index.
   ///
   /// Copies the architecture specification for index \a idx.
@@ -142,20 +132,6 @@ class ObjectContainer : public PluginInterface, public ModuleChild {
   ///     file exists in the container.
   virtual lldb::ObjectFileSP GetObjectFile(const FileSpec *file) = 0;
 
-  virtual bool ObjectAtIndexIsContainer(uint32_t object_idx) { return false; }
-
-  virtual ObjectFile *GetObjectFileAtIndex(uint32_t object_idx) {
-    return nullptr;
-  }
-
-  virtual ObjectContainer *GetObjectContainerAtIndex(uint32_t object_idx) {
-    return nullptr;
-  }
-
-  virtual const char *GetObjectNameAtIndex(uint32_t object_idx) const {
-    return nullptr;
-  }
-
 protected:
   // Member variables.
   FileSpec m_file; ///< The file that represents this container objects (which

diff  --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
index 9fe222eceedca..957ecc223405a 100644
--- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
+++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
@@ -511,30 +511,6 @@ bool ObjectContainerBSDArchive::ParseHeader() {
   return m_archive_sp.get() != nullptr;
 }
 
-void ObjectContainerBSDArchive::Dump(Stream *s) const {
-  s->Printf("%p: ", static_cast<const void *>(this));
-  s->Indent();
-  const size_t num_archs = GetNumArchitectures();
-  const size_t num_objects = GetNumObjects();
-  s->Printf("ObjectContainerBSDArchive, num_archs = %" PRIu64
-            ", num_objects = %" PRIu64 "",
-            (uint64_t)num_archs, (uint64_t)num_objects);
-  uint32_t i;
-  ArchSpec arch;
-  s->IndentMore();
-  for (i = 0; i < num_archs; i++) {
-    s->Indent();
-    GetArchitectureAtIndex(i, arch);
-    s->Printf("arch[%u] = %s\n", i, arch.GetArchitectureName());
-  }
-  for (i = 0; i < num_objects; i++) {
-    s->Indent();
-    s->Printf("object[%u] = %s\n", i, GetObjectNameAtIndex(i));
-  }
-  s->IndentLess();
-  s->EOL();
-}
-
 FileSpec GetChildFileSpecificationsFromThin(llvm::StringRef childPath,
                                             const FileSpec &parentFileSpec) {
   llvm::SmallString<128> FullPath;

diff  --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h
index ace072cbe1498..1e2ffce3e5e2f 100644
--- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h
+++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h
@@ -70,8 +70,6 @@ class ObjectContainerBSDArchive : public lldb_private::ObjectContainer {
     return 0;
   }
 
-  void Dump(lldb_private::Stream *s) const override;
-
   lldb::ObjectFileSP GetObjectFile(const lldb_private::FileSpec *file) override;
 
   // PluginInterface protocol

diff  --git a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
index daa2a302a0448..78e0a4b2f499f 100644
--- a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
+++ b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
@@ -116,29 +116,6 @@ bool ObjectContainerUniversalMachO::ParseHeader(
   return success;
 }
 
-void ObjectContainerUniversalMachO::Dump(Stream *s) const {
-  s->Printf("%p: ", static_cast<const void *>(this));
-  s->Indent();
-  const size_t num_archs = GetNumArchitectures();
-  const size_t num_objects = GetNumObjects();
-  s->Printf("ObjectContainerUniversalMachO, num_archs = %zu, num_objects = %zu",
-            num_archs, num_objects);
-  uint32_t i;
-  ArchSpec arch;
-  s->IndentMore();
-  for (i = 0; i < num_archs; i++) {
-    s->Indent();
-    GetArchitectureAtIndex(i, arch);
-    s->Printf("arch[%u] = %s\n", i, arch.GetArchitectureName());
-  }
-  for (i = 0; i < num_objects; i++) {
-    s->Indent();
-    s->Printf("object[%u] = %s\n", i, GetObjectNameAtIndex(i));
-  }
-  s->IndentLess();
-  s->EOL();
-}
-
 size_t ObjectContainerUniversalMachO::GetNumArchitectures() const {
   return m_header.nfat_arch;
 }

diff  --git a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h
index 17f9c1e4ba4e8..4fbea936ac85c 100644
--- a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h
+++ b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h
@@ -51,8 +51,6 @@ class ObjectContainerUniversalMachO : public lldb_private::ObjectContainer {
   // Member Functions
   bool ParseHeader() override;
 
-  void Dump(lldb_private::Stream *s) const override;
-
   size_t GetNumArchitectures() const override;
 
   bool GetArchitectureAtIndex(uint32_t cpu_idx,


        


More information about the lldb-commits mailing list