[lld] r251927 - Simplify and fix style.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 3 07:46:15 PST 2015


Author: rafael
Date: Tue Nov  3 09:46:15 2015
New Revision: 251927

URL: http://llvm.org/viewvc/llvm-project?rev=251927&view=rev
Log:
Simplify and fix style.

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=251927&r1=251926&r2=251927&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Tue Nov  3 09:46:15 2015
@@ -700,19 +700,17 @@ template <class ELFT> void Writer<ELFT>:
       }
     }
 
-    if (Sec->getSize() && (Sec->getFlags() & SHF_ALLOC) &&
-        (Sec->getFlags() & SHF_TLS)) {
-      if (!TlsPhdr.p_vaddr) {
+    if (Sec->getSize() && (Sec->getFlags() & (SHF_ALLOC | SHF_TLS))) {
+      if (!TlsPhdr.p_vaddr)
         setPhdr(&TlsPhdr, PT_TLS, PF_R, FileOff, VA, 0, Sec->getAlign());
-      }
       if (Sec->getType() != SHT_NOBITS)
         VA = RoundUpToAlignment(VA, Sec->getAlign());
       uintX_t TVA = RoundUpToAlignment(VA + ThreadBSSOffset, Sec->getAlign());
       Sec->setVA(TVA);
       TlsPhdr.p_memsz += Sec->getSize();
-      if (Sec->getType() == SHT_NOBITS)
+      if (Sec->getType() == SHT_NOBITS) {
         ThreadBSSOffset = TVA - VA + Sec->getSize();
-      else {
+      } else {
         TlsPhdr.p_filesz += Sec->getSize();
         VA += Sec->getSize();
       }




More information about the llvm-commits mailing list