[llvm] r243012 - Use helper function. NFC.

Rafael Espindola rafael.espindola at gmail.com
Thu Jul 23 05:51:45 PDT 2015


Author: rafael
Date: Thu Jul 23 07:51:44 2015
New Revision: 243012

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

Modified:
    llvm/trunk/tools/obj2yaml/elf2yaml.cpp

Modified: llvm/trunk/tools/obj2yaml/elf2yaml.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/obj2yaml/elf2yaml.cpp?rev=243012&r1=243011&r2=243012&view=diff
==============================================================================
--- llvm/trunk/tools/obj2yaml/elf2yaml.cpp (original)
+++ llvm/trunk/tools/obj2yaml/elf2yaml.cpp Thu Jul 23 07:51:44 2015
@@ -343,10 +343,7 @@ ErrorOr<ELFYAML::Group *> ELFDumper<ELFT
     return EC;
   const Elf_Shdr *Symtab = *SymtabOrErr;
   const Elf_Sym *symbol = Obj.getSymbol(Symtab, Shdr->sh_info);
-  ErrorOr<const Elf_Shdr *> StrTabSec = Obj.getSection(Symtab->sh_link);
-  if (std::error_code EC = StrTabSec.getError())
-    return EC;
-  ErrorOr<StringRef> StrTabOrErr = Obj.getStringTable(*StrTabSec);
+  ErrorOr<StringRef> StrTabOrErr = Obj.getStringTableForSymtab(*Symtab);
   if (std::error_code EC = StrTabOrErr.getError())
     return EC;
   StringRef StrTab = *StrTabOrErr;





More information about the llvm-commits mailing list