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

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 21 06:21:23 PST 2018


Author: grimar
Date: Wed Feb 21 06:21:23 2018
New Revision: 325681

URL: http://llvm.org/viewvc/llvm-project?rev=325681&view=rev
Log:
[ELF] - Simplify. 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=325681&r1=325680&r2=325681&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Wed Feb 21 06:21:23 2018
@@ -1348,9 +1348,7 @@ template <class ELFT> void Writer<ELFT>:
     // Remove the Sections we marked as duplicate earlier.
     for (BaseCommand *Base : Sec->SectionCommands)
       if (auto *ISD = dyn_cast<InputSectionDescription>(Base))
-        ISD->Sections.erase(
-            std::remove(ISD->Sections.begin(), ISD->Sections.end(), nullptr),
-            ISD->Sections.end());
+        llvm::erase_if(ISD->Sections, [](InputSection *IS) { return !IS; });
   }
 }
 




More information about the llvm-commits mailing list