From 808d13ea49baf14ea67dc7db6b0669222603a9e8 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Fri, 5 Aug 2016 01:05:01 +0000 Subject: [PATCH] Move invariants outside of a lambda. NFC. llvm-svn: 277791 --- lld/ELF/LinkerScript.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index a2f611a..661f693 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -213,11 +213,11 @@ template void LinkerScript::filter() { if (Cmd->Constraint == ConstraintKind::NoConstraint) continue; + bool RO = (Cmd->Constraint == ConstraintKind::ReadOnly); + bool RW = (Cmd->Constraint == ConstraintKind::ReadWrite); + removeElementsIf(*OutputSections, [&](OutputSectionBase *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)); }); -- 2.7.4