forked from OSchip/llvm-project
[ELF] Internalize createMergeSynthetic. NFC
Only called once. Moving to OutputSections.cpp can make it inlined. finalizeInputSections can be very hot, especially in -O1 links with much debug info.
This commit is contained in:
parent
2444e305c5
commit
93558e575e
|
@ -155,6 +155,15 @@ void OutputSection::commitSection(InputSection *isec) {
|
|||
entsize = 0;
|
||||
}
|
||||
|
||||
static MergeSyntheticSection *createMergeSynthetic(StringRef name,
|
||||
uint32_t type,
|
||||
uint64_t flags,
|
||||
uint32_t alignment) {
|
||||
if ((flags & SHF_STRINGS) && config->optimize >= 2)
|
||||
return make<MergeTailSection>(name, type, flags, alignment);
|
||||
return make<MergeNoTailSection>(name, type, flags, alignment);
|
||||
}
|
||||
|
||||
// This function scans over the InputSectionBase list sectionBases to create
|
||||
// InputSectionDescription::sections.
|
||||
//
|
||||
|
|
|
@ -3313,15 +3313,6 @@ void MergeNoTailSection::finalizeContents() {
|
|||
});
|
||||
}
|
||||
|
||||
MergeSyntheticSection *elf::createMergeSynthetic(StringRef name, uint32_t type,
|
||||
uint64_t flags,
|
||||
uint32_t alignment) {
|
||||
bool shouldTailMerge = (flags & SHF_STRINGS) && config->optimize >= 2;
|
||||
if (shouldTailMerge)
|
||||
return make<MergeTailSection>(name, type, flags, alignment);
|
||||
return make<MergeNoTailSection>(name, type, flags, alignment);
|
||||
}
|
||||
|
||||
template <class ELFT> void elf::splitSections() {
|
||||
llvm::TimeTraceScope timeScope("Split sections");
|
||||
// splitIntoPieces needs to be called on each MergeInputSection
|
||||
|
|
|
@ -1182,8 +1182,6 @@ public:
|
|||
|
||||
InputSection *createInterpSection();
|
||||
MergeInputSection *createCommentSection();
|
||||
MergeSyntheticSection *createMergeSynthetic(StringRef name, uint32_t type,
|
||||
uint64_t flags, uint32_t alignment);
|
||||
template <class ELFT> void splitSections();
|
||||
|
||||
template <typename ELFT> void writeEhdr(uint8_t *buf, Partition &part);
|
||||
|
|
Loading…
Reference in New Issue