[Mlir-commits] [mlir] 49157fd - [mlir][NFC] Fix compilation error downstream when `NDEBUG` is defined

Markus Böck llvmlistbot at llvm.org
Thu Aug 25 10:55:30 PDT 2022


Author: Markus Böck
Date: 2022-08-25T19:55:18+02:00
New Revision: 49157fd468521ee482d3f5a0ae1586f9d7c8a550

URL: https://github.com/llvm/llvm-project/commit/49157fd468521ee482d3f5a0ae1586f9d7c8a550
DIFF: https://github.com/llvm/llvm-project/commit/49157fd468521ee482d3f5a0ae1586f9d7c8a550.diff

LOG: [mlir][NFC] Fix compilation error downstream when `NDEBUG` is defined

If the LLVM build used was compiled with `LLVM_ENABLE_ABI_BREAKING_CHECKS` but the header was included with `NDEBUG` defined, a compilation error would occur as there is a pack expansion operator (`...`), but no variadic arguments existed. This was due to the assert being preprocessed to an empty expression.

This commit moves the pack expansion within the `assert` to also be removed with the `assert`.

Added: 
    

Modified: 
    mlir/include/mlir/IR/PatternMatch.h

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/IR/PatternMatch.h b/mlir/include/mlir/IR/PatternMatch.h
index 84f2e2a94c8c5..8d62d3109991b 100644
--- a/mlir/include/mlir/IR/PatternMatch.h
+++ b/mlir/include/mlir/IR/PatternMatch.h
@@ -1098,10 +1098,9 @@ void assertArgs(PatternRewriter &rewriter, ArrayRef<PDLValue> values,
     llvm::report_fatal_error(msg);
   };
   (void)errorFn;
-  (assert(succeeded(
-       ProcessPDLValue<typename FnTraitsT::template arg_t<I + 1>>::verifyAsArg(
-           errorFn, values[I], I))),
-   ...);
+  assert((succeeded(ProcessPDLValue<typename FnTraitsT::template arg_t<I + 1>>::
+                        verifyAsArg(errorFn, values[I], I)) &&
+          ...));
 #endif
 }
 


        


More information about the Mlir-commits mailing list