[Mlir-commits] [mlir] [mlir][irdl] Add `irdl.base` op (PR #76400)

Fehr Mathieu llvmlistbot at llvm.org
Wed Jan 3 14:27:18 PST 2024


================
@@ -69,6 +69,39 @@ LogicalResult IsConstraint::verify(function_ref<InFlightDiagnostic()> emitError,
   return failure();
 }
 
+LogicalResult
+BaseAttrConstraint::verify(function_ref<InFlightDiagnostic()> emitError,
+                           Attribute attr, ConstraintVerifier &context) const {
+  if (attr.getTypeID() == baseTypeID)
+    return success();
+
+  if (emitError)
----------------
math-fehr wrote:

It's null when you are inside the check of an `irdl.any_of`.
If you have a constraint like `AnyOf<i32, i64>` for instance, you will verify both sides, so you don't want an error to be emitted until you checked both.

https://github.com/llvm/llvm-project/pull/76400


More information about the Mlir-commits mailing list