Move invariants outside of a lambda. NFC.
authorRui Ueyama <ruiu@google.com>
Fri, 5 Aug 2016 01:05:01 +0000 (01:05 +0000)
committerRui Ueyama <ruiu@google.com>
Fri, 5 Aug 2016 01:05:01 +0000 (01:05 +0000)
llvm-svn: 277791

lld/ELF/LinkerScript.cpp

index a2f611a..661f693 100644 (file)
@@ -213,11 +213,11 @@ template <class ELFT> void LinkerScript<ELFT>::filter() {
     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));
     });