[lld] r315421 - Remove useless cast.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 10 19:55:05 PDT 2017


Author: ruiu
Date: Tue Oct 10 19:55:05 2017
New Revision: 315421

URL: http://llvm.org/viewvc/llvm-project?rev=315421&view=rev
Log:
Remove useless cast.

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=315421&r1=315420&r2=315421&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Tue Oct 10 19:55:05 2017
@@ -224,9 +224,8 @@ static bool matchConstraints(ArrayRef<In
   if (Kind == ConstraintKind::NoConstraint)
     return true;
 
-  bool IsRW = llvm::any_of(Sections, [](InputSectionBase *Sec) {
-    return static_cast<InputSectionBase *>(Sec)->Flags & SHF_WRITE;
-  });
+  bool IsRW = llvm::any_of(
+      Sections, [](InputSectionBase *Sec) { return Sec->Flags & SHF_WRITE; });
 
   return (IsRW && Kind == ConstraintKind::ReadWrite) ||
          (!IsRW && Kind == ConstraintKind::ReadOnly);




More information about the llvm-commits mailing list