[lld] r296511 - Minor refactoring. NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 28 11:43:55 PST 2017


Author: ruiu
Date: Tue Feb 28 13:43:54 2017
New Revision: 296511

URL: http://llvm.org/viewvc/llvm-project?rev=296511&view=rev
Log:
Minor refactoring. NFC.

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=296511&r1=296510&r2=296511&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Tue Feb 28 13:43:54 2017
@@ -527,10 +527,11 @@ template <class ELFT> void Writer<ELFT>:
   // Create one STT_SECTION symbol for each output section we might
   // have a relocation with.
   for (OutputSection *Sec : OutputSections) {
-    InputSection *IS = nullptr;
-    if (!Sec->Sections.empty())
-      IS = Sec->Sections[0];
-    if (!IS || isa<SyntheticSection>(IS) || IS->Type == SHT_REL ||
+    if (Sec->Sections.empty())
+      continue;
+
+    InputSection *IS = Sec->Sections[0];
+    if (isa<SyntheticSection>(IS) || IS->Type == SHT_REL ||
         IS->Type == SHT_RELA)
       continue;
 




More information about the llvm-commits mailing list