[lld] r299495 - Remove `=` from a lambda that doesn't capture any variable.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 4 17:43:45 PDT 2017


Author: ruiu
Date: Tue Apr  4 19:43:45 2017
New Revision: 299495

URL: http://llvm.org/viewvc/llvm-project?rev=299495&view=rev
Log:
Remove `=` from a lambda that doesn't capture any variable.

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=299495&r1=299494&r2=299495&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Tue Apr  4 19:43:45 2017
@@ -314,10 +314,11 @@ static bool matchConstraints(ArrayRef<In
                              ConstraintKind Kind) {
   if (Kind == ConstraintKind::NoConstraint)
     return true;
-  bool IsRW = llvm::any_of(Sections, [=](InputSectionBase *Sec2) {
-    auto *Sec = static_cast<InputSectionBase *>(Sec2);
-    return Sec->Flags & SHF_WRITE;
+
+  bool IsRW = llvm::any_of(Sections, [](InputSectionBase *Sec) {
+    return static_cast<InputSectionBase *>(Sec)->Flags & SHF_WRITE;
   });
+
   return (IsRW && Kind == ConstraintKind::ReadWrite) ||
          (!IsRW && Kind == ConstraintKind::ReadOnly);
 }




More information about the llvm-commits mailing list