[lld] r292628 - Simplify. NFC.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 20 10:20:38 PST 2017


Author: rafael
Date: Fri Jan 20 12:20:37 2017
New Revision: 292628

URL: http://llvm.org/viewvc/llvm-project?rev=292628&view=rev
Log:
Simplify. NFC.

addIgnored already creates the symbol only if there is a reference to
it.

Modified:
    lld/trunk/ELF/Writer.cpp

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=292628&r1=292627&r2=292628&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Fri Jan 20 12:20:37 2017
@@ -765,14 +765,9 @@ template <class ELFT> void Writer<ELFT>:
   auto Define = [this](StringRef S, DefinedRegular<ELFT> *&Sym1,
                        DefinedRegular<ELFT> *&Sym2) {
     Sym1 = Symtab<ELFT>::X->addIgnored(S, STV_DEFAULT);
-
-    // The name without the underscore is not a reserved name,
-    // so it is defined only when there is a reference against it.
     assert(S.startswith("_"));
     S = S.substr(1);
-    if (SymbolBody *B = Symtab<ELFT>::X->find(S))
-      if (!B->isInCurrentDSO())
-        Sym2 = Symtab<ELFT>::X->addAbsolute(S, STV_DEFAULT);
+    Sym2 = Symtab<ELFT>::X->addIgnored(S, STV_DEFAULT);
   };
 
   Define("_end", ElfSym<ELFT>::End, ElfSym<ELFT>::End2);




More information about the llvm-commits mailing list