mirror of
https://github.com/intel/llvm.git
synced 2026-02-06 15:18:53 +08:00
[ELF] Move SyntheticSection check from InputSection::writeTo to OutputSection::writeTo. NFC
Simplify code and make the heavyweight operation to the call site so that it is clearer how to improve the inefficient scheduling in the future.
This commit is contained in:
@@ -1213,11 +1213,6 @@ void InputSectionBase::adjustSplitStackFunctionPrologues(uint8_t *buf,
|
||||
}
|
||||
|
||||
template <class ELFT> void InputSection::writeTo(uint8_t *buf) {
|
||||
if (auto *s = dyn_cast<SyntheticSection>(this)) {
|
||||
s->writeTo(buf);
|
||||
return;
|
||||
}
|
||||
|
||||
if (LLVM_UNLIKELY(type == SHT_NOBITS))
|
||||
return;
|
||||
// If -r or --emit-relocs is given, then an InputSection
|
||||
|
||||
@@ -431,7 +431,10 @@ template <class ELFT> void OutputSection::writeTo(uint8_t *buf) {
|
||||
|
||||
parallelForEachN(0, sections.size(), [&](size_t i) {
|
||||
InputSection *isec = sections[i];
|
||||
isec->writeTo<ELFT>(buf + isec->outSecOff);
|
||||
if (auto *s = dyn_cast<SyntheticSection>(isec))
|
||||
s->writeTo(buf + isec->outSecOff);
|
||||
else
|
||||
isec->writeTo<ELFT>(buf + isec->outSecOff);
|
||||
|
||||
// Fill gaps between sections.
|
||||
if (nonZeroFiller) {
|
||||
|
||||
Reference in New Issue
Block a user