diff options
author | Rui Ueyama <ruiu@google.com> | 2016-08-05 01:05:01 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2016-08-05 01:05:01 +0000 |
commit | 808d13ea49baf14ea67dc7db6b0669222603a9e8 (patch) | |
tree | 8d33ddfdd163b93426f1f546fc2d536db6a68e71 /lld/ELF/LinkerScript.cpp | |
parent | 36c1cd235a74e5d3f84b01eec010f98b1ab65d7e (diff) | |
download | bcm5719-llvm-808d13ea49baf14ea67dc7db6b0669222603a9e8.tar.gz bcm5719-llvm-808d13ea49baf14ea67dc7db6b0669222603a9e8.zip |
Move invariants outside of a lambda. NFC.
llvm-svn: 277791
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
-rw-r--r-- | lld/ELF/LinkerScript.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index a2f611a1d49..661f693537d 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -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)); }); |