From adcdb664cb6f4868fa7012132c9355bac815ec75 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Tue, 6 Sep 2016 22:50:48 +0000 Subject: [PATCH] Simplify a boolean expression by using the De Morgan's law. llvm-svn: 280766 --- lld/ELF/LinkerScript.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 8634229..5f04382 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -162,7 +162,7 @@ static bool checkConstraint(uint64_t Flags, ConstraintKind Kind) { 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 -- 2.7.4