[lld] r277791 - Move invariants outside of a lambda. NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 4 18:05:01 PDT 2016


Author: ruiu
Date: Thu Aug  4 20:05:01 2016
New Revision: 277791

URL: http://llvm.org/viewvc/llvm-project?rev=277791&view=rev
Log:
Move invariants outside of a lambda. 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=277791&r1=277790&r2=277791&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Thu Aug  4 20:05:01 2016
@@ -213,11 +213,11 @@ template <class ELFT> void LinkerScript<
     if (Cmd->Constraint == ConstraintKind::NoConstraint)
       continue;
 
+    bool RO = (Cmd->Constraint == ConstraintKind::ReadOnly);
+    bool RW = (Cmd->Constraint == ConstraintKind::ReadWrite);
+
     removeElementsIf(*OutputSections, [&](OutputSectionBase<ELFT> *S) {
       bool Writable = (S->getFlags() & SHF_WRITE);
-      bool RO = (Cmd->Constraint == ConstraintKind::ReadOnly);
-      bool RW = (Cmd->Constraint == ConstraintKind::ReadWrite);
-
       return S->getName() == Cmd->Name &&
              ((RO && Writable) || (RW && !Writable));
     });




More information about the llvm-commits mailing list