[MC] Remove unused renameELFSection
authorFangrui Song <i@maskray.me>
Sun, 24 Jul 2022 08:23:07 +0000 (01:23 -0700)
committerFangrui Song <i@maskray.me>
Sun, 24 Jul 2022 08:23:07 +0000 (01:23 -0700)
llvm/include/llvm/MC/MCContext.h
llvm/lib/MC/MCContext.cpp

index a0e18891ed902e6bfa453571515e5d02fe9bf4a2..61520c4f29bfb8e2c2b49855cec389f8ebf2ab28 100644 (file)
@@ -603,8 +603,6 @@ public:
                                     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,
index d312e3521c9e5ade7960714ab22be48adfe29468..322ed8e23eb6a1fb917ba82f9a26257d8a0df68c 100644 (file)
@@ -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,