[Mlir-commits] [mlir] [mlir] [irdl] Add support for regions in irdl-to-cpp (PR #158540)
Théo Degioanni
llvmlistbot at llvm.org
Mon Sep 29 10:24:27 PDT 2025
================
@@ -301,6 +360,112 @@ static LogicalResult generateInclude(irdl::DialectOp dialect,
return success();
}
+static void generateVerifiers(irdl::detail::dictionary &dict,
+ irdl::OperationOp op, const OpStrings &strings) {
+ SmallVector<std::string> verifierHelpers;
+ SmallVector<std::string> verifierCalls;
+ auto regionsOp = op.getOp<irdl::RegionsOp>();
+ if (strings.opRegionNames.empty() || !regionsOp) {
----------------
Moxinilian wrote:
Would it make sense to already break this function into a `generateRegionConstraintVerifiers`, even if it makes `generateVerifiers` rather trivial, merely for the sake of laying the ground work for the upcoming verifiers? For that purpose maybe it would make sense to accumulate the verifier parts into a collector (or breaking them into different generated methods could be neat), and generate the function (potentially with no verifier parts). That way we could also always generate the verify invariants trait, for consistency purposes, as I don't think it's a bad thing to have and it will be needed in most cases anyway?
https://github.com/llvm/llvm-project/pull/158540
More information about the Mlir-commits
mailing list