diff options
author | Davide Italiano <davide@freebsd.org> | 2016-09-19 17:38:39 +0000 |
---|---|---|
committer | Davide Italiano <davide@freebsd.org> | 2016-09-19 17:38:39 +0000 |
commit | 6f862b1f073cdf13b18eee8d4baf5b319620ddae (patch) | |
tree | 4978abcc3229a6beb2b1dcdd13747baf80444ab7 | |
parent | a7330ba5ac04eb0163ac6d5bcd5c59a71bcc107e (diff) | |
download | bcm5719-llvm-6f862b1f073cdf13b18eee8d4baf5b319620ddae.tar.gz bcm5719-llvm-6f862b1f073cdf13b18eee8d4baf5b319620ddae.zip |
[Writer] Rename variables to reflect reality. NFCI.
The InputSection variables in the Writer were named `C`. This
was because when the ELF linker was ported (from COFF)
the name `Chunks` for input sections was retained.
Luckily we switched to a more ELF-compliant jargon, but these
variables weren't reanamed accordingly during the transition.
llvm-svn: 281917
-rw-r--r-- | lld/ELF/Writer.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index e58c4b6707b..f17f10694ef 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -653,22 +653,22 @@ void Writer<ELFT>::forEachRelSec( std::function<void(InputSectionBase<ELFT> &, const typename ELFT::Shdr &)> Fn) { for (elf::ObjectFile<ELFT> *F : Symtab<ELFT>::X->getObjectFiles()) { - for (InputSectionBase<ELFT> *C : F->getSections()) { - if (isDiscarded(C)) + for (InputSectionBase<ELFT> *IS : F->getSections()) { + if (isDiscarded(IS)) continue; // Scan all relocations. Each relocation goes through a series // of tests to determine if it needs special treatment, such as // creating GOT, PLT, copy relocations, etc. // Note that relocations for non-alloc sections are directly // processed by InputSection::relocateNonAlloc. - if (!(C->getSectionHdr()->sh_flags & SHF_ALLOC)) + if (!(IS->getSectionHdr()->sh_flags & SHF_ALLOC)) continue; - if (auto *S = dyn_cast<InputSection<ELFT>>(C)) { + if (auto *S = dyn_cast<InputSection<ELFT>>(IS)) { for (const Elf_Shdr *RelSec : S->RelocSections) Fn(*S, *RelSec); continue; } - if (auto *S = dyn_cast<EhInputSection<ELFT>>(C)) + if (auto *S = dyn_cast<EhInputSection<ELFT>>(IS)) if (S->RelocSection) Fn(*S, *S->RelocSection); } @@ -677,17 +677,17 @@ void Writer<ELFT>::forEachRelSec( template <class ELFT> void Writer<ELFT>::createSections() { for (elf::ObjectFile<ELFT> *F : Symtab<ELFT>::X->getObjectFiles()) { - for (InputSectionBase<ELFT> *C : F->getSections()) { - if (isDiscarded(C)) { - reportDiscarded(C); + for (InputSectionBase<ELFT> *IS : F->getSections()) { + if (isDiscarded(IS)) { + reportDiscarded(IS); continue; } OutputSectionBase<ELFT> *Sec; bool IsNew; - std::tie(Sec, IsNew) = Factory.create(C, getOutputSectionName(C)); + std::tie(Sec, IsNew) = Factory.create(IS, getOutputSectionName(IS)); if (IsNew) OutputSections.push_back(Sec); - Sec->addSection(C); + Sec->addSection(IS); } } @@ -821,9 +821,9 @@ template <class ELFT> bool Writer<ELFT>::needsGot() { // This function add Out<ELFT>::* sections to OutputSections. template <class ELFT> void Writer<ELFT>::addPredefinedSections() { - auto Add = [&](OutputSectionBase<ELFT> *C) { - if (C) - OutputSections.push_back(C); + auto Add = [&](OutputSectionBase<ELFT> *OS) { + if (OS) + OutputSections.push_back(OS); }; // A core file does not usually contain unmodified segments except |