[Mlir-commits] [flang] [mlir] [mlir][OpenACC][OpenMP] Use explicit attribute APIs (PR #218901)

Mehdi Amini llvmlistbot at llvm.org
Wed Aug 26 07:23:44 PDT 2026


================
@@ -42,6 +42,21 @@ class BlockArgOpenMPClause<string clauseNameSnake, string clauseNameCamel,
     }]
   >;
 
+  // Unified access method for symbols associated with the given clause. The
+  // strict naming scheme for clause arguments lets the default implementation
+  // look up the corresponding inherent attribute directly.
+  InterfaceMethod symsMethod = InterfaceMethod<
+    "Get symbols associated to `" # clauseNameSnake # "`, if present.",
+    "::std::optional<::mlir::ArrayAttr>",
+    "get" # clauseNameCamel # "Syms", (ins), [{}], [{
+      auto attr = $_op->getInherentAttr(
+    }] # "\"" # clauseNameSnake # "_syms\");" # [{
+      if (!attr)
+        return ::std::nullopt;
+      return ::llvm::dyn_cast<::mlir::ArrayAttr>(*attr);
----------------
joker-eph wrote:

Done. The interface default now returns nullptr; operations containing the clause use their autogenerated typed get<ClauseName>Syms() accessor.

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


More information about the Mlir-commits mailing list