[lld] r258724 - Use Symtab.find() instead of Symtab.getSymbols().lookup().

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 25 13:47:26 PST 2016


Author: ruiu
Date: Mon Jan 25 15:47:25 2016
New Revision: 258724

URL: http://llvm.org/viewvc/llvm-project?rev=258724&view=rev
Log:
Use Symtab.find() instead of Symtab.getSymbols().lookup().

This was the only place we directly called lookup on the internal table
of the symbol table.

Modified:
    lld/trunk/ELF/OutputSections.cpp

Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=258724&r1=258723&r2=258724&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Mon Jan 25 15:47:25 2016
@@ -656,10 +656,10 @@ template <class ELFT> void DynamicSectio
       Entries.push_back(
           {DT_NEEDED, Out<ELFT>::DynStrTab->addString(F->getSoName())});
 
-  if (Symbol *S = SymTab.getSymbols().lookup(Config->Init))
-    Entries.push_back({DT_INIT, S->Body});
-  if (Symbol *S = SymTab.getSymbols().lookup(Config->Fini))
-    Entries.push_back({DT_FINI, S->Body});
+  if (SymbolBody *B = SymTab.find(Config->Init))
+    Entries.push_back({DT_INIT, B});
+  if (SymbolBody *B = SymTab.find(Config->Fini))
+    Entries.push_back({DT_FINI, B});
 
   uint32_t DtFlags = 0;
   uint32_t DtFlags1 = 0;




More information about the llvm-commits mailing list