[MC] Remove unused renameELFSection

This commit is contained in:
Fangrui Song 2022-07-24 01:23:07 -07:00
parent 6977ff4006
commit 7feab85df8
2 changed files with 0 additions and 20 deletions

View 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,

View 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,