<div dir="ltr">Wouldn't mind hearing from Wolgang to double check the motivation here - but yeah, it's dead, can easily be readded when there's a use for it.</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Jul 10, 2017 at 9:57 AM Rafael Avila de Espindola <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">LGTM<br>
<br>
George Rimar via Phabricator <<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>> writes:<br>
<br>
> grimar created this revision.<br>
><br>
> This was added in <a href="https://reviews.llvm.org/D32779" rel="noreferrer" target="_blank">https://reviews.llvm.org/D32779</a>, but I think it was unused from begining,<br>
> because `Name` (prev 'name') variable is never accessed after `Obj.mapDebugSectionName()` call.<br>
> Looks we can remove it.<br>
><br>
><br>
> <a href="https://reviews.llvm.org/D35193" rel="noreferrer" target="_blank">https://reviews.llvm.org/D35193</a><br>
><br>
> Files:<br>
>   include/llvm/Object/MachO.h<br>
>   include/llvm/Object/ObjectFile.h<br>
>   lib/DebugInfo/DWARF/DWARFContext.cpp<br>
>   lib/Object/MachOObjectFile.cpp<br>
><br>
><br>
> Index: lib/Object/MachOObjectFile.cpp<br>
> ===================================================================<br>
> --- lib/Object/MachOObjectFile.cpp<br>
> +++ lib/Object/MachOObjectFile.cpp<br>
> @@ -4335,9 +4335,3 @@<br>
>    return make_error<GenericBinaryError>("Unrecognized MachO magic number",<br>
>                                          object_error::invalid_file_type);<br>
>  }<br>
> -<br>
> -StringRef MachOObjectFile::mapDebugSectionName(StringRef Name) const {<br>
> -  return StringSwitch<StringRef>(Name)<br>
> -      .Case("debug_str_offs", "debug_str_offsets")<br>
> -      .Default(Name);<br>
> -}<br>
> Index: lib/DebugInfo/DWARF/DWARFContext.cpp<br>
> ===================================================================<br>
> --- lib/DebugInfo/DWARF/DWARFContext.cpp<br>
> +++ lib/DebugInfo/DWARF/DWARFContext.cpp<br>
> @@ -978,10 +978,6 @@<br>
>        TypesDWOSections[Section].Data = Data;<br>
>      }<br>
><br>
> -    // Map platform specific debug section names to DWARF standard section<br>
> -    // names.<br>
> -    Name = Obj.mapDebugSectionName(Name);<br>
> -<br>
>      if (RelocatedSection == Obj.section_end())<br>
>        continue;<br>
><br>
> Index: include/llvm/Object/ObjectFile.h<br>
> ===================================================================<br>
> --- include/llvm/Object/ObjectFile.h<br>
> +++ include/llvm/Object/ObjectFile.h<br>
> @@ -293,9 +293,6 @@<br>
>        return std::error_code();<br>
>      }<br>
><br>
> -  /// Maps a debug section name to a standard DWARF section name.<br>
> -  virtual StringRef mapDebugSectionName(StringRef Name) const { return Name; }<br>
> -<br>
>    /// True if this is a relocatable object (.o/.obj).<br>
>    virtual bool isRelocatableObject() const = 0;<br>
><br>
> Index: include/llvm/Object/MachO.h<br>
> ===================================================================<br>
> --- include/llvm/Object/MachO.h<br>
> +++ include/llvm/Object/MachO.h<br>
> @@ -556,8 +556,6 @@<br>
><br>
>    bool isRelocatableObject() const override;<br>
><br>
> -  StringRef mapDebugSectionName(StringRef Name) const override;<br>
> -<br>
>    bool hasPageZeroSegment() const { return HasPageZeroSegment; }<br>
><br>
>    static bool classof(const Binary *v) {<br>
><br>
><br>
> Index: lib/Object/MachOObjectFile.cpp<br>
> ===================================================================<br>
> --- lib/Object/MachOObjectFile.cpp<br>
> +++ lib/Object/MachOObjectFile.cpp<br>
> @@ -4335,9 +4335,3 @@<br>
>    return make_error<GenericBinaryError>("Unrecognized MachO magic number",<br>
>                                          object_error::invalid_file_type);<br>
>  }<br>
> -<br>
> -StringRef MachOObjectFile::mapDebugSectionName(StringRef Name) const {<br>
> -  return StringSwitch<StringRef>(Name)<br>
> -      .Case("debug_str_offs", "debug_str_offsets")<br>
> -      .Default(Name);<br>
> -}<br>
> Index: lib/DebugInfo/DWARF/DWARFContext.cpp<br>
> ===================================================================<br>
> --- lib/DebugInfo/DWARF/DWARFContext.cpp<br>
> +++ lib/DebugInfo/DWARF/DWARFContext.cpp<br>
> @@ -978,10 +978,6 @@<br>
>        TypesDWOSections[Section].Data = Data;<br>
>      }<br>
><br>
> -    // Map platform specific debug section names to DWARF standard section<br>
> -    // names.<br>
> -    Name = Obj.mapDebugSectionName(Name);<br>
> -<br>
>      if (RelocatedSection == Obj.section_end())<br>
>        continue;<br>
><br>
> Index: include/llvm/Object/ObjectFile.h<br>
> ===================================================================<br>
> --- include/llvm/Object/ObjectFile.h<br>
> +++ include/llvm/Object/ObjectFile.h<br>
> @@ -293,9 +293,6 @@<br>
>        return std::error_code();<br>
>      }<br>
><br>
> -  /// Maps a debug section name to a standard DWARF section name.<br>
> -  virtual StringRef mapDebugSectionName(StringRef Name) const { return Name; }<br>
> -<br>
>    /// True if this is a relocatable object (.o/.obj).<br>
>    virtual bool isRelocatableObject() const = 0;<br>
><br>
> Index: include/llvm/Object/MachO.h<br>
> ===================================================================<br>
> --- include/llvm/Object/MachO.h<br>
> +++ include/llvm/Object/MachO.h<br>
> @@ -556,8 +556,6 @@<br>
><br>
>    bool isRelocatableObject() const override;<br>
><br>
> -  StringRef mapDebugSectionName(StringRef Name) const override;<br>
> -<br>
>    bool hasPageZeroSegment() const { return HasPageZeroSegment; }<br>
><br>
>    static bool classof(const Binary *v) {<br>
</blockquote></div>