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

Sergio Afonso via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Jul 19 07:02:55 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.
----------------
skatrak wrote:

I agree, this should be made clearer in the comments.

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


More information about the llvm-branch-commits mailing list