[lld] r280766 - Simplify a boolean expression by using the De Morgan's law.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 6 15:50:48 PDT 2016
Author: ruiu
Date: Tue Sep 6 17:50:48 2016
New Revision: 280766
URL: http://llvm.org/viewvc/llvm-project?rev=280766&view=rev
Log:
Simplify a boolean expression by using the De Morgan's law.
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=280766&r1=280765&r2=280766&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Tue Sep 6 17:50:48 2016
@@ -162,7 +162,7 @@ static bool checkConstraint(uint64_t Fla
bool RO = (Kind == ConstraintKind::ReadOnly);
bool RW = (Kind == ConstraintKind::ReadWrite);
bool Writable = Flags & SHF_WRITE;
- return !((RO && Writable) || (RW && !Writable));
+ return !(RO && Writable) && !(RW && !Writable);
}
template <class ELFT>
More information about the llvm-commits
mailing list