[lld] r329125 - Merge two `if`s and add a few blank lines. NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 3 15:39:04 PDT 2018


Author: ruiu
Date: Tue Apr  3 15:39:04 2018
New Revision: 329125

URL: http://llvm.org/viewvc/llvm-project?rev=329125&view=rev
Log:
Merge two `if`s and add a few blank lines. NFC.

Modified:
    lld/trunk/ELF/SymbolTable.cpp

Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=329125&r1=329124&r2=329125&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Tue Apr  3 15:39:04 2018
@@ -296,19 +296,21 @@ Symbol *SymbolTable::addUndefined(String
   uint8_t Visibility = getVisibility(StOther);
   std::tie(S, WasInserted) =
       insert(Name, Type, Visibility, CanOmitFromDynSym, File);
+
   // An undefined symbol with non default visibility must be satisfied
   // in the same DSO.
   if (WasInserted || (isa<SharedSymbol>(S) && Visibility != STV_DEFAULT)) {
     replaceSymbol<Undefined>(S, File, Name, Binding, StOther, Type);
     return S;
   }
+
   if (S->isShared() || S->isLazy() || (S->isUndefined() && Binding != STB_WEAK))
     S->Binding = Binding;
-  if (Binding != STB_WEAK) {
+
+  if (!Config->GcSections && Binding != STB_WEAK)
     if (auto *SS = dyn_cast<SharedSymbol>(S))
-      if (!Config->GcSections)
-        SS->getFile<ELFT>().IsNeeded = true;
-  }
+      SS->getFile<ELFT>().IsNeeded = true;
+
   if (S->isLazy()) {
     // An undefined weak will not fetch archive members. See comment on Lazy in
     // Symbols.h for the details.




More information about the llvm-commits mailing list