[llvm] 7feab85 - [MC] Remove unused renameELFSection

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 24 01:23:13 PDT 2022


Author: Fangrui Song
Date: 2022-07-24T01:23:07-07:00
New Revision: 7feab85df8e8f5776bd2d4c1af61dc30fa24dd6f

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

LOG: [MC] Remove unused renameELFSection

Added: 
    

Modified: 
    llvm/include/llvm/MC/MCContext.h
    llvm/lib/MC/MCContext.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/MC/MCContext.h b/llvm/include/llvm/MC/MCContext.h
index a0e18891ed90..61520c4f29bf 100644
--- a/llvm/include/llvm/MC/MCContext.h
+++ b/llvm/include/llvm/MC/MCContext.h
@@ -603,8 +603,6 @@ class MCContext {
                                     const MCSymbolELF *Group,
                                     const MCSectionELF *RelInfoSection);
 
-  void renameELFSection(MCSectionELF *Section, StringRef Name);
-
   MCSectionELF *createELFGroupSection(const MCSymbolELF *Group, bool IsComdat);
 
   void recordELFMergeableSectionInfo(StringRef SectionName, unsigned Flags,

diff  --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp
index d312e3521c9e..322ed8e23eb6 100644
--- a/llvm/lib/MC/MCContext.cpp
+++ b/llvm/lib/MC/MCContext.cpp
@@ -468,24 +468,6 @@ MCSectionMachO *MCContext::getMachOSection(StringRef Segment, StringRef Section,
   return R.first->second;
 }
 
-void MCContext::renameELFSection(MCSectionELF *Section, StringRef Name) {
-  StringRef GroupName;
-  if (const MCSymbol *Group = Section->getGroup())
-    GroupName = Group->getName();
-
-  // This function is only used by .debug*, which should not have the
-  // SHF_LINK_ORDER flag.
-  unsigned UniqueID = Section->getUniqueID();
-  ELFUniquingMap.erase(
-      ELFSectionKey{Section->getName(), GroupName, "", UniqueID});
-  auto I = ELFUniquingMap
-               .insert(std::make_pair(
-                   ELFSectionKey{Name, GroupName, "", UniqueID}, Section))
-               .first;
-  StringRef CachedName = I->first.SectionName;
-  const_cast<MCSectionELF *>(Section)->setSectionName(CachedName);
-}
-
 MCSectionELF *MCContext::createELFSectionImpl(StringRef Section, unsigned Type,
                                               unsigned Flags, SectionKind K,
                                               unsigned EntrySize,


        


More information about the llvm-commits mailing list