[PATCH] D35193: [DWARF] - Remove unused code.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 02:57:52 PDT 2017


grimar created this revision.

This was added in https://reviews.llvm.org/D32779, but I think it was unused from begining,
because `Name` (prev 'name') variable is never accessed after `Obj.mapDebugSectionName()` call.
Looks we can remove it.


https://reviews.llvm.org/D35193

Files:
  include/llvm/Object/MachO.h
  include/llvm/Object/ObjectFile.h
  lib/DebugInfo/DWARF/DWARFContext.cpp
  lib/Object/MachOObjectFile.cpp


Index: lib/Object/MachOObjectFile.cpp
===================================================================
--- lib/Object/MachOObjectFile.cpp
+++ lib/Object/MachOObjectFile.cpp
@@ -4335,9 +4335,3 @@
   return make_error<GenericBinaryError>("Unrecognized MachO magic number",
                                         object_error::invalid_file_type);
 }
-
-StringRef MachOObjectFile::mapDebugSectionName(StringRef Name) const {
-  return StringSwitch<StringRef>(Name)
-      .Case("debug_str_offs", "debug_str_offsets")
-      .Default(Name);
-}
Index: lib/DebugInfo/DWARF/DWARFContext.cpp
===================================================================
--- lib/DebugInfo/DWARF/DWARFContext.cpp
+++ lib/DebugInfo/DWARF/DWARFContext.cpp
@@ -978,10 +978,6 @@
       TypesDWOSections[Section].Data = Data;
     }
 
-    // Map platform specific debug section names to DWARF standard section
-    // names.
-    Name = Obj.mapDebugSectionName(Name);
-
     if (RelocatedSection == Obj.section_end())
       continue;
 
Index: include/llvm/Object/ObjectFile.h
===================================================================
--- include/llvm/Object/ObjectFile.h
+++ include/llvm/Object/ObjectFile.h
@@ -293,9 +293,6 @@
       return std::error_code();
     }
 
-  /// Maps a debug section name to a standard DWARF section name.
-  virtual StringRef mapDebugSectionName(StringRef Name) const { return Name; }
-
   /// True if this is a relocatable object (.o/.obj).
   virtual bool isRelocatableObject() const = 0;
 
Index: include/llvm/Object/MachO.h
===================================================================
--- include/llvm/Object/MachO.h
+++ include/llvm/Object/MachO.h
@@ -556,8 +556,6 @@
 
   bool isRelocatableObject() const override;
 
-  StringRef mapDebugSectionName(StringRef Name) const override;
-
   bool hasPageZeroSegment() const { return HasPageZeroSegment; }
 
   static bool classof(const Binary *v) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35193.105824.patch
Type: text/x-patch
Size: 1930 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170710/7e844454/attachment.bin>


More information about the llvm-commits mailing list