[llvm-branch-commits] [mlir] [MLIR][OpenMP] Automate operand structure definition (PR #99508)

Michael Kruse via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Jul 19 05:31:15 PDT 2024


================
@@ -12,11 +12,43 @@
 
 #include "mlir/TableGen/GenInfo.h"
 
+#include "mlir/TableGen/CodeGenHelpers.h"
+#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/TypeSwitch.h"
 #include "llvm/TableGen/Error.h"
 #include "llvm/TableGen/Record.h"
 
 using namespace llvm;
 
+/// The code block defining the base mixin class for combining clause operand
+/// structures.
+static const char *const baseMixinClass = R"(
+namespace detail {
+template <typename... Mixins>
+struct Clauses : public Mixins... {};
+} // namespace detail
+)";
+
+/// The code block defining operation argument structures.
+static const char *const operationArgStruct = R"(
+using {0}Operands = detail::Clauses<{1}>;
+)";
+
+/// Remove multiple optional prefixes and suffixes from \c str.
----------------
Meinersbur wrote:

Is being ordered intended. I.e. `CollapseClauseSkip` is normalized to `Collapse`, but not `CollapseSkipClause`? Whatever the intention, it should be documented.

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


More information about the llvm-branch-commits mailing list