[PATCH] D59732: [DWARF] Delete one unused DWARFContext::create overload and asscoaited ctor of DWARFObjInMemory

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 19:15:47 PDT 2019


MaskRay created this revision.
MaskRay added reviewers: dblaikie, probinson, aprantl.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D59732

Files:
  include/llvm/DebugInfo/DWARF/DWARFContext.h
  lib/DebugInfo/DWARF/DWARFContext.cpp


Index: lib/DebugInfo/DWARF/DWARFContext.cpp
===================================================================
--- lib/DebugInfo/DWARF/DWARFContext.cpp
+++ lib/DebugInfo/DWARF/DWARFContext.cpp
@@ -1363,24 +1363,6 @@
   }
 
 public:
-  DWARFObjInMemory(const StringMap<std::unique_ptr<MemoryBuffer>> &Sections,
-                   uint8_t AddrSize, bool IsLittleEndian)
-      : IsLittleEndian(IsLittleEndian) {
-    for (const auto &SecIt : Sections) {
-      if (StringRef *SectionData = mapSectionToMember(SecIt.first()))
-        *SectionData = SecIt.second->getBuffer();
-      else if (SecIt.first() == "debug_info")
-        // Find debug_info and debug_types data by section rather than name as
-        // there are multiple, comdat grouped, of these sections.
-        InfoSections[SectionRef()].Data = SecIt.second->getBuffer();
-      else if (SecIt.first() == "debug_info.dwo")
-        InfoDWOSections[SectionRef()].Data = SecIt.second->getBuffer();
-      else if (SecIt.first() == "debug_types")
-        TypesSections[SectionRef()].Data = SecIt.second->getBuffer();
-      else if (SecIt.first() == "debug_types.dwo")
-        TypesDWOSections[SectionRef()].Data = SecIt.second->getBuffer();
-    }
-  }
   DWARFObjInMemory(const object::ObjectFile &Obj, const LoadedObjectInfo *L,
                    function_ref<ErrorPolicy(Error)> HandleError)
       : IsLittleEndian(Obj.isLittleEndian()),
@@ -1658,14 +1640,6 @@
   return llvm::make_unique<DWARFContext>(std::move(DObj), std::move(DWPName));
 }
 
-std::unique_ptr<DWARFContext>
-DWARFContext::create(const StringMap<std::unique_ptr<MemoryBuffer>> &Sections,
-                     uint8_t AddrSize, bool isLittleEndian) {
-  auto DObj =
-      llvm::make_unique<DWARFObjInMemory>(Sections, AddrSize, isLittleEndian);
-  return llvm::make_unique<DWARFContext>(std::move(DObj), "");
-}
-
 Error DWARFContext::loadRegisterInfo(const object::ObjectFile &Obj) {
   // Detect the architecture from the object file. We usually don't need OS
   // info to lookup a target and create register info.
Index: include/llvm/DebugInfo/DWARF/DWARFContext.h
===================================================================
--- include/llvm/DebugInfo/DWARF/DWARFContext.h
+++ include/llvm/DebugInfo/DWARF/DWARFContext.h
@@ -348,10 +348,6 @@
          function_ref<ErrorPolicy(Error)> HandleError = defaultErrorHandler,
          std::string DWPName = "");
 
-  static std::unique_ptr<DWARFContext>
-  create(const StringMap<std::unique_ptr<MemoryBuffer>> &Sections,
-         uint8_t AddrSize, bool isLittleEndian = sys::IsLittleEndianHost);
-
   /// Loads register info for the architecture of the provided object file.
   /// Improves readability of dumped DWARF expressions. Requires the caller to
   /// have initialized the relevant target descriptions.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59732.191982.patch
Type: text/x-patch
Size: 2816 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190323/6b39e97e/attachment.bin>


More information about the llvm-commits mailing list