[ELF] Remove EhFrameSection::addSection. NFC

This commit is contained in:
Fangrui Song 2022-07-31 19:55:05 -07:00
parent 9701053517
commit 81ed005c4c
2 changed files with 7 additions and 14 deletions

View File

@ -431,16 +431,6 @@ void EhFrameSection::addSectionAux(EhInputSection *sec) {
addRecords<ELFT>(sec, rels.relas);
}
void EhFrameSection::addSection(EhInputSection *sec) {
sec->parent = this;
alignment = std::max(alignment, sec->alignment);
sections.push_back(sec);
for (auto *ds : sec->dependentSections)
dependentSections.push_back(ds);
}
// Used by ICF<ELFT>::handleLSDA(). This function is very similar to
// EhFrameSection::addRecords().
template <class ELFT, class RelTy>
@ -3345,8 +3335,13 @@ template <class ELFT> void elf::splitSections() {
void elf::combineEhSections() {
llvm::TimeTraceScope timeScope("Combine EH sections");
for (EhInputSection *sec : ehInputSections)
sec->getPartition().ehFrame->addSection(sec);
for (EhInputSection *sec : ehInputSections) {
EhFrameSection &eh = *sec->getPartition().ehFrame;
sec->parent = &eh;
eh.alignment = std::max(eh.alignment, sec->alignment);
eh.sections.push_back(sec);
llvm::append_range(eh.dependentSections, sec->dependentSections);
}
if (!mainPart->armExidx)
return;

View File

@ -52,8 +52,6 @@ public:
return SyntheticSection::classof(d) && d->name == ".eh_frame";
}
void addSection(EhInputSection *sec);
SmallVector<EhInputSection *, 0> sections;
size_t numFdes = 0;