[llvm] r303368 - Use existing helper. NFC.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu May 18 11:24:12 PDT 2017


Author: rafael
Date: Thu May 18 13:24:11 2017
New Revision: 303368

URL: http://llvm.org/viewvc/llvm-project?rev=303368&view=rev
Log:
Use existing helper. NFC.

Modified:
    llvm/trunk/include/llvm/Object/ELF.h

Modified: llvm/trunk/include/llvm/Object/ELF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELF.h?rev=303368&r1=303367&r2=303368&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELF.h (original)
+++ llvm/trunk/include/llvm/Object/ELF.h Thu May 18 13:24:11 2017
@@ -235,10 +235,7 @@ ELFFile<ELFT>::getSection(const Elf_Sym
   uint32_t Index = *IndexOrErr;
   if (Index == 0)
     return nullptr;
-  auto SectionsOrErr = sections();
-  if (!SectionsOrErr)
-    return SectionsOrErr.takeError();
-  return object::getSection<ELFT>(*SectionsOrErr, Index);
+  return getSection(Index);
 }
 
 template <class ELFT>




More information about the llvm-commits mailing list