[lld] r249568 - ELF2: Rename local variable name `Out` in preparation to define `Out` global var.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 7 10:04:18 PDT 2015


Author: ruiu
Date: Wed Oct  7 12:04:18 2015
New Revision: 249568

URL: http://llvm.org/viewvc/llvm-project?rev=249568&view=rev
Log:
ELF2: Rename local variable name `Out` in preparation to define `Out` global var.

Modified:
    lld/trunk/ELF/InputSection.cpp
    lld/trunk/ELF/InputSection.h
    lld/trunk/ELF/OutputSections.cpp

Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=249568&r1=249567&r2=249568&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Wed Oct  7 12:04:18 2015
@@ -84,7 +84,7 @@ void InputSection<ELFT>::writeTo(uint8_t
   ObjectFile<ELFT> *File = getFile();
   ELFFile<ELFT> &EObj = File->getObj();
   uint8_t *Base = Buf + getOutputSectionOff();
-  uintX_t BaseAddr = Out->getVA() + getOutputSectionOff();
+  uintX_t BaseAddr = OutSec->getVA() + getOutputSectionOff();
   // Iterate over all relocation sections that apply to this section.
   for (const Elf_Shdr *RelSec : RelocSections) {
     if (RelSec->sh_type == SHT_RELA)

Modified: lld/trunk/ELF/InputSection.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.h?rev=249568&r1=249567&r2=249568&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.h (original)
+++ lld/trunk/ELF/InputSection.h Wed Oct  7 12:04:18 2015
@@ -53,8 +53,8 @@ public:
   }
   void setOutputSectionOff(uint64_t V) { OutputSectionOff = V; }
 
-  void setOutputSection(OutputSection<ELFT> *O) { Out = O; }
-  OutputSection<ELFT> *getOutputSection() const { return Out; }
+  void setOutputSection(OutputSection<ELFT> *O) { OutSec = O; }
+  OutputSection<ELFT> *getOutputSection() const { return OutSec; }
 
   // Relocation sections that refer to this one.
   SmallVector<const Elf_Shdr *, 1> RelocSections;
@@ -75,7 +75,7 @@ private:
   // The file this section is from.
   ObjectFile<ELFT> *File;
 
-  OutputSection<ELFT> *Out = nullptr;
+  OutputSection<ELFT> *OutSec = nullptr;
 
   const Elf_Shdr *Header;
 };

Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=249568&r1=249567&r2=249568&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Wed Oct  7 12:04:18 2015
@@ -114,7 +114,7 @@ template <class ELFT> void RelocationSec
 
     const InputSection<ELFT> &C = Rel.C;
     const Elf_Rel &RI = Rel.RI;
-    OutputSection<ELFT> *Out = C.getOutputSection();
+    OutputSection<ELFT> *OutSec = C.getOutputSection();
     uint32_t SymIndex = RI.getSymbol(IsMips64EL);
     const ObjectFile<ELFT> &File = *C.getFile();
     const SymbolBody *Body = File.getSymbolBody(SymIndex);
@@ -143,7 +143,7 @@ template <class ELFT> void RelocationSec
     } else {
       if (IsRela)
         Addend += static_cast<const Elf_Rela &>(RI).r_addend;
-      P->r_offset = RI.r_offset + C.getOutputSectionOff() + Out->getVA();
+      P->r_offset = RI.r_offset + C.getOutputSectionOff() + OutSec->getVA();
       if (CanBePreempted)
         P->setSymbolAndType(Body->getDynamicSymbolTableIndex(), Type,
                             IsMips64EL);
@@ -442,8 +442,8 @@ lld::elf2::getLocalSymVA(const typename
         Sym, File.getSymbolTable(), File.getSymbolTableShndx());
   ArrayRef<InputSection<ELFT> *> Sections = File.getSections();
   InputSection<ELFT> *Section = Sections[SecIndex];
-  OutputSection<ELFT> *Out = Section->getOutputSection();
-  return Out->getVA() + Section->getOutputSectionOff() + Sym->st_value;
+  OutputSection<ELFT> *OutSec = Section->getOutputSection();
+  return OutSec->getVA() + Section->getOutputSectionOff() + Sym->st_value;
 }
 
 bool lld::elf2::canBePreempted(const SymbolBody *Body) {
@@ -580,9 +580,9 @@ void SymbolTableSection<ELFT>::writeLoca
               &Sym, File.getSymbolTable(), File.getSymbolTableShndx());
         ArrayRef<InputSection<ELFT> *> Sections = File.getSections();
         const InputSection<ELFT> *Section = Sections[SecIndex];
-        const OutputSection<ELFT> *Out = Section->getOutputSection();
-        ESym->st_shndx = Out->getSectionIndex();
-        VA += Out->getVA() + Section->getOutputSectionOff();
+        const OutputSection<ELFT> *OutSec = Section->getOutputSection();
+        ESym->st_shndx = OutSec->getSectionIndex();
+        VA += OutSec->getVA() + Section->getOutputSectionOff();
       }
       ESym->st_value = VA;
     }
@@ -608,18 +608,18 @@ void SymbolTableSection<ELFT>::writeGlob
 
     ESym->st_name = StrTabSec.getFileOff(Name);
 
-    const OutputSection<ELFT> *Out = nullptr;
+    const OutputSection<ELFT> *OutSec = nullptr;
     const InputSection<ELFT> *Section = nullptr;
 
     switch (Body->kind()) {
     case SymbolBody::DefinedSyntheticKind:
-      Out = &cast<DefinedSynthetic<ELFT>>(Body)->Section;
+      OutSec = &cast<DefinedSynthetic<ELFT>>(Body)->Section;
       break;
     case SymbolBody::DefinedRegularKind:
       Section = &cast<DefinedRegular<ELFT>>(Body)->Section;
       break;
     case SymbolBody::DefinedCommonKind:
-      Out = &BssSec;
+      OutSec = &BssSec;
       break;
     case SymbolBody::UndefinedKind:
     case SymbolBody::DefinedAbsoluteKind:
@@ -648,12 +648,12 @@ void SymbolTableSection<ELFT>::writeGlob
     ESym->st_value = getSymVA(*Body, BssSec);
 
     if (Section)
-      Out = Section->getOutputSection();
+      OutSec = Section->getOutputSection();
 
     if (isa<DefinedAbsolute<ELFT>>(Body))
       ESym->st_shndx = SHN_ABS;
-    else if (Out)
-      ESym->st_shndx = Out->getSectionIndex();
+    else if (OutSec)
+      ESym->st_shndx = OutSec->getSectionIndex();
   }
   if (!StrTabSec.isDynamic())
     std::stable_sort(




More information about the llvm-commits mailing list