[Mlir-commits] [mlir] [mlir][ODS] Optionally generate public C++ functions for type constraints (PR #104577)
River Riddle
llvmlistbot at llvm.org
Tue Aug 20 11:17:34 PDT 2024
================
@@ -1023,6 +1023,55 @@ bool DefGenerator::emitDefs(StringRef selectedDialect) {
return false;
}
+//===----------------------------------------------------------------------===//
+// Type Constraints
+//===----------------------------------------------------------------------===//
+
+static const char *const typeConstraintDecl = R"(
+bool {0}(::mlir::Type type);
+)";
+
+static const char *const typeConstraintDef = R"(
+bool {0}(::mlir::Type type) {
+ return ({1});
+}
+)";
----------------
River707 wrote:
Small suggestion: These code blocks are so small, it's probably be more compact to just inline them into the functions that use them. Feel free to ignore though.
https://github.com/llvm/llvm-project/pull/104577
More information about the Mlir-commits
mailing list