[lld] r307076 - [ELF] - Use llvm::find_if instead std::find_if where possible. NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 4 06:10:37 PDT 2017


Author: grimar
Date: Tue Jul  4 06:10:37 2017
New Revision: 307076

URL: http://llvm.org/viewvc/llvm-project?rev=307076&view=rev
Log:
[ELF] - Use llvm::find_if instead std::find_if where possible. NFC.

Two more places.

Modified:
    lld/trunk/ELF/LinkerScript.cpp
    lld/trunk/ELF/Writer.cpp

Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=307076&r1=307075&r2=307076&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Tue Jul  4 06:10:37 2017
@@ -485,12 +485,11 @@ void LinkerScript::addOrphanSections(Out
     if (!S->Live || S->Parent)
       continue;
     StringRef Name = getOutputSectionName(S->Name);
-    auto I = std::find_if(
-        Opt.Commands.begin(), Opt.Commands.end(), [&](BaseCommand *Base) {
-          if (auto *Cmd = dyn_cast<OutputSectionCommand>(Base))
-            return Cmd->Name == Name;
-          return false;
-        });
+    auto I = llvm::find_if(Opt.Commands, [&](BaseCommand *Base) {
+      if (auto *Cmd = dyn_cast<OutputSectionCommand>(Base))
+        return Cmd->Name == Name;
+      return false;
+    });
     if (I == Opt.Commands.end()) {
       Factory.addInputSec(S, Name);
     } else {

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=307076&r1=307075&r2=307076&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Tue Jul  4 06:10:37 2017
@@ -1550,11 +1550,9 @@ template <class ELFT>
 void Writer<ELFT>::addPtArmExid(std::vector<PhdrEntry> &Phdrs) {
   if (Config->EMachine != EM_ARM)
     return;
-  auto I =
-      std::find_if(OutputSectionCommands.begin(), OutputSectionCommands.end(),
-                   [](OutputSectionCommand *Cmd) {
-                     return Cmd->Sec->Type == SHT_ARM_EXIDX;
-                   });
+  auto I = llvm::find_if(OutputSectionCommands, [](OutputSectionCommand *Cmd) {
+    return Cmd->Sec->Type == SHT_ARM_EXIDX;
+  });
   if (I == OutputSectionCommands.end())
     return;
 




More information about the llvm-commits mailing list