[lld] r243982 - This function never returns null, don't check it.

Rafael Espindola rafael.espindola at gmail.com
Tue Aug 4 07:00:56 PDT 2015


Author: rafael
Date: Tue Aug  4 09:00:56 2015
New Revision: 243982

URL: http://llvm.org/viewvc/llvm-project?rev=243982&view=rev
Log:
This function never returns null, don't check it.

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=243982&r1=243981&r2=243982&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Tue Aug  4 09:00:56 2015
@@ -51,10 +51,8 @@ template <class ELFT> void elf2::ObjectF
   Syms = Elf_Sym_Range(Syms.begin() + 1, Syms.end());
   auto NumSymbols = std::distance(Syms.begin(), Syms.end());
   SymbolBodies.reserve(NumSymbols);
-  for (const Elf_Sym &Sym : Syms) {
-    if (SymbolBody *Body = createSymbolBody(StringTable, &Sym))
-      SymbolBodies.push_back(Body);
-  }
+  for (const Elf_Sym &Sym : Syms)
+    SymbolBodies.push_back(createSymbolBody(StringTable, &Sym));
 }
 
 template <class ELFT>





More information about the llvm-commits mailing list