[lld] r249682 - Add a convenience variable. NFC.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 8 05:02:38 PDT 2015


Author: rafael
Date: Thu Oct  8 07:02:38 2015
New Revision: 249682

URL: http://llvm.org/viewvc/llvm-project?rev=249682&view=rev
Log:
Add a convenience variable. NFC.

Modified:
    lld/trunk/ELF/InputFiles.cpp

Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=249682&r1=249681&r2=249682&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Thu Oct  8 07:02:38 2015
@@ -105,14 +105,14 @@ template <class ELFT> void elf2::ObjectF
   uint64_t Size = this->ELFObj.getNumSections();
   Sections.resize(Size);
   unsigned I = 0;
-  for (const Elf_Shdr &Sec : this->ELFObj.sections()) {
+  const ELFFile<ELFT> &Obj = this->ELFObj;
+  for (const Elf_Shdr &Sec : Obj.sections()) {
     switch (Sec.sh_type) {
     case SHT_SYMTAB:
       this->Symtab = &Sec;
       break;
     case SHT_SYMTAB_SHNDX: {
-      ErrorOr<ArrayRef<Elf_Word>> ErrorOrTable =
-          this->ELFObj.getSHNDXTable(Sec);
+      ErrorOr<ArrayRef<Elf_Word>> ErrorOrTable = Obj.getSHNDXTable(Sec);
       error(ErrorOrTable);
       SymtabSHNDX = *ErrorOrTable;
       break;




More information about the llvm-commits mailing list