llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-hlsl

@llvm/pr-subscribers-clang

Author: Martin Storsjö (mstorsjo)

<details>
<summary>Changes</summary>

This avoids the following kind of warning with GCC:

    ../tools/llvm-lipo/llvm-lipo.cpp: In function ‘void 
printInfo(llvm::LLVMContext&amp;, 
llvm::ArrayRef&lt;llvm::object::OwningBinary&lt;llvm::object::Binary&gt; &gt;)’:
    ../tools/llvm-lipo/llvm-lipo.cpp:464:34: warning: suggest parentheses 
around ‘&amp; ’ within ‘||’ [-Wparentheses]
      464 |              Binary-&gt;isArchive() &amp;&amp; "expected MachO 
binary");
          |              ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~

---
Full diff: https://github.com/llvm/llvm-project/pull/159333.diff


2 Files Affected:

- (modified) clang/lib/CodeGen/CGHLSLRuntime.cpp (+3-3) 
- (modified) llvm/tools/llvm-lipo/llvm-lipo.cpp (+2-2) 


``````````diff
diff --git a/clang/lib/CodeGen/CGHLSLRuntime.cpp 
b/clang/lib/CodeGen/CGHLSLRuntime.cpp
index 49bc408a1b305..cf018c8c7de2a 100644
--- a/clang/lib/CodeGen/CGHLSLRuntime.cpp
+++ b/clang/lib/CodeGen/CGHLSLRuntime.cpp
@@ -922,9 +922,9 @@ void 
CGHLSLRuntime::emitInitListOpaqueValues(CodeGenFunction &CGF,
 
 std::optional<LValue> CGHLSLRuntime::emitResourceArraySubscriptExpr(
     const ArraySubscriptExpr *ArraySubsExpr, CodeGenFunction &CGF) {
-  assert(ArraySubsExpr->getType()->isHLSLResourceRecord() ||
-         ArraySubsExpr->getType()->isHLSLResourceRecordArray() &&
-             "expected resource array subscript expression");
+  assert((ArraySubsExpr->getType()->isHLSLResourceRecord() ||
+          ArraySubsExpr->getType()->isHLSLResourceRecordArray()) &&
+         "expected resource array subscript expression");
 
   // Let clang codegen handle local resource array subscripts,
   // or when the subscript references on opaque expression (as part of
diff --git a/llvm/tools/llvm-lipo/llvm-lipo.cpp 
b/llvm/tools/llvm-lipo/llvm-lipo.cpp
index d4b1f8f3dd7d4..3e1d4165e8ed7 100644
--- a/llvm/tools/llvm-lipo/llvm-lipo.cpp
+++ b/llvm/tools/llvm-lipo/llvm-lipo.cpp
@@ -460,8 +460,8 @@ printInfo(LLVMContext &LLVMCtx, 
ArrayRef<OwningBinary<Binary>> InputBinaries) {
   for (auto &IB : InputBinaries) {
     const Binary *Binary = IB.getBinary();
     if (!Binary->isMachOUniversalBinary()) {
-      assert(Binary->isMachO() ||
-             Binary->isArchive() && "expected MachO binary");
+      assert((Binary->isMachO() || Binary->isArchive()) &&
+             "expected MachO binary");
       outs() << "Non-fat file: " << Binary->getFileName()
              << " is architecture: ";
       printBinaryArchs(LLVMCtx, Binary, outs());

``````````

</details>


https://github.com/llvm/llvm-project/pull/159333
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to