[JITLink] Silence GCC warnings about parentheses around && and || operators
authorMartin Storsjö <martin@martin.st>
Thu, 11 Aug 2022 06:56:49 +0000 (09:56 +0300)
committerMartin Storsjö <martin@martin.st>
Thu, 11 Aug 2022 06:58:11 +0000 (09:58 +0300)
This silences the following warnings:

../include/llvm/ExecutionEngine/JITLink/JITLink.h:1108:56: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
 1105 |     assert(S == Scope::Local || llvm::count_if(AbsoluteSymbols,
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1106 |                                                [&](const Symbol *Sym) {
      |                                                ~~~~~~~~~~~~~~~~~~~~~~~~
 1107 |                                                  return Sym->getName() == Name;
      |                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1108 |                                                }) == 0 &&
      |                                                ~~~~~~~~^~
 1109 |                                     "Duplicate absolute symbol");
      |                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~

llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h

index e53e3ff..00c60d0 100644 (file)
@@ -1102,10 +1102,10 @@ public:
   Symbol &addAbsoluteSymbol(StringRef Name, orc::ExecutorAddr Address,
                             orc::ExecutorAddrDiff Size, Linkage L, Scope S,
                             bool IsLive) {
-    assert(S == Scope::Local || llvm::count_if(AbsoluteSymbols,
+    assert((S == Scope::Local || llvm::count_if(AbsoluteSymbols,
                                                [&](const Symbol *Sym) {
                                                  return Sym->getName() == Name;
-                                               }) == 0 &&
+                                               }) == 0) &&
                                     "Duplicate absolute symbol");
     auto &Sym = Symbol::constructAbsolute(Allocator.Allocate<Symbol>(),
                                           createAddressable(Address), Name,