[lld] r305341 - Simplify. NFC.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 13 16:54:34 PDT 2017


Author: rafael
Date: Tue Jun 13 18:54:34 2017
New Revision: 305341

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

Modified:
    lld/trunk/ELF/LinkerScript.cpp

Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=305341&r1=305340&r2=305341&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Tue Jun 13 18:54:34 2017
@@ -680,8 +680,7 @@ void LinkerScript::removeEmptyCommands()
   auto Pos = std::remove_if(
       Opt.Commands.begin(), Opt.Commands.end(), [&](BaseCommand *Base) {
         if (auto *Cmd = dyn_cast<OutputSectionCommand>(Base))
-          return std::find(OutputSections.begin(), OutputSections.end(),
-                           Cmd->Sec) == OutputSections.end();
+          return Cmd->Sec == nullptr;
         return false;
       });
   Opt.Commands.erase(Pos, Opt.Commands.end());




More information about the llvm-commits mailing list