[lld] r336282 - [ELF] - Simplify. NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 4 08:05:21 PDT 2018


Author: grimar
Date: Wed Jul  4 08:05:21 2018
New Revision: 336282

URL: http://llvm.org/viewvc/llvm-project?rev=336282&view=rev
Log:
[ELF] - Simplify. NFC.

Currently, there are only OutputSection and SymbolAssignment
commands possible at the first level under SECTIONS tag.

So, shouldSkip() contained dead "return true".

Patch simplifies the code.

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=336282&r1=336281&r2=336282&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Wed Jul  4 08:05:21 2018
@@ -999,11 +999,9 @@ static int getRankProximity(OutputSectio
 //  rw_sec : { *(rw_sec) }
 // would mean that the RW PT_LOAD would become unaligned.
 static bool shouldSkip(BaseCommand *Cmd) {
-  if (isa<OutputSection>(Cmd))
-    return false;
   if (auto *Assign = dyn_cast<SymbolAssignment>(Cmd))
     return Assign->Name != ".";
-  return true;
+  return false;
 }
 
 // We want to place orphan sections so that they share as much




More information about the llvm-commits mailing list